Search code examples
ngrok

ngrok: tcp forwarding to 25565 (minecraft server)


When i try to use ./ngrok tcp 25565 the region goes to the default (us) one and it forwards the port (x.xxx.ngrok.io:xxxxx).

So i changed the region to the one closest to my country which is asia so i used the command ./ngrok tcp -region=ap 25565. it starts the tcp on the said region but it doesnt forward the port (instead of x.xxx.ngrok.io:xxxxx i get x.xxx.ngrok.io:xx)

this is what happens when i run it

Im not aware if having a 2 digit port is the same as having a 5 digit port but what i used this on is a minecraft server and the only ip that worked was the (x.xxx.ngrok.io:xxxxx) one.


Solution

  • One guess: your terminal window is a fixed width and it is cutting off the port number.

    In particular when you include region, the hostname becomes 3 characters longer than the usual: x.tcp.xx.ngrok.io vs x.tcp.ngrok.io, which fits the fact that you are seeing a port number that is 3 digits shorter than usual.

    To get the right address, you have a couple options:

    • Check your existing tunnel's address would be to look at ngrok's web inspection interface that runs at http://localhost:4040.
    • Check the ngrok web dashboard for online tunnels here: https://dashboard.ngrok.com/endpoints/status.

    Port numbers for ngrok TCP addresses are always 5 digits.