Handle wildcard source public IP addresses properly #101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 to0.0.0.0:5000
in myServerConfig
and was able to receive messages successfully by connecting to127.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)