Skip to content

Commit

Permalink
Enable "ForceAttemptHTTP2" for DoH upstreamClient (#519)
Browse files Browse the repository at this point in the history
According to https://pkg.go.dev/net/http#Transport, when TLSClientConfig
is provided, HTTP/2 will be disabled. Setting this option to true, when
using custom TLS config, will still attempt HTTP/2 upgrades.
  • Loading branch information
PeterDaveHello authored May 16, 2022
1 parent 3392de0 commit 63cfaba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions resolver/upstream_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func createUpstreamClient(cfg config.Upstream) upstreamClient {
Transport: &http.Transport{
TLSClientConfig: &tlsConfig,
TLSHandshakeTimeout: defaultTLSHandshakeTimeout,
ForceAttemptHTTP2: true,
},
Timeout: timeout,
},
Expand Down

0 comments on commit 63cfaba

Please sign in to comment.