Closed ioquatix closed 3 weeks ago
Let me cross-reference https://github.com/socketry/async-http/pull/128 - we should try to get that merged.
I've merged clear-text HTTP/2 support, and I've added documentation about how to use it: https://github.com/socketry/async-http/tree/main/examples/hello
Do you mind testing it and reporting back?
This works; I ran the new async-http
example and tried v0.67.0
in my own experiments. Thank you!
Awesome, do you mind telling me a bit more about what you are doing?
Sure, appreciate you asking! It's not terribly interesting. :)
I was using a minimal Rackup config to experiment with Rack::MiniProfiler, and bumped into Rack::Lint
enforcing lowercase headers. I was unaware of header-related changes to the Rack and HTTP/2 specifications, so I was investigating.
I added a trivial middleware to lowercase headers, but Firefox Devtools still showed mixed-case headers (even raw). I was testing combinations of servers, HTTP versions and clients to determine which part of the stack modified the headers after my middleware.
Specifically regarding cleartext HTTP/2, I was using Wireshark to inspect the packets and misunderstood the io-endpoint SSL error (related to Falcon's self-signed cert). Being already down a few rabbit holes, I wanted to sidestep another. :-) (Debugging ruby/SSL.)
I also learned few unrelated bundler tidbits from your async-http example. Thank you very much!
That all sounds very interesting. Honestly, it's great to hear about your rabbit hole(s). Glad it was helpful and we could improve a few things :)
I'm doing simple experiments with different web servers regarding HTTP2 and header casing (related to Rack 3/rackup), and thought I'd try falcon.
I can't seem to get falcon to speak HTTP2 via curl. I see the wiki linked up-thread is gone, and I didn't see anything terribly specific to this situation in the falcon project-page docs.
Should any of the following result in an HTTP2 response?
(Aside, can falcon talk HTTP1.1 and HTTP2 together, on the same endpoint?)
Run curl, asking for HTTP2.. curl sends an upgrade header, but the connection isn't upgraded and it receives an HTTP1.1 response.
Since I'm unsure if/how upgrade works, I thought I'd forgo it and directly talk HTTP2, but falcon doesn't like that. I notice the up-thread comment there is no specification-compliant way to detect direct HTTP2, so maybe this shouldn't be expected to work? Curl kindly blames the server. :-) (On the Falcon-side, it's the same protocol error as up-thread.)
Finally, since I don't know the details of
Upgrade:
, I wondered if multiple requests might convince curl and falcon to switch to HTTP2 (i.e. perhaps the server is permitted to reply with HTTP1.1 and then upgrade on subsequent requests, but since there are none, curl closes the connection and doesn't bother). This didn't work either, as in the first case, I received two HTTP/1.1 responses. I guess curl explainscan not multiplex, even if we wanted to
because the connection wasn't upgraded to HTTP2.Originally posted by @richardkmichael in https://github.com/socketry/falcon/issues/116#issuecomment-2156294549