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

Support for showing internet connectivity through proxy servers #18

Closed
icyflame opened this issue Jun 1, 2015 · 17 comments
Closed

Support for showing internet connectivity through proxy servers #18

icyflame opened this issue Jun 1, 2015 · 17 comments

Comments

@icyflame
Copy link

icyflame commented Jun 1, 2015

Currently, if I run this from the CLI, and am behind a HTTP/HTTPS proxy, then, it returns offline. Although, I can access internet through the browser, and using the HTTP protocol from the CLI. (I have exported the http_proxy and https_proxy ENV variables)

@silverwind
Copy link
Collaborator

That would mean both the DNS and handshake check fail, which is strange. I assume your DNS is proxied too. Could you post the output of dig (no argument) and nc -v google.com 80? Maybe that gives any clue.

@icyflame
Copy link
Author

icyflame commented Jun 1, 2015

I am sorry, currently, I am not in that environment. I will post the required output when I get back. (Will be a while or that to happen)

What do you mean by:

DNS is proxied too

@silverwind
Copy link
Collaborator

I mean something is intercepting DNS packets and answering on behalf of the real targeted DNS servers.

@sindresorhus
Copy link
Owner

ping @icyflame

@icyflame
Copy link
Author

@sindresorhus Still not back in the environment with proxy servers, will post the required output once I am back.
(Around July 2nd week, closing this issue till then)

@sindresorhus
Copy link
Owner

Ok, make sure you try the latest release when you do. We've done some improvements.

@silverwind
Copy link
Collaborator

I played a bit with my router set to intercepting dns, and surprisingly it didn't alter the packet (source address was still the original one). Maybe your proxy was altering the dns transaction id. I removed that check now because it wasn't really helpful, and we should have a new version pretty momentarily, maybe you can give that one a try.

Still puzzles me why the second check (TCP handshake on port 80) failed for you though.

@icyflame icyflame reopened this Jul 22, 2015
@icyflame
Copy link
Author

The problem still exists. These are the requested outputs :-

$ dig

; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: FORMERR, id: 1325
;; flags: qr rd ra; QUERY: 0, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; WARNING: EDNS query returned status FORMERR - retry with '+noedns'

;; Query time: 1 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Wed Jul 22 15:18:47 IST 2015
;; MSG SIZE  rcvd: 12
$ nc -v www.google.com 80
nc: connect to www.google.com port 80 (tcp) failed: Connection refused
nc: connect to www.google.com port 80 (tcp) failed: Network is unreachable

/ @silverwind @sindresorhus

@silverwind
Copy link
Collaborator

Interesting. Could you also post dig +noedns? Also, do you know what software that proxy is running?

@icyflame
Copy link
Author

$ dig +noedns

; <<>> DiG 9.9.5-3ubuntu0.1-Ubuntu <<>> +noedns
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23140
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 14

;; QUESTION SECTION:
;.              IN  NS

;; ANSWER SECTION:
.           355677  IN  NS  f.root-servers.net.
.           355677  IN  NS  j.root-servers.net.
.           355677  IN  NS  a.root-servers.net.
.           355677  IN  NS  l.root-servers.net.
.           355677  IN  NS  h.root-servers.net.
.           355677  IN  NS  m.root-servers.net.
.           355677  IN  NS  i.root-servers.net.
.           355677  IN  NS  g.root-servers.net.
.           355677  IN  NS  d.root-servers.net.
.           355677  IN  NS  e.root-servers.net.
.           355677  IN  NS  c.root-servers.net.
.           355677  IN  NS  k.root-servers.net.
.           355677  IN  NS  b.root-servers.net.

;; ADDITIONAL SECTION:
a.root-servers.net. 528457  IN  A   198.41.0.4
b.root-servers.net. 14695   IN  A   192.228.79.201
b.root-servers.net. 14695   IN  AAAA    2001:500:84::b
c.root-servers.net. 14695   IN  A   192.33.4.12
c.root-servers.net. 14695   IN  AAAA    2001:500:2::c
d.root-servers.net. 14695   IN  A   199.7.91.13
d.root-servers.net. 14695   IN  AAAA    2001:500:2d::d
e.root-servers.net. 14695   IN  A   192.203.230.10
f.root-servers.net. 254493  IN  A   192.5.5.241
f.root-servers.net. 14695   IN  AAAA    2001:500:2f::f
g.root-servers.net. 269281  IN  A   192.112.36.4
h.root-servers.net. 269281  IN  A   128.63.2.53
h.root-servers.net. 14695   IN  AAAA    2001:500:1::803f:235
i.root-servers.net. 14695   IN  A   192.36.148.17

;; Query time: 1 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Wed Jul 22 15:48:44 IST 2015
;; MSG SIZE  rcvd: 512

No, I am sorry, I don't have any idea as to what software the proxy is running.

@silverwind
Copy link
Collaborator

Thanks, that should suffice. I'll have to read up on EDNS now :)

@kokarn
Copy link

kokarn commented Apr 27, 2016

Any progress on this? Running in to the same problem.

@icyflame
Copy link
Author

No, not really.

cc @silverwind and @sindresorhus

@kokarn
Copy link

kokarn commented Apr 27, 2016

It seems like #22 might be related and a sound workaround. Would love to test.

@icyflame
Copy link
Author

icyflame commented Apr 27, 2016

@kokarn Why a "sound workaround"? I just tried to dig a couple of name servers (including google's 8.8.8.8 / ns1) and it didn't work.

@kokarn
Copy link

kokarn commented Apr 27, 2016

As far as I understand that would make online-detection actually work as intended, eg give us online if online even behind a proxy.

Seems to work through our proxy at least.

@silverwind
Copy link
Collaborator

Moving this topic to sindresorhus/is-reachable#7.

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

4 participants