forked from Mirrors/gomuks
hicli: apply more default settings to http transport
This commit is contained in:
parent
d432bbc26e
commit
96019b6ef7
1 changed files with 7 additions and 2 deletions
|
@ -93,11 +93,16 @@ func New(rawDB, cryptoDB *dbutil.Database, log zerolog.Logger, pickleKey []byte,
|
||||||
Client: &http.Client{
|
Client: &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
DialContext: (&net.Dialer{Timeout: 10 * time.Second}).DialContext,
|
DialContext: (&net.Dialer{Timeout: 10 * time.Second}).DialContext,
|
||||||
TLSHandshakeTimeout: 10 * time.Second,
|
|
||||||
// This needs to be relatively high to allow initial syncs,
|
// This needs to be relatively high to allow initial syncs,
|
||||||
// it's lowered after the first sync in postProcessSyncResponse
|
// it's lowered after the first sync in postProcessSyncResponse
|
||||||
ResponseHeaderTimeout: 300 * time.Second,
|
ResponseHeaderTimeout: 300 * time.Second,
|
||||||
|
// Default settings from http.DefaultTransport
|
||||||
|
Proxy: http.ProxyFromEnvironment,
|
||||||
ForceAttemptHTTP2: true,
|
ForceAttemptHTTP2: true,
|
||||||
|
MaxIdleConns: 100,
|
||||||
|
IdleConnTimeout: 90 * time.Second,
|
||||||
|
TLSHandshakeTimeout: 10 * time.Second,
|
||||||
|
ExpectContinueTimeout: 1 * time.Second,
|
||||||
},
|
},
|
||||||
Timeout: 300 * time.Second,
|
Timeout: 300 * time.Second,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue