Skip to content

Commit

Permalink
refactor(http): default transport timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed May 22, 2024
1 parent f8f869d commit 699ed57
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions transport/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ type HTTP struct {

func (h *HTTP) Exchange(m *dns.Msg) (*dns.Msg, error) {
if h.conn == nil || !h.ReuseConn {
transport := http.DefaultTransport.(*http.Transport)
transport.TLSClientConfig = h.TLSConfig
h.conn = &http.Client{
Transport: &http.Transport{
TLSClientConfig: h.TLSConfig,
MaxConnsPerHost: 1,
MaxIdleConns: 1,
Proxy: http.ProxyFromEnvironment,
},
Transport: transport,
}
if h.HTTP2 {
log.Debug("Using HTTP/2")
Expand Down

0 comments on commit 699ed57

Please sign in to comment.