gophertunnel icon indicating copy to clipboard operation
gophertunnel copied to clipboard

Can't connect to localhost game

Open sermah opened this issue 3 years ago • 6 comments

I can't connect to my localhost world using Dial("raknet", "localhost:19132") function. It says

panic: ping raknet: context deadline exceeded

What I've tried already (and it didn't work):

  • 127.0.0.1, [::1]
  • setting udp and tcp instead of raknet (udp makes it wait until context deadline exceeded, tcp connection was just refused)
  • using DialTimeout(...) set to several minutes

I didn't change anything in the firewall settings, I have Windows 10 and LAN Multiplayer option is turned on in my world. Everything works fine when I join some internet server. Am I missing something?

sermah avatar May 19 '21 11:05 sermah

Hi! There's two things that seem to be like they might be the issue. First, do you know if the correct port is actually 19132? Can you verify that somehow? Second, you might have to set loopback exemptions for Minecraft using the following command: CheckNetIsolation LoopbackExempt -a -n="Microsoft.MinecraftUWP_8wekyb3d8bbwe"

Please let me know if you get anything with either of those.

Sandertv avatar May 19 '21 11:05 Sandertv

First, do you know if the correct port is actually 19132? Can you verify that somehow?

Actually I am not sure. Several sites say it's the default port. Any ideas how to check which port should I connect to?

sermah avatar May 19 '21 11:05 sermah

Unknown if this is a bug in gophertunnel or something else affecting it. Apparently connecting through gophertunnel with a different device is possible.

Sandertv avatar May 20 '21 09:05 Sandertv

I tried launching gophertunnel and BDS on the same machine and gt successfully joined the game. So, this bug affects only worlds launched in MCBE game.

sermah avatar May 20 '21 10:05 sermah

The default port for servers is 19132, but the client-ran server seems to be a random port. You should try using Wireshark to figure out the actual port.

JustTalDevelops avatar Jul 31 '21 01:07 JustTalDevelops

Like Tal said, client servers choose random ports however they do also broadcast to 19132 to allow for the servers to show on LAN, and go-raknet supports the following of the broadcasts. The issue you're facing is actually the fact that the client server does not accept connections from the same device it is running on.

TwistedAsylumMC avatar Aug 08 '21 18:08 TwistedAsylumMC

Going to close this for the reasons mentioned above.

Sandertv avatar Sep 05 '22 16:09 Sandertv