For people with routers not supporting NAT loopback, it is not possible to join a lobby game from someone hosting from the same network (e.g. another computer, the same computer).
This is annoying because it prevents:
- having a dedicated server at home
- playing with your friends at home via the lobby (which can be easier than via regular MP).
The solution is to open a socket and find the local IP. My solution is based on https://stackoverflow.com/a/59025254 which should work even without proper internet.
The client will query its public IP, match against the server, and if they are the same, assume they're on the same network & try to use the local IP instead.