1
0
Fork 0
forked from Mirrors/gomuks

hicli: apply more default settings to http transport

This commit is contained in:
Tulir Asokan 2024-10-27 15:01:55 +02:00
parent d432bbc26e
commit 96019b6ef7

View file

@ -92,12 +92,17 @@ func New(rawDB, cryptoDB *dbutil.Database, log zerolog.Logger, pickleKey []byte,
UserAgent: mautrix.DefaultUserAgent,
Client: &http.Client{
Transport: &http.Transport{
DialContext: (&net.Dialer{Timeout: 10 * time.Second}).DialContext,
TLSHandshakeTimeout: 10 * time.Second,
DialContext: (&net.Dialer{Timeout: 10 * time.Second}).DialContext,
// This needs to be relatively high to allow initial syncs,
// it's lowered after the first sync in postProcessSyncResponse
ResponseHeaderTimeout: 300 * time.Second,
// Default settings from http.DefaultTransport
Proxy: http.ProxyFromEnvironment,
ForceAttemptHTTP2: true,
MaxIdleConns: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
},
Timeout: 300 * time.Second,
},