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

Why router IPs are considered unreachable? #60

Open
ccll opened this issue Nov 18, 2022 · 4 comments
Open

Why router IPs are considered unreachable? #60

ccll opened this issue Nov 18, 2022 · 4 comments

Comments

@ccll
Copy link

ccll commented Nov 18, 2022

Hi there, I've currently hit by a bug in another software (Gitpod) which uses 'is-reachable' to test the reachability of hosts, digging into the source codes leads me here, I'm not sure if it's relevant so I opened up an issue to discuss it a bit, feel free to close it if inappropriate.

The situation is one of my services is hosted in a home lab setup which IP address is exact 192.168.1.10, which by 'router-ips' is considered an router IP, and 'is-reachable' thought the router IPs are 'unreachable' and returned a false to the caller, thus, my host is determined to be 'not reachable' while it's perfectly reachable.

Relevant code here:
https://github.com/sindresorhus/is-reachable/blob/main/index.js#L55

I'm not sure I understand the rationale behind the decision, maybe logically 'is-reachable' should only check the 'reachability', whether it's an internal router IP or a normal external IP should be irrelevant, or am I missing something here?

@sindresorhus
Copy link
Owner

// @silverwind

@silverwind
Copy link
Collaborator

silverwind commented Nov 18, 2022

It's a failed heuristic. The idea behind router-ips is to detect cases where routers intercept HTTP requests, like captive portals for example. I think we better remove most IPv4's in router-ips that are not 1 in the last octet.

Or even simpler, remove the router-ips dependency altogether in this module, as it's probably causing more issues than it solves.

@silverwind
Copy link
Collaborator

I guess I would be in favor of just removing router-ips here. Guess it's better to just suceed a reachability check if there is something on the remote end, even if it's a captive portal. I recommend bumping semver major for this change.

@ccll
Copy link
Author

ccll commented Nov 19, 2022

That’s great, thanks for the explaination and effort here. ❤️

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

3 participants