Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpserver: Add H2C support #3289

Merged
merged 7 commits into from
May 5, 2020
Merged

httpserver: Add H2C support #3289

merged 7 commits into from
May 5, 2020

Conversation

mholt
Copy link
Member

@mholt mholt commented Apr 21, 2020

This draft enables optional H2C support, both in the server and in the reverse proxy.

It also fixes a bug when recording responses (used primarily with HTTP access logging enabled, or the templates middleware) where trailers weren't properly getting flushed to the underlying response writer. As a bonus, that particular fix deletes code, eliminates copies, and should slightly improve performance!

Need to finalize the API before we merge this, but it should be ready shortly after the 2.0 release. Do not merge before 2.0.

@Zetanova could you please test this out? 👍

Edit: Should be ready. On a server, you can set "allow_h2c": true to enable H2C support as a server, and on the proxy you can specify "h2c" as one of the Versions values of the HTTP Transport to enable the H2C client.

@mholt
Copy link
Member Author

mholt commented Apr 22, 2020

I still need to do a little cleanup/finalization of the h2c-related config, then this PR will be out of draft phase.

mholt added 2 commits April 22, 2020 11:08
# Conflicts:
#	modules/caddyhttp/responsewriter.go
#	modules/caddyhttp/reverseproxy/httptransport.go
@mholt mholt removed the do not merge ⛔ Not ready yet! label Apr 22, 2020
@mholt mholt marked this pull request as ready for review April 22, 2020 17:34
@mholt mholt requested a review from francislavoie April 22, 2020 17:34
@mholt mholt added the under review 🧐 Review is pending before merging label Apr 22, 2020
@AkinoKaede
Copy link

Will it support Caddyfile?

@mholt
Copy link
Member Author

mholt commented Oct 15, 2020

@AkinoKaede The Caddyfile does not currently support this, because the Caddyfile is not structured around server-level settings (but rather, site-level settings), in other words: it is not possible to enable H2C for one site and disable it for another, it has to either be enabled or disabled for the whole server, but the Caddyfile doesn't have a good way to express that unless we enable H2C for all servers globally.

@francislavoie
Copy link
Member

The issue #3669 is tracking Caddyfile support for allow_h2c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants