Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between http_proxy and https_proxy

I want to understand the difference between http_proxy and https_proxy environment variables.

So my understanding is that http_proxy will be used if I(as client) that sends http request. https_proxy will be used if I(as client) that sends https request.

There are some possible setting to set http_proxy and https_proxy:

1. http_proxy = http://proxy:port
2. https_proxy = http://proxy:port
3. http_proxy = https://proxy:port
4. https_proxy = https://proxy:port

As I understand, Variant 1, 2 may be common settings. What about variant 3, is it a possible setting? How are the requests transmitted? I think 4 is also a possible setting, but I am not clear about the workflow.

Here is my guess:

In first setting, if I send a http request to a destination server, then http_proxy will be used, with this setting, the request will be send as client --(http request) --proxy --(http request) -- server

In second setting, if I send a https request to a destination server, then https_proxy will be used, with this setting, the request will be client --(https request)-- proxy --(https request) --server. In this case, the proxy will just transmit encrypted packets to server, the packets will be decrypted only at server side.

In third setting, if I send a http request to a destination server, with this setting, what will happen? Is it a eligible setting?

In fourth setting, if I send a https request to a destination server, then https_proxy will be used, with this setting, the request will be send with client --(https request) --proxy --(https request) -- server. In this case, does that means the client's https request encrypted with proxy's public key, , which proxy decrypt the request first, then encrypted with destination server's pk, and then forward the request to server? however, in this case, isn't it break the end to end encryption between client and server? If my assumption is wrong, what is the correct picture for this setting?

Concretely, I want to know the workflow about packets flow from client - proxy - server with different proxies(http/https) and proxy setting (set it with http_proxy/https_proxy).

In all cases I assume server can accept both http/https request. What about if server only accept http/https request? What happen regarding the above setting and how they will be activated? I don't have a clear picture regarding to them.

like image 570
ConfusedP Avatar asked Oct 25 '19 13:10

ConfusedP


People also ask

What does Http_proxy mean?

HTTP Proxy Meaning: An OverviewAn HTTP proxy acts as a high-performance content filter on traffic received by an HTTP client and HTTP server.

What is Http_proxy variable?

The https_proxy environment variable holds the hostname or IP address of your proxy server. https_proxy is a standard environment variable. Like any environment variable, the specific steps you use to set it depends on your operating system.

Is Http_proxy case sensitive?

Note: HTTP_PROXY and HTTPS_PROXY variables are case-insensitive on Windows.

What is no_proxy used for?

noproxy value defines a list of destination domain names, domains, IP addresses or other network CIDRs to exclude proxying. no_proxy provides a way to exclude traffic destined to certain hosts from using the proxy.


1 Answers

In short, both http_proxy and https_proxy support proxy for either HTTP or HTTPS requests.

The difference is that http_proxy does not encrypt the data transmission between the client and proxies, while https_proxy does. So https_proxy proxies itself requires a TLS certificate.

Generally speaking, http_proxy is enough for a local network. If you set the https_proxy variable with proxies that only supports http_proxy, the connection will not work properly.


Because there is no uniform regulation, for http_proxy and https_proxy variables, different programs may do different things.

In order to be compatible with different applications, we may add different styles, but in fact, as long as one of the following can be recognized by the application, the proxy should work normally (both HTTP and HTTPS request).

  • http_proxy=http://user:pass@server:port
  • http_proxy=https://user:pass@server:port
  • https_proxy=https://user:pass@server:port
  • https_proxy=http://user:pass@server:port
like image 182
Time Killer Avatar answered Sep 23 '22 18:09

Time Killer