Commit e683a3ae by wwalt1a Committed by GitHub

feat: support HTTP_PROXY environment variable for default HTTP client

- Add Proxy: http.ProxyFromEnvironment to default transport
- Allow users to set global proxy via Docker environment variables
- Per-channel proxy settings still override global proxy
- Fully backward compatible
parent b5a0c822
...@@ -38,6 +38,7 @@ func InitHttpClient() { ...@@ -38,6 +38,7 @@ func InitHttpClient() {
MaxIdleConns: common.RelayMaxIdleConns, MaxIdleConns: common.RelayMaxIdleConns,
MaxIdleConnsPerHost: common.RelayMaxIdleConnsPerHost, MaxIdleConnsPerHost: common.RelayMaxIdleConnsPerHost,
ForceAttemptHTTP2: true, ForceAttemptHTTP2: true,
Proxy: http.ProxyFromEnvironment, // Support HTTP_PROXY, HTTPS_PROXY, NO_PROXY env vars
} }
if common.RelayTimeout == 0 { if common.RelayTimeout == 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment