mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2025-11-25 19:37:41 +08:00
feat(net): support proxy configuration via config file (#1359)
* support proxy * debug * debug2 * del debug * add proxy configuration with env var fallback * comments to en * refactor(env): fallback env --------- Co-authored-by: jyxjjj <773933146@qq.com>
This commit is contained in:
@@ -283,11 +283,15 @@ func HttpClient() *http.Client {
|
||||
}
|
||||
|
||||
func NewHttpClient() *http.Client {
|
||||
transport := &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: conf.Conf.TlsInsecureSkipVerify},
|
||||
}
|
||||
|
||||
SetProxyIfConfigured(transport)
|
||||
|
||||
return &http.Client{
|
||||
Timeout: time.Hour * 48,
|
||||
Transport: &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: conf.Conf.TlsInsecureSkipVerify},
|
||||
},
|
||||
Timeout: time.Hour * 48,
|
||||
Transport: transport,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user