-
Notifications
You must be signed in to change notification settings - Fork 2
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
Loopback IP instead of local IP used on Linux #21
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found an unexpected bug, the "Gov-Client-Local-IPs" header is populated with the loopback address ("127.x") on Linux, and not the local IP address.
This is because Python's socket.getbyhostname() returns the value in /etc/hosts, which usually has the loopback address.
On Win and Mac OS the behaviour seems to be correct, but I haven't tested for myself.
After a bit of searching, I found a solution like this (which doesn't add extra dep's):
Unfortunately I don't know how to get the gateway IP, so the code above uses my default (the example used 8.8.8.8, but I don't want to open connections externally if it's not needed).
The text was updated successfully, but these errors were encountered: