6

I'd changed my machine's proxy to connect to a network, but later when I came back to my home network, while chrome and other browsers could not connect, I could ping sites from the terminal and even install ruby bundles.

Given this, how does the terminal work over a proxy?

More so a proxy that is no longer in use because the network changed.

1
  • 3
    Best guess: You set up a proxy for port 80 (and port 80 only). So only your webtraffic is redirected via the proxy and only the webtraffic fails if the proxy is down. As to how to a terminal work ober a proxy: It does not. It simply does not use it. It uses system defaults. And if you only changed proxy settings for/in a browser then there is no reason for ping or any other command to fail.
    – Hennes
    Nov 18, 2015 at 13:37

2 Answers 2

14

When you refer to proxies, it’s usually just about HTTP (and HTTPS), sometimes also FTP. Ping does not use HTTP but ICMP. That means it’s not affected by whatever HTTP proxy you set.

Other tools, like wget (a command line HTTP downloader), respect the http_proxy environment variable. This variable may or may not be set when you change the GUI settings. You can easily check by using the env command.

Some command line tools do not use this variable and instead need the proxy to be explicitly specified (as a parameter) each time the tool is started.

7
  • Proxies are protocol specific. ping uses the ICMP protocol - I've never heard of ICMP proxies but it's not impossible to have one. Web browsers use HTTP. So if an HTTP proxy is down, ping and things using other protocols will work - unless there is a firewall that only allows traffic going through the proxy out.
    – LawrenceC
    Nov 18, 2015 at 22:03
  • @LawrenceC Proxies are protocol specific Not necessarily. SOCKS proxies, such as those created by Tor and SSH tunnels, are not at all protocol-specific. Nov 23, 2015 at 19:40
  • 1
    @VirtualDXS That's not true. SOCKS, the most basic version, is limited to TCP. It's still specific, just on a different level.
    – Daniel B
    Nov 23, 2015 at 20:13
  • Not according to this. Dec 1, 2015 at 17:50
  • That’s why I said “the most basic version”. Yes, SOCKS5 supports UDP. So it was extended to yet another protocol. However, you still won’t be able to use, say, GRE. Or ICMP. It didn’t even support IPv6 before SOCKS5. So yes, SOCKS is still very much protocol-specific.
    – Daniel B
    Dec 1, 2015 at 20:35
2

I think this deserves a simpler answer so here it is.

If you enter the network settings you will see that when configuring the proxy a protocol and port can be specified.

enter image description here

Web browsers generally talk the language of the web server which is HTTP. They can often talk to FTP servers as well. HTTPS is just the encrypted form of HTTP.

As you can see from the dialog, the proxy settings only apply to the HTTP, HTTPS, FTP and SOCKS protocols. Also not all utilities may obey these settings. The major web browsers do though.

So when you brought your computer home and plugged it into your home network, the proxy host(s) are no longer reachable so the web browsers are not able to browse.

However, other apps like ping work because they don't use a proxy at all. In fact, as many have pointed out, ping uses ICMP which is a completely different protocol. Ping will tell you your computer is still able to reach computers on the network. Other utilities that don't use HTTP or don't obey the network proxy settings here may also work as you've discovered.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .