[Network] HTTP/2 簡介與CURL測試方法

Intro

相較於 HTTP 1.1,主要解決 HOL (head-of-line) blocking 應用層問題,Frame 編碼改用 Huffman Coding,Header 另外採用 HPACK 壓縮


測試方法

CURL

首先可以檢查CURL是否支援HTTP2:

$ curl --version
...
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy

CURL --http2

HTTP/2 with curl

利用CURL的--http2參數指定開啟HTTP/2並用的-I參數回傳Header確認Protocol:

$ curl --http2 -I https://www.google.com
HTTP/2 200 
content-type: text/html; charset=ISO-8859-1

References

Leave a Reply

Your email address will not be published. Required fields are marked *