Description
The net/http
package includes transparent support for HTTP/2. The source of truth for this implementation is the golang.org/x/net/http2
package, which is vendored into std
(using a rather complicated process to avoid import cycles). The http2
package also exposes a number of configuration settings and features which are not directly accessible from net/http
.
There were good reasons for starting development of the HTTP/2 implementation outside of std
, but the current state of affairs is confusing and inconvenient. Backporting HTTP/2 fixes into minor releases is difficult. New versions of net/http
need to support old versions of x/net
. We can't make changes to the HTTP/1 and HTTP/2 implementations atomically. Users need to import an x/ package to configure HTTP/2 settings.
This issue is a tracking issue for moving HTTP/2 into std
.
The desired end state is that the canonical HTTP/2 implementation used by net/http
is located in the main Go repository and golang.org/x/net/http2
is deprecated.
The golang.org/x/net/http2
package has a substantial API surface. Some of that functionality (such as server and client configuration settings) will be made available via net/http
, some will move into new packages, and some will be deprecated. The first stage of this project is to make every non-deprecated feature of golang.org/x/net/http2
available elsewhere.
(Original discussion: #60746)
- x/net/http2: add per-write timeouts (WriteByteTimeout) #61777
- x/net/http2: configurable server pings #67812
- net/http: HTTP/2 configuration API #67813
- net/http: HTTP version selection API #67814
- net/http: new protocol registration mechanism #69649
- net/http: support unencrypted HTTP/2 (h2c) #67816
- proposal: x/net/http2: deprecate WriteScheduler #67817
- x/net/http2: move frame operations to x/net/http2/http2frame #67819