If I type out https://http2.golang.org/ the chrome browser will automatically send the HTTP/2 request. How is this done?
The chrome browser will only send a HTTP/1.1 Request to the website. As the website is HTTP/2 Enabled, it will send a message to the browser that it supports HTTP/2. The server upgrades the communication protocol between it and the server to HTTP/2 if it finds the browser capable of recognizing HTTP/2.
Google Chrome offers a quick and easy way to check if HTTP/2 is supported on your SSL-enabled site. First, visit your site in Chrome over HTTPS. There you'll see your site listed with protocol h2, confirming your site works over HTTP/2.
In browsers, HTTP/2 is supported by the most current releases of Edge, Safari, Firefox and Chrome. Other browsers based upon Blink will also support HTTP/2 (e.g., Opera and Yandex Browser).
HTTP/2 settings can be configured in the Profile Settings. In the menu, click Settings > Active Profile > Web (Protocol Level). HTTP/2 is disabled by default. To enable it, set the Preferred HTTP version to HTTP/2 .
Take stackoverflow for example, when the browser sends a request to stackoverflow.com
, it has to do the following steps:
Regarding step3 TLS handshake, there is an nice explanation by @Oleg.
In order to inspect the detail of TCP/IP packet, You may need use some tools to capture packets. e.g. Wireshark.
ClientHello
to server, which carries several thingsSeverHello
, which carriesHTTP/2
HTTP2 request/response happens in step4. Before that, browser has already know whether sever support HTTP/2 through TLS handshake.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With