Skip to content

Commit 0631f29

Browse files
committed
net/http: document relation and interaction with golang.org/x/net/http2
Fixes #16412 Change-Id: Idc65d2a62414a9b1573e6bd9f8601b52985b5dea Reviewed-on: https://go-review.googlesource.com/33110 Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent fb8c896 commit 0631f29

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

src/net/http/doc.go

+19-8
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,30 @@ custom Server:
7878
}
7979
log.Fatal(s.ListenAndServe())
8080
81-
The http package has transparent support for the HTTP/2 protocol when
82-
using HTTPS. Programs that must disable HTTP/2 can do so by setting
83-
Transport.TLSNextProto (for clients) or Server.TLSNextProto (for
84-
servers) to a non-nil, empty map. Alternatively, the following GODEBUG
85-
environment variables are currently supported:
81+
Starting with Go 1.6, the http package has transparent support for the
82+
HTTP/2 protocol when using HTTPS. Programs that must disable HTTP/2
83+
can do so by setting Transport.TLSNextProto (for clients) or
84+
Server.TLSNextProto (for servers) to a non-nil, empty
85+
map. Alternatively, the following GODEBUG environment variables are
86+
currently supported:
8687
8788
GODEBUG=http2client=0 # disable HTTP/2 client support
8889
GODEBUG=http2server=0 # disable HTTP/2 server support
8990
GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs
9091
GODEBUG=http2debug=2 # ... even more verbose, with frame dumps
9192
92-
The GODEBUG variables are not covered by Go's API compatibility promise.
93-
HTTP/2 support was added in Go 1.6. Please report any issues instead of
94-
disabling HTTP/2 support: https://golang.org/s/http2bug
93+
The GODEBUG variables are not covered by Go's API compatibility
94+
promise. Please report any issues before disabling HTTP/2
95+
support: https://golang.org/s/http2bug
96+
97+
The http package's Transport and Server both automatically enable
98+
HTTP/2 support for simple configurations. To enable HTTP/2 for more
99+
complex configurations, to use lower-level HTTP/2 features, or to use
100+
a newer version of Go's http2 package, import "golang.org/x/net/http2"
101+
directly and use its ConfigureTransport and/or ConfigureServer
102+
functions. Manually configuring HTTP/2 via the golang.org/x/net/http2
103+
package takes precedence over the net/http package's built-in HTTP/2
104+
support.
105+
95106
*/
96107
package http

0 commit comments

Comments
 (0)