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

Handle wildcard source public IP addresses properly #101

Closed
wants to merge 1 commit into from

Conversation

WarrenHood
Copy link

@WarrenHood WarrenHood commented Aug 7, 2023

Fixes: #43

Hi. I believe this check is currently too strict, and we should also handle the wildcard server IP: 0.0.0.0.

This change checks if our public server IP is 0.0.0.0:<port>, and will only check the port if that is the case.

I tested this locally by binding to 0.0.0.0:5000, and setting the public IP to 0.0.0.0:5000 in my ServerConfig and was able to receive messages successfully by connecting to 127.0.0.1:5000. (If I were to port forward, it'd be accessible by ${public-ip}:5000 as well, for example)

Without this, it is quite painful needing to pass in the public IP address of the server, which can change. This doesn't really affect security much since you explicitly need to set your public IP to use this wildcard 0.0.0.0 which just makes testing much more convenient. This also would allow you to connect to your server using your local IP from 1 client, and using your public IP from another (which is currently impossible since we can only set 1 public address)

@WarrenHood WarrenHood changed the title Handle wildcard public IP addresses properly Handle wildcard source public IP addresses properly Aug 7, 2023
@lucaspoffo
Copy link
Owner

lucaspoffo commented Aug 8, 2023

In the netcode standard and some discussions existing in the original implementation, wildcards is a no go. It opens for reusing valid tokens from one server in others. In #102 I made so when using unsecure connections this check is skipped, I also added a way to add multiple ip addresses to the server, so you can add your local and public address.

@lucaspoffo lucaspoffo closed this Aug 8, 2023
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.

Is there a way to start RenetServer on an external interface?
2 participants