-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Conversation
I have not tested this yet
I still need to do a little cleanup/finalization of the h2c-related config, then this PR will be out of draft phase. |
# Conflicts: # modules/caddyhttp/responsewriter.go # modules/caddyhttp/reverseproxy/httptransport.go
Will it support Caddyfile? |
@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. |
The issue #3669 is tracking Caddyfile support for |
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.