return default http client for empty socks host configuration

This commit is contained in:
gohumble
2022-11-28 19:31:40 +01:00
parent c611969feb
commit ff1548c184
+3
View File
@@ -54,6 +54,9 @@ func GetClient(clientType ClientType) (*http.Client, error) {
if cfg == nil {
return &client, nil
}
if cfg.Host == "" {
return &client, nil
}
proxyURL, _ := url.Parse(cfg.Host)
specialTransport := &http.Transport{}
specialTransport.Proxy = http.ProxyURL(proxyURL)