Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Add the "interface" method to get public IP #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kaoet
Copy link

@kaoet kaoet commented Mar 4, 2018

Some ISPs do NAT on the way to public IP discovery services like icanhazip.com.

This MR adds a new method to get public IP, which is to get it from IP of primary interface directly.

@adrienbrignon
Copy link
Owner

Hey, thanks for your contribution.

So if I understand, it'll work for devices which are not behind a NAT?

@kaoet
Copy link
Author

kaoet commented Mar 6, 2018

Yes. I have a globally routable IPv4 address on my router. But my ISP is really bad. There is NAT on the way to some websites, including icanhazip.com. I can't get correct IP with them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants