go-artifactory icon indicating copy to clipboard operation
go-artifactory copied to clipboard

default ArtifactoryClient http.Transport missing some useful defaults

Open jbardin opened this issue 7 years ago • 2 comments

NewClient uses a mostly empty http.Transport, which is missing some useful defaults for timeouts, proxy, etc.

Good starting values are usually what's provided by http.DefaultTransport, something like:

var defaultTransport = &http.Transport{
        Proxy: http.ProxyFromEnvironment,
        DialContext: (&net.Dialer{
                Timeout:   30 * time.Second,
                KeepAlive: 30 * time.Second,
                DualStack: true,
        }).DialContext,
        MaxIdleConns:          100,
        IdleConnTimeout:       90 * time.Second,
        TLSHandshakeTimeout:   10 * time.Second,
        ExpectContinueTimeout: 1 * time.Second,
}

jbardin avatar May 24 '17 15:05 jbardin

Good call. I'll pull those in! Thanks!

lusis avatar May 31 '17 17:05 lusis

@lusis Any idea when do you think you can implement this? I can get a PR done if it helps!

xocasdashdash avatar Aug 08 '18 09:08 xocasdashdash