Is there an example of using HTTP/2? #1705
-
I tried to enable the I find nothing about HTTP/2 in the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I suspect the browser isn't actually connecting with http2. Hyper does not support upgrading http1 to http2, so you have to connect with http2 right away. Try with curl's It does indeed work because tonic uses axum and http2. |
Beta Was this translation helpful? Give feedback.
-
Thank you! I may need to learn more about how http2 works, since I don't seem to understand it well. I tried |
Beta Was this translation helpful? Give feedback.
-
This answer and this one, both on superuser.com, seem useful in understanding how to get a browser to use HTTP/2. It is my understanding that to use HTTP/2 from a browser, one needs to be connecting to the server over https(TLS). As part of the TLS negotiation, the browser learns the server supports HTTP/2 and generally will then try to use it first over the TLS connection. Some browsers have a way to skip their TLS requirement for accessing localhost domains but that requires searching online for what to do for each combination of browser and OS that one is on. |
Beta Was this translation helpful? Give feedback.
I suspect the browser isn't actually connecting with http2. Hyper does not support upgrading http1 to http2, so you have to connect with http2 right away.
Try with curl's
--http2-prior-knowledge
option.It does indeed work because tonic uses axum and http2.