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

Improve URL suggestion by checking against default gateway #12

Open
philippgille opened this issue May 5, 2018 · 0 comments
Open

Improve URL suggestion by checking against default gateway #12

philippgille opened this issue May 5, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@philippgille
Copy link
Owner

Instead of relying on network interface names we could check the IPv4 addresses against the default gateway's address.

For example:

  • The gateway's address is 123.123.123.0
  • Our system, in this example Windows, has (interface name + address):
    • "Ethernet 2": 234.234.234.234
    • "Ethernet 3": 123.123.123.123

If we would choose by name, "Ethernet 2" would match first and we would use that IP address in the URL suggestion, which is the wrong one.

If instead we would match the first three parts of the IP address against the first three parts of the gateway address, we would choose "Ethernet 3", which is the correct one.

This requires determining the gateway's IP address, which is not possible with Go's stdlib. But this package seems to be perfect: https://github.com/jackpal/gateway

@philippgille philippgille added the enhancement New feature or request label May 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant