How to check if website has http/2 protocol support

后端 未结 5 1668
栀梦
栀梦 2020-12-05 06:43

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

i.e.

We can decide to use http:// o

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-05 07:11

    HTTP/2 reuses the http:// and https:// schemes rather than use new ones.

    All browsers only support HTTP/2 over https:// and part of the SSL/TLS negotiation is to communicate whether both sides support HTTP/2 and are willing to use it (using an extension to SSL/TLS called ALPN).

    The advantage for this is you can just connect to a website and if your browser supports it, it will automatically negotiate HTTP/2, and if not it will automatically fall back to HTTP/1.1.

    So to test for HTTP/2 support you can use the browser as Markus's suggests (make sure to add the Protocol column to the Network tab in Chrome for example).

    Or you can use an online tester like https://tools.keycdn.com/http2-test

    Or you can use a command line tool like openssl (assuming it's been built with ALPN support): openssl s_client -alpn h2 -connect www.example.com:443 -status.

    Most of the larger websites (e.g. Twitter, Facebook, Amazon, Stack Overflow) are using HTTP/2 now.

提交回复
热议问题