Convert UDP to TCP - Ngrok TCP => UDP

烂漫一生 提交于 2020-08-05 09:49:43

问题


I'm in a hurry at the moment.

My Question is, is there a way to forward UDP to TCP port? I need this for hosting a game server for my friends, I want to host Counter-Strike server for example, but it uses UDP (User Datagram Protocol) for server port, but NGROK only supports TCP (Transmission Control Protocl) & HTTP (HyperText Transfer Protocol).

I tried this while ago..

ngrok tcp 127.0.0.1:27015

and as usually it will start :

ngrok by @inconshreveable                                       (Ctrl+C to quit)

Session Status                online
Account                       Soricy Infinitive (Plan: Free)
Version                       2.2.8
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    tcp://0.tcp.ngrok.io:18833 -> 127.0.0.1:27015

Connections                   ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00

But fails to connect to 0.tcp.ngrok.io:18833 in the game, and displays that there is no UDP configured on the server side.

Is there any way I could do this differently? UDP=>TCP?


回答1:


Checkout DatagramTunnneler (on github). It is an open-source c++ program which simply listens to UDP traffic and forwards it to a TCP endpoint of your choice. On that TCP endpoint another instance of the DatagramTunneler publishes the UDP data back onto a UDP channel.
Disclaimer: I wrote that tool.




回答2:


One way is to copy the "raw" udp Payload and create a new TCP packet with the raw payload. But you need to set the same data of the other layer except the udp layer. Also: You need a clean configuration of the tcp layer.



来源:https://stackoverflow.com/questions/47208690/convert-udp-to-tcp-ngrok-tcp-udp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!