INNER CODE UNIT · Go
defaultH2CClient
go-kratos/gateway · client/node.go:86
func defaultH2CClient() *http.Client {
return &http.Client{
CheckRedirect: defaultCheckRedirect,
Transport: &http2.Transport{
// So http2.Transport doesn't complain the URL scheme isn't 'https'
AllowHTTP: true,
DisableCompression: true,
// Pretend we are dialing a TLS endpoint.
// Note, we ignore the passed tls.Config
DialTLS: func(network, addr string, cfg *tls.Config) (net.Conn, error) {
return net.DialTimeout(network, addr, _dialTimeout)
},
},
}
}
func createHTTPSClient(tlsConfig *tls.Config) *http.Client {
tr := &http.Transport{