Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #934 from jaffee/http-client-config
Browse files Browse the repository at this point in the history
bump MaxIdleConns(PerHost) like v0.7
  • Loading branch information
jaffee authored Nov 9, 2017
2 parents 9e458ae + f1d87fd commit d83f2c6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"io/ioutil"
"log"
"math/rand"
"net"
"net/http"
"net/url"
"sort"
Expand Down Expand Up @@ -70,7 +71,19 @@ func NewInternalHTTPClientFromURI(defaultURI *URI, options *ClientOptions) *Inte
if options == nil {
options = &ClientOptions{}
}
transport := &http.Transport{}
transport := &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
MaxIdleConns: 1000,
MaxIdleConnsPerHost: 200,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
}
if options.TLS != nil {
transport.TLSClientConfig = options.TLS
}
Expand Down

0 comments on commit d83f2c6

Please sign in to comment.