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
Add http/2 cleartext server (h2c) support #3227
Comments
To clarify:
The socket used (UDS or otherwise) has nothing to do with whether TLS is used. It's a totally separate thing. @Zetanova Also, I don't believe we need to use the method with |
@mholt yes, the method with |
@Zetanova Alrighty, I have pushed experimental support for h2c server in the It is enabled by setting As before, I haven't tested it; will you try it out and see how it goes? |
@mholt thx a lot! looks good, the listener is working. But the gRPC-response error/bug from the other new "h2c upstream" feature still breaks the gRPC communication. I hope that it will work with an upstream over normal tcp-h2 Test setup: |
the gRPC Response in caddy gets somehow to transfered correctly back to the gRPC-client i will test now |
Gotcha... I'm afraid I don't know enough about gRPC to debug that one :( I'll need some hints to make much more progress. (Hopefully it is simple!) |
* reverse_proxy: Initial attempt at H2C transport/client support (#3218) I have not tested this yet * Experimentally enabling H2C server support (closes #3227) See also #3218 I have not tested this * reverseproxy: Clean up H2C transport a bit * caddyhttp: Update godoc for h2c server; clarify experimental status * caddyhttp: Fix trailers when recording responses (fixes #3236) * caddyhttp: Tweak h2c config settings and docs
The normal case is always to encrypt http2 network connections,
but since there are cases in gRPC and service-meshes where the upstream
is over an unix domain stocket (UDS), http/2 cleartext (h2c) would be required.
In a TLS connection the client can negate the h2 protocol with the help of TLS-ALPN header.
But in the case of http/2 cleartext (h2c) there are two different methods:
The golang native server can negate it already by inserting the
h2c
middleware Handler fromgolang.org/x/net/http2/h2c
withh2c.NewHandler(handler, h2s)
h2c-golang-example
By simply extending the listener factory caddy2 could then serve
h2c connections by
h2c update
and also at the same time byh2c prior knowledge
I think, the h2c-handler can be added here:
caddy/modules/caddyhttp/app.go
Lines 188 to 217 in 84c729e
If required http1 coud be disabled to accept only h2c-prior-knowledge,
but then caddy would need to bind the http2 server directly to the tcp-connection like
Because the h2c-handler covers both options, this feature could also be omitted.
Maybe the h2c handler can be added by extending the
JSON Config Structure › apps › http › servers › listener_wrappers
Demo Caddyfile for UDS
Demo Caddyfile for TCP
The text was updated successfully, but these errors were encountered: