Skip to content

Workaround world connection issues caused by routers that lack Hairpin NAT support#1359

Open
Subsonic154 wants to merge 7 commits into
psforever:masterfrom
Subsonic154:no-hairpin-nat-world-connection-fix
Open

Workaround world connection issues caused by routers that lack Hairpin NAT support#1359
Subsonic154 wants to merge 7 commits into
psforever:masterfrom
Subsonic154:no-hairpin-nat-world-connection-fix

Conversation

@Subsonic154

@Subsonic154 Subsonic154 commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

This acts as a built-in workaround to world connection issues caused by this network configuration (which usually can't be fixed by the user without getting a new router, only worked around). I ran into this when I started having other people connect to my dev server for play-testing changes and figured I'd do something about it.

What this does is use separate world server forwarding logic depending on if the connection is coming from the local network or not, if the connection is from outside of the local network, it should behave the same as before, I've tested this extensively and nothing appears to be broken. If the connection is from the local network it uses different logic, localhost connections just get forwarded back to localhost, ignoring the public address, connections from other machines on the local network get forwarded to a new local address parameter in application.conf instead.

Adding a local/private address parameter to the config is not how I would've liked to have implemented this fix for other machines on the local network, but it's the only solution I could come up with that was cross-OS compatible without system file tweaks, and I wanted to keep setup simple.

If there's a better way I could've handled any of the changes here please reach out.

@Subsonic154

Copy link
Copy Markdown
Contributor Author

Connections seem to be working fine on the test server instance this PR spun up, if that's a close enough representation of a container environment to know this doesn't break that, let me know and I'll mark this ready for merge.

@Subsonic154 Subsonic154 changed the title [NEEDS TESTING] Workaround world connection issues caused by routers that lack Hairpin NAT support Workaround world connection issues caused by routers that lack Hairpin NAT support Apr 16, 2026
@Subsonic154 Subsonic154 marked this pull request as ready for review April 16, 2026 15:12
@Subsonic154

Copy link
Copy Markdown
Contributor Author

I'm fairly confident this is safe now, so marking as ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant