golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
121.18k stars 17.37k forks source link

proposal: x/net/http2: move frame operations to x/net/http2/http2frame #67819

Open neild opened 1 month ago

neild commented 1 month ago

This issue is part of a project to move x/net/http2 into std: #67810

The golang.org/x/net/http2 package includes support for reading and writing HTTP/2 frames. The http2.Framer type reads and writes frames, and a number of additional types represent specific frames.

Frame support adds a large amount of API surface that few users need. Users who send and receive HTTP/2 requests operate at a higher level than framing, which is an internal protocol detail.

I propose moving Framer and all of its ancillary types into a new golang.org/x/net/http2/http2frame package and eventually deprecating the versions in http2.

Specifically, the following types will move into the new package:

rsc commented 3 weeks ago

This proposal has been added to the active column of the proposals project and will now be reviewed at the weekly proposal review meetings. — rsc for the proposal review group

rsc commented 2 weeks ago

How would this enter std? Would it come in as net/http/http2frame?

neild commented 2 weeks ago

This would not enter std. We'd move Framer out of x/net/http2 so we can (eventually) deprecate that package while leaving Framer un-deprecated, but I don't see a compelling reason to move Framer into std.

rsc commented 1 week ago

So an internal implementation of these types would come in, but there'd be no public API. Sounds good.

rsc commented 1 week ago

Have all remaining concerns about this proposal been addressed?

The proposal is in https://github.com/golang/go/issues/67819#issue-2334009686.