added more default client options
This commit is contained in:
parent
1daa3f8e0e
commit
fbf7fed2ce
1 changed files with 7 additions and 1 deletions
|
|
@ -91,7 +91,13 @@ func NewAllocator(opts ...Option) (netalloc.Allocator, error) {
|
||||||
a.httpClient = &http.Client{Transport: &http.Transport{
|
a.httpClient = &http.Client{Transport: &http.Transport{
|
||||||
DialContext: (&net.Dialer{
|
DialContext: (&net.Dialer{
|
||||||
Timeout: 30 * time.Second,
|
Timeout: 30 * time.Second,
|
||||||
|
KeepAlive: 30 * time.Second,
|
||||||
}).DialContext,
|
}).DialContext,
|
||||||
|
ForceAttemptHTTP2: true,
|
||||||
|
MaxIdleConns: 100,
|
||||||
|
IdleConnTimeout: 90 * time.Second,
|
||||||
|
TLSHandshakeTimeout: 10 * time.Second,
|
||||||
|
ExpectContinueTimeout: 1 * time.Second,
|
||||||
TLSClientConfig: &tls.Config{
|
TLSClientConfig: &tls.Config{
|
||||||
InsecureSkipVerify: a.insecure,
|
InsecureSkipVerify: a.insecure,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue