Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document hosting behind port-forwarded NAT #45

Open
Alainx277 opened this issue Sep 17, 2022 · 2 comments
Open

Document hosting behind port-forwarded NAT #45

Alainx277 opened this issue Sep 17, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@Alainx277
Copy link
Contributor

Hosting behind a NAT router requires passing a different public IP to the server config and the socket. This is not visible in the examples or anything I had read. Doing this incorrectly causes no connections to go through, with no warnings.

Maybe there could be a comment in the examples. Above the line that builds the server config would be a good place in my opininon.

Original issue

I originally wanted to write a feature request, then realized it was already possible, just not very clear.

Original Text The IP a server listens on must match the one a client connects to. This prevents hosting behind a NAT device (like a home router), as the server can't bind on the public IP of the entire network.

Hosting with port forwarding from home is a common thing when playing games with friends. I personally need it for testing my game from my personal computer.

@lucaspoffo
Copy link
Owner

Public address configuration seems to be a recurring cause of confusion. Adding some common scenarios in the readme or the doc should help, especially about NAT, port-forwarding, dedicated server... Maybe also add some external resources about it, but don't know which one.

@lucaspoffo lucaspoffo added the documentation Improvements or additions to documentation label Oct 1, 2022
@sethquantix
Copy link

sethquantix commented Jan 27, 2023

I met this exact issue a few days ago. What exactly is the point of the NoHost error ? matching IP address once you're connected to an UDP socket doesn't make a lot of sense to me. Is it only for the Authentication side of things ?

Edit: So I went back digging into the RenetClient code. This problem only really occurs when you use Unsecure authentication, because you can only provide the one server address you use. I'm testing the connection over both local, LAN, and internet. So 3 different addresses (potentially). With secure authentication, it kinda goes away if you go through the hassle of setting up your external IP on the server configuration, but you might not know that (thinking aws hosting or similar. Plus it's way easier to just setup the server on 127.0.0.1 and proxy forward the traffic).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants