mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-18 03:07:27 +00:00
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
This commit is contained in:
@@ -38,6 +38,7 @@ func InitHttpClient() {
|
||||
MaxIdleConns: common.RelayMaxIdleConns,
|
||||
MaxIdleConnsPerHost: common.RelayMaxIdleConnsPerHost,
|
||||
ForceAttemptHTTP2: true,
|
||||
Proxy: http.ProxyFromEnvironment, // Support HTTP_PROXY, HTTPS_PROXY, NO_PROXY env vars
|
||||
}
|
||||
|
||||
if common.RelayTimeout == 0 {
|
||||
|
||||
Reference in New Issue
Block a user