summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/reverseproxy/httptransport.go
diff options
context:
space:
mode:
authorFrancis Lavoie <lavofr@gmail.com>2020-10-30 14:05:21 -0400
committerGitHub <noreply@github.com>2020-10-30 12:05:21 -0600
commitb66099379d065ec3340cbe147f65dcf0a39e8e52 (patch)
treef1625b31777c34c7be5afb743a412db1c0dc5381 /modules/caddyhttp/reverseproxy/httptransport.go
parentc9fdff9976da38c650a51cd3fb4f2667853ff627 (diff)
reverseproxy: Add max_idle_conns_per_host; fix godocs (#3829)
Diffstat (limited to 'modules/caddyhttp/reverseproxy/httptransport.go')
-rw-r--r--modules/caddyhttp/reverseproxy/httptransport.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/httptransport.go b/modules/caddyhttp/reverseproxy/httptransport.go
index dce7b9e..d2a9951 100644
--- a/modules/caddyhttp/reverseproxy/httptransport.go
+++ b/modules/caddyhttp/reverseproxy/httptransport.go
@@ -62,6 +62,9 @@ type HTTPTransport struct {
// Maximum number of connections per host. Default: 0 (no limit)
MaxConnsPerHost int `json:"max_conns_per_host,omitempty"`
+ // Maximum number of idle connections per host. Default: 0 (uses Go's default of 2)
+ MaxIdleConnsPerHost int `json:"max_idle_conns_per_host,omitempty"`
+
// How long to wait before timing out trying to connect to
// an upstream.
DialTimeout caddy.Duration `json:"dial_timeout,omitempty"`
@@ -193,6 +196,7 @@ func (h *HTTPTransport) NewTransport(ctx caddy.Context) (*http.Transport, error)
return conn, nil
},
MaxConnsPerHost: h.MaxConnsPerHost,
+ MaxIdleConnsPerHost: h.MaxIdleConnsPerHost,
ResponseHeaderTimeout: time.Duration(h.ResponseHeaderTimeout),
ExpectContinueTimeout: time.Duration(h.ExpectContinueTimeout),
MaxResponseHeaderBytes: h.MaxResponseHeaderSize,