@@ -78,19 +78,30 @@ custom Server:
78
78
}
79
79
log.Fatal(s.ListenAndServe())
80
80
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:
86
87
87
88
GODEBUG=http2client=0 # disable HTTP/2 client support
88
89
GODEBUG=http2server=0 # disable HTTP/2 server support
89
90
GODEBUG=http2debug=1 # enable verbose HTTP/2 debug logs
90
91
GODEBUG=http2debug=2 # ... even more verbose, with frame dumps
91
92
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
+
95
106
*/
96
107
package http
0 commit comments