Hello,
I'm trying to understand how Traefik handles proxy settings for communicating with backend servers. After reviewing the source code, I noticed that Traefik implements two types of reverse proxies: one using github.com/valyala/fasthttp (referred to as fast), and another using net/http/httputil (referred to as httputil).
From what I can gather:
- The
fastreverse proxy utilizeshttp.ProxyFromEnvironmentto determine the proxy settings. - The
httputilreverse proxy does not seem to usehttp.ProxyFromEnvironment.
Additionally, I observed that the smart_build component chooses to build the fast proxy if the following condition evaluates to false:
targetURL.Scheme == "h2c" || (targetURL.Scheme == "https" && !serversTransport.DisableHTTP2)
Based on this, it appears that Traefik might use the forward proxy settings defined in the HTTP_PROXY and HTTPS_PROXY environment variables when the above condition evaluates to false. Is my understanding correct? Could someone please confirm or correct my interpretation?
Thank you!