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.
Dominic just transferred this repo to ssbc on my request.
I've been maintaining a fork of this module at https://github.com/staltz/non-private-ip/tree/fork and published it to npm as
non-private-ip-android
, the reason for that is because when theprivate()
API of this module is used, I would like to get the best available IP address across all network interfaces, and usually the "best" means an IPv4 on WLAN, avoiding some IPv4 such as "rmnet" which (I think) is the Mobile ISP's network address, and that one was always the wrong choice.So I developed a score system that prioritizes those, but there's others. The ranking order is: WLAN IPv4 > Ethernet IPv4 > WLAN IPv6 > Ethernet IPv6 > VPN IPv4 > VPN IPv6
Apart from that, I also added support for IPv6 scopes, such as
%eth0
infe80::f03c:91ff:fe56:9728%eth0
.Most importantly, I've been running
non-private-ip-android
in production in Manyverse on Android, iOS, and Desktop, so I am positive that the implementation is good, and that's why I'm making this PR, so we can make it the next officialnon-private-ip
.