Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

default ArtifactoryClient http.Transport missing some useful defaults #9

Open
jbardin opened this issue May 24, 2017 · 2 comments
Open

Comments

@jbardin
Copy link

jbardin commented May 24, 2017

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,
}
@lusis
Copy link
Owner

lusis commented May 31, 2017

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

@xocasdashdash
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants