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