SetProxyIfConfigured sets proxy for HTTP Transport if configured
(transport *http.Transport)
| 325 | |
| 326 | // SetProxyIfConfigured sets proxy for HTTP Transport if configured |
| 327 | func SetProxyIfConfigured(transport *http.Transport) { |
| 328 | // If proxy address is configured, override environment variable settings |
| 329 | if conf.Conf.ProxyAddress != "" { |
| 330 | if proxyURL, err := url.Parse(conf.Conf.ProxyAddress); err == nil { |
| 331 | transport.Proxy = http.ProxyURL(proxyURL) |
| 332 | } |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | // SetRestyProxyIfConfigured sets proxy for Resty client if configured |
| 337 | func SetRestyProxyIfConfigured(client *resty.Client) { |