TransWikia.com

When linux use https_proxy instead of http_proxy?

Unix & Linux Asked by user103567 on February 12, 2021

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!

One Answer

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.

Answered by nhooyr on February 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP