Windows, not admin: Proxy working in Firefox but not in cmd, why?

3

1

I've manually configured the proxy in Firefox, and it works. I tried to use it also in the command line, but it fails:

>set http_proxy=http://USERNAME:PASSWORD@HOST:PORT
>set https_proxy=https://USERNAME:PASSWORD@HOST:PORT
>
>ping www.google.com

Pinging www.google.com with 32 bytes of data:
Request timed out.

I also tried to use http for https_proxy, no result. I can't configure them as envvars since I'm not admin. Why is it wrong and what can I do?

Marco Sulla

Posted 2015-06-04T15:51:19.233

Reputation: 441

Answers

4

HTTP proxies only work with the HTTP protocol (and, to some extent with TCP connections in general, using CONNECT).

Ping doesn’t use HTTP or even TCP. Instead, it uses ICMP. There’s no proxy for this protocol.

Additionally, you’re using Linux/UNIX-style environment variables to set the proxy. This won’t work with “native” Windows applications at all. They usually rely on Internet Explorer’s proxy settings. (The options dialog is also available via Control Panel -> Internet Options.)

Also, there’s no such thing as a proxy reachable via HTTPS. It’s always plain HTTP. HTTPS connections are tunneled entirely, using CONNECT.

Daniel B

Posted 2015-06-04T15:51:19.233

Reputation: 40 502

I'm quite sure setting http_proxy variable will work, since I've done it in past and it's well documented if you surf on internet. I'll check if I can use pip, for example. – Marco Sulla – 2015-06-04T15:58:24.623

pip is not a “native Windows application”. ;) That being said, there’s basically nothing shipped that can access HTTP in any way either. – Daniel B – 2015-06-04T15:59:58.033

You set also https_proxy because some applications use it instead of http_proxy – Marco Sulla – 2015-06-04T16:06:47.910

That’s true. Still, it would usually be the exact same value as $http_proxy. It most certainly won’t ever begin with https://! – Daniel B – 2015-06-04T16:07:57.633

yeah, so... I read the question, the answer (accepted, upvoted), comments... and I still don't know what to do to being able to ping google ;) my actual problem is docker can't connect to https://registry-1.docker.io/v2/ and I can't pull hello-world from it, but I thought I try with ping. @MarcoSulla

– Line – 2019-09-20T10:43:03.703