1

I realized that in linux as well as in many programs, one can set http_proxy and https_proxy. I see many guides suggest:

http_proxy = http://host:port
https_proxy = https://host:port

I have serveral questions:

  1. How a program determine which proxy, http or https, to connect? I tested in a docker alphine image to find out that wget get https://google.com through http_proxxy. It seems that this doesn't depend on which protocol to use.

  2. What is the meaning of http, https in front of host:port? Does it suggest which protocol to use to connect to the proxy server? As I find out I can actually use http://host:port for https_proxy. Besides, setting without http

    http_proxxy = host:port

    also works.

Thank you!

0

It's pretty confusing I agree. Some programs use just http_proxy and adjust the protocol as needed for HTTP/HTTPS requests.

This is what https://www.npmjs.com/package/proxy-agent does anyway.

Some other programs use both. HTTPS_PROXY for https requests and HTTP_PROXY for http requests.

But I think it makes sense for most programs to just use a single HTTP_PROXY and adjust the protocol as needed. I can't see a good use case for using both and having separate proxies for HTTP vs HTTPS in this day and age.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.