@@ -68,8 +68,10 @@ const DefaultMaxIdleConnsPerHost = 2
68
68
// For high-level functionality, such as cookies and redirects, see Client.
69
69
//
70
70
// Transport uses HTTP/1.1 for HTTP URLs and either HTTP/1.1 or HTTP/2
71
- // for HTTPS URLs, depending on whether the server supports HTTP/2.
72
- // See the package docs for more about HTTP/2.
71
+ // for HTTPS URLs, depending on whether the server supports HTTP/2,
72
+ // and how the Transport is configured. The DefaultTransport supports HTTP/2.
73
+ // To explicitly enable HTTP/2 on a transport, use golang.org/x/net/http2
74
+ // and call ConfigureTransport. See the package docs for more about HTTP/2.
73
75
type Transport struct {
74
76
idleMu sync.Mutex
75
77
wantIdle bool // user has requested to close all idle conns
@@ -113,7 +115,9 @@ type Transport struct {
113
115
DialTLS func (network , addr string ) (net.Conn , error )
114
116
115
117
// TLSClientConfig specifies the TLS configuration to use with
116
- // tls.Client. If nil, the default configuration is used.
118
+ // tls.Client.
119
+ // If nil, the default configuration is used.
120
+ // If non-nil, HTTP/2 support may not be enabled by default.
117
121
TLSClientConfig * tls.Config
118
122
119
123
// TLSHandshakeTimeout specifies the maximum amount of time waiting to
@@ -172,7 +176,8 @@ type Transport struct {
172
176
// called with the request's authority (such as "example.com"
173
177
// or "example.com:1234") and the TLS connection. The function
174
178
// must return a RoundTripper that then handles the request.
175
- // If TLSNextProto is nil, HTTP/2 support is enabled automatically.
179
+ // If TLSNextProto is not nil, HTTP/2 support is not enabled
180
+ // automatically.
176
181
TLSNextProto map [string ]func (authority string , c * tls.Conn ) RoundTripper
177
182
178
183
// ProxyConnectHeader optionally specifies headers to send to
0 commit comments