diff --git a/internal/flaghttp/client.go b/internal/flaghttp/client.go index 8d212e5..ee30ef8 100644 --- a/internal/flaghttp/client.go +++ b/internal/flaghttp/client.go @@ -1,6 +1,7 @@ package flaghttp import ( + "net" "net/http" "net/url" "time" @@ -34,8 +35,19 @@ type client struct { func NewClient() Client { return &client{ - header: http.Header{}, - transport: &http.Transport{}, + header: http.Header{}, + transport: &http.Transport{ + Proxy: http.ProxyFromEnvironment, + DialContext: (&net.Dialer{ + 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, + }, } }