Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a website has HTTP/2 protocol support

There are a lot of topics about the HTTP/2 protocol, but I wonder if there is a working website with this protocol.

I.e.

We can decide to use http:// or https://, but how can we write a HTTP/2 request?

I am aware that this protocol depends on the server capability, but I can not find a way to check if a website, e.g. google.com, has HTTP/2 support enabled.

HTTP/2 browser support

As I can see in this picture, all modern browsers support this protocol. I have not seen any link that could look like a new generation protocol.

Are we using the HTTP/2 protocol without knowing or it is just a fairy tale?

like image 444
Stevan Tosic Avatar asked Jan 08 '19 12:01

Stevan Tosic


People also ask

Does my browser support http2?

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).


2 Answers

You can just check it in: Chrome Dev Tool (F12) → NetworkProtocol.

It will tell you the protocol used and the domain of each transfer.

Chrome Dev Tool (F12) -> Network -> Protocol

Legend

http/1.1 = HTTP/1.1
h2          = HTTP/2


Note: If you cannot see the Protocol column, just right-click on any header and check the "Protocol" label.

like image 79
Juanma Menendez Avatar answered Sep 18 '22 17:09

Juanma Menendez


You can use the curl command to find out if a particular website has HTTP/2 protocol support or not. In the following example, just replace https://www.cloudflare.com/ with the URL you want to check for HTTP/2 support:

% curl -vso /dev/null --http2 https://www.cloudflare.com/ 

If you see offering h2 among the output messages, that means that the given URL supports HTTP/2. For example:

.... * ALPN, offering h2 * ALPN, offering http/1.1 .... 
like image 43
blueray Avatar answered Sep 19 '22 17:09

blueray