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

array of ip addresses not used #37

Open
peterskurt opened this issue Feb 7, 2015 · 1 comment
Open

array of ip addresses not used #37

peterskurt opened this issue Feb 7, 2015 · 1 comment

Comments

@peterskurt
Copy link

Is there a way to determine if the system is using an array of IP addresses for the host that myIpAddressEx() provides. It doesn't give the same functionality of the browser because of that. I had to add my system's list of ip returned by myIpAddressEx in setmyip() to get the same behavior. Otherwise it seems like it just returns the first IP?

@DrDaveD
Copy link

DrDaveD commented Feb 10, 2015

According to the code (see especially my_ip_ex() and resolve_host()), by default myIpAddressEx() should return a semi-colon separated list of whatever getnameinfo() returns using the host name from gethostname(). That would be multiple IP addresses (in particular IPv4 and IPv6) for a single network interface. It does not look up all the IP addresses on all network interfaces that a host may have. This seems to match the Microsoft definition of this function. Does a browser behave differently, and if so which one?

In order to handle hosts with multiple interfaces, I believe the solution that I submitted in this pull request is better.

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

No branches or pull requests

2 participants