HTTP/2 support for connections to origin servers & DoH client

Closes #625.
This commit is contained in:
Alireza Ghasemi 2022-04-15 22:56:08 +04:30
parent 8a07a900fd
commit 47f2cbeace
2 changed files with 2 additions and 0 deletions

View File

@ -284,6 +284,7 @@ func newHTTPTransport(service OriginService, cfg OriginRequestConfig, log *zerol
TLSHandshakeTimeout: cfg.TLSTimeout.Duration,
ExpectContinueTimeout: 1 * time.Second,
TLSClientConfig: &tls.Config{RootCAs: originCertPool, InsecureSkipVerify: cfg.NoTLSVerify},
ForceAttemptHTTP2: true,
}
if _, isHelloWorld := service.(*helloWorld); !isHelloWorld && cfg.OriginServerName != "" {
httpTransport.TLSClientConfig.ServerName = cfg.OriginServerName

View File

@ -135,6 +135,7 @@ func configureClient(hostname string, maxUpstreamConnections int) *http.Client {
MaxIdleConns: 1,
MaxConnsPerHost: maxUpstreamConnections,
Proxy: http.ProxyFromEnvironment,
ForceAttemptHTTP2: true,
}
_ = http2.ConfigureTransport(transport)