Skip to content

h2c: Update to native net/http HTTP2 client - #183

Merged
suhailpatel merged 8 commits into
masterfrom
h2c-native-protocol-options
Aug 11, 2026
Merged

suhailpatel merged 8 commits into
masterfrom
h2c-native-protocol-options

Conversation

@suhailpatel

Copy link
Copy Markdown
Contributor

This PR gets rid of a bunch of cruft. Our h2c implementation was based on golang.org/x/net/http2 and golang.org/x/net/http2/h2c which are deprecated.

Almost no users should need to import this package directly. The net/http package supports HTTP/2 natively.

Since Go 1.24, we have native HTTP2 implementation in net/http and fixes for a lot of the deficiency where we had to manage our own connection draining state. This is now all built in, so we can clean up our implementation.

There is a small trade-off, where the H2cFilter behaviour of accepting HTTP2 becomes enabled by default (rather than opt in). We've been running internally in this mode for years without issue.

@suhailpatel suhailpatel self-assigned this Aug 11, 2026
@suhailpatel
suhailpatel merged commit 6101df2 into master Aug 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants