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: https://github.com/golang/go/discussions/60746)

  • [x] #61777
  • [x] #67812
  • [ ] #67813
  • [x] #67814
  • [ ] #69649
  • [x] #67816
  • [ ] #67817
  • [ ] #67819