Add support for PROXY and PORT envs

This commit is contained in:
Ben Sarmiento
2024-04-26 15:11:48 +02:00
parent 2dbabd3ead
commit 6983f59483
3 changed files with 17 additions and 8 deletions

View File

@@ -72,8 +72,9 @@ func NewHTTPClient(
}
var dialer proxy.Dialer = &net.Dialer{
Timeout: time.Duration(timeoutSecs) * time.Second, // timeout to establish connection
Timeout: time.Duration(timeoutSecs) * time.Second, // timeout for dns resolution, tcp handshake
}
if proxyURLString := cfg.GetProxy(); proxyURLString != "" {
proxyURL, err := url.Parse(proxyURLString)
if err != nil {