Skip to content

Instantly share code, notes, and snippets.

@integrii
Last active February 13, 2020 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save integrii/8d60d0b7690fbd01b1527cc63643229c to your computer and use it in GitHub Desktop.
Save integrii/8d60d0b7690fbd01b1527cc63643229c to your computer and use it in GitHub Desktop.
Custom Go HTTP client with custom transport and dialer example
&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