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

Fails to properly detect "online" under OS X 10.12 (aka macOS Sierra) #29

Closed
brendandixon opened this issue Sep 21, 2016 · 6 comments
Closed

Comments

@brendandixon
Copy link

"pings" to all of the hosts in hostname.js work fine as does full browsing. Yet, this module returns "false" when running under OS X 10.12 (aka macOS Sierra).

@silverwind
Copy link
Collaborator

A working ICMP doesn't really tell you much. Try actually connecting to a port, e.g. nc -v hostname 80.

@brendandixon
Copy link
Author

@silverwind Those all work. I should have mentioned that browsing is fine.

The problem, I now believe, occurs because I'm running within a corporate network. I've not had the time to determine what's not working, but an assumption made, likely by is-reachable, is too restrictive for many networks.

@silverwind
Copy link
Collaborator

silverwind commented Sep 26, 2016

is-reachable does not work behind a forced proxy (Browsers generally do). It's one of the harder problems to solve because of the many mechanisms through which a system can obtain such a proxy. Is my assumption correct that when turn off the proxy in your browser, you can't reach the internet?

@brendandixon
Copy link
Author

@silverwind If the browser runs with a proxy, it is set automatically (browsers allow this) and I have no control, and so cannot test. But I suspect that is the issue.

@silverwind
Copy link
Collaborator

silverwind commented Sep 26, 2016

You can possibly detect a system proxy with networksetup -getwebproxy "Ethernet" (Or whatever is the name of your outgoing interface).

Also I found this node module which looks promising: https://github.com/sholladay/os-proxy

@blahah
Copy link

blahah commented Nov 22, 2016

I don't think this is to do with corporate networks or proxies. I am using macOS 10.12, connecting over Wi-Fi with no proxy and can browse fine, make p2p connections, etc. but is-online always gives false.

silverwind added a commit that referenced this issue Feb 12, 2017
Fixes: #32
Fixes: #30
Fixes: #29
Fixes: #25
Fixes: #22
silverwind added a commit that referenced this issue Feb 14, 2017
Rewrite module to use the following checks in parallel:

- OpenDNS IP check
- icanhaz IP check
- Apple Captive Portal test

This should fix all current issues with the module because the new
methods allow verification of the response, so any kind of tampering
should be detected.

Fixes: #32
Fixes: #30
Fixes: #29
Fixes: #25
Fixes: #22
Fixes: #15
sindresorhus pushed a commit that referenced this issue Mar 13, 2017
* rewrite to use public-ip check

Rewrite module to use the following checks in parallel:

- OpenDNS IP check
- icanhaz IP check
- Apple Captive Portal test

This should fix all current issues with the module because the new
methods allow verification of the response, so any kind of tampering
should be detected.

Fixes: #32
Fixes: #30
Fixes: #29
Fixes: #25
Fixes: #22
Fixes: #15

* Update readme.md
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