Search code examples
udptcpngrok

Convert UDP to TCP - Ngrok TCP => UDP


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?


Solution

  • 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.