Skip to content

Instantly share code, notes, and snippets.

@jacoelho
Last active July 31, 2017 18:59
Show Gist options
  • Save jacoelho/f441f803baded2dafde1b58a00a47845 to your computer and use it in GitHub Desktop.
Save jacoelho/f441f803baded2dafde1b58a00a47845 to your computer and use it in GitHub Desktop.
c := &http.Client{
Transport: &http.Transport{
Dial: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
ResponseHeaderTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
},
}
req, _:= http.NewRequest("GET", "https://www.google.com", nil)
resp, err := c.Do(req)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment