Last active
February 13, 2020 17:53
-
-
Save integrii/8d60d0b7690fbd01b1527cc63643229c to your computer and use it in GitHub Desktop.
Custom Go HTTP client with custom transport and dialer example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&http.Client{ | |
Transport: &http.Transport{ | |
TLSClientConfig: &tlsConfig, | |
Proxy: http.ProxyFromEnvironment, | |
Dial: (&net.Dialer{ | |
Timeout: 30 * time.Second, | |
KeepAlive: 30 * time.Second, | |
}).Dial, | |
TLSHandshakeTimeout: 10 * time.Second, | |
ExpectContinueTimeout: 1 * time.Second, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment