[研究]h2spec 2.6.0(HTTP/2 協定符合性測試工具)試用
2025-06-12
h2spec官方網站,h2spec v2.6.0 於 2020-08-04 釋出
https://github.com/summerwind/h2spec
下載
https://github.com/summerwind/h2spec/releases
h2spec_windows_amd64.zip
實際使用,預設不會告訴你有那些參數
C:\h2spec_windows_amd64>h2spec.exeGeneric tests for HTTP/2 server
1. Starting HTTP/2
[31m× 1: Sends a client connection preface[0m
Error: dial tcp 127.0.0.1:80: connectex: No connection could be made because the target machine actively refused it.
C:\h2spec_windows_amd64> |
實際使用,拿 www.hinet.net 試驗一下
-t:執行所有測試(包含 HTTP/2 要求與錯誤處理)
-k:忽略 TLS 憑證錯誤(對測試 staging/dev 伺服器很實用)
-p 443:指定 HTTPS 連接埠
-h:目標主機(可以是 domain 或 IP)
C:\h2spec_windows_amd64>h2spec.exe -t -k -p 443 -h www.hinet.net
Generic tests for HTTP/2 server
1. Starting HTTP/2
[32m✔[0m [90m1:[0m [90mSends a client connection preface[0m
2. Streams and Multiplexing
[32m✔[0m [90m1:[0m [90mSends a PRIORITY frame on idle stream[0m
[32m✔[0m [90m2:[0m [90mSends a WINDOW_UPDATE frame on half-closed (remote) stream[0m
[32m✔[0m [90m3:[0m [90mSends a PRIORITY frame on half-closed (remote) stream[0m
[32m✔[0m [90m4:[0m [90mSends a RST_STREAM frame on half-closed (remote) stream[0m
[32m✔[0m [90m5:[0m [90mSends a PRIORITY frame on closed stream[0m
3. Frame Definitions
3.1. DATA
[32m✔[0m [90m1:[0m [90mSends a DATA frame[0m
[32m✔[0m [90m2:[0m [90mSends multiple DATA frames[0m
[32m✔[0m [90m3:[0m [90mSends a DATA frame with padding[0m
3.2. HEADERS
[32m✔[0m [90m1:[0m [90mSends a HEADERS frame[0m
[32m✔[0m [90m2:[0m [90mSends a HEADERS frame with padding[0m
[32m✔[0m [90m3:[0m [90mSends a HEADERS frame with priority[0m
3.3. PRIORITY
[32m✔[0m [90m1:[0m [90mSends a PRIORITY frame with priority 1[0m
[32m✔[0m [90m2:[0m [90mSends a PRIORITY frame with priority 256[0m
[32m✔[0m [90m3:[0m [90mSends a PRIORITY frame with stream dependency[0m
[32m✔[0m [90m4:[0m [90mSends a PRIORITY frame with exclusive[0m
[32m✔[0m [90m5:[0m [90mSends a PRIORITY frame for an idle stream, then send a HEADER frame for a lower stream ID[0m
3.4. RST_STREAM
[32m✔[0m [90m1:[0m [90mSends a RST_STREAM frame[0m
3.5. SETTINGS
[32m✔[0m [90m1:[0m [90mSends a SETTINGS frame[0m
3.7. PING
[32m✔[0m [90m1:[0m [90mSends a PING frame[0m
3.8. GOAWAY
[32m✔[0m [90m1:[0m [90mSends a GOAWAY frame[0m
3.9. WINDOW_UPDATE
[32m✔[0m [90m1:[0m [90mSends a WINDOW_UPDATE frame with stream ID 0[0m
[32m✔[0m [90m2:[0m [90mSends a WINDOW_UPDATE frame with stream ID 1[0m
3.10. CONTINUATION
[32m✔[0m [90m1:[0m [90mSends a CONTINUATION frame[0m
[32m✔[0m [90m2:[0m [90mSends multiple CONTINUATION frames[0m
4. HTTP Message Exchanges
[32m✔[0m [90m1:[0m [90mSends a GET request[0m
[32m✔[0m [90m2:[0m [90mSends a HEAD request[0m
[32m✔[0m [90m3:[0m [90mSends a POST request[0m
[31musing source address 10.3.121.11:52517[0mm
[31m× 4: Sends a POST request with trailers[0m
[31m-> The endpoint MUST respond to the request.[0m
[33m Expected: HEADERS Frame (stream_id:1)[0m
[32m Actual: Connection closed[0m
5. HPACK
[32m✔[0m [90m1:[0m [90mSends a indexed header field representation[0m
[32m✔[0m [90m2:[0m [90mSends a literal header field with incremental indexing - indexed name[0m
[32m✔[0m [90m3:[0m [90mSends a literal header field with incremental indexing - indexed name (with Huffman coding)[0m
[32m✔[0m [90m4:[0m [90mSends a literal header field with incremental indexing - new name[0m
[32m✔[0m [90m5:[0m [90mSends a literal header field with incremental indexing - new name (with Huffman coding)[0m
[32m✔[0m [90m6:[0m [90mSends a literal header field without indexing - indexed name[0m
[32m✔[0m [90m7:[0m [90mSends a literal header field without indexing - indexed name (with Huffman coding)[0m
[32m✔[0m [90m8:[0m [90mSends a literal header field without indexing - new name[0m
[32m✔[0m [90m9:[0m [90mSends a literal header field without indexing - new name (huffman encoded)[0m
[32m✔[0m [90m10:[0m [90mSends a literal header field never indexed - indexed name[0m
[32m✔[0m [90m11:[0m [90mSends a literal header field never indexed - indexed name (huffman encoded)[0m
[32m✔[0m [90m12:[0m [90mSends a literal header field never indexed - new name[0m
[32m✔[0m [90m13:[0m [90mSends a literal header field never indexed - new name (huffman encoded)[0m
[32m✔[0m [90m14:[0m [90mSends a dynamic table size update[0m
[32m✔[0m [90m15:[0m [90mSends multiple dynamic table size update[0m
Hypertext Transfer Protocol Version 2 (HTTP/2)
3. Starting HTTP/2
3.5. HTTP/2 Connection Preface
[32m✔[0m [90m1:[0m [90mSends client connection preface[0m
[32m✔[0m [90m2:[0m [90mSends invalid connection preface[0m
4. HTTP Frames
4.1. Frame Format
[32m✔[0m [90m1:[0m [90mSends a frame with unknown type[0m
[32m✔[0m [90m2:[0m [90mSends a frame with undefined flag[0m
[32m✔[0m [90m3:[0m [90mSends a frame with reserved field bit[0m
4.2. Frame Size
[90m 1: Sends a DATA frame with 2^14 octets in length[0m
|
訊息太多了,敝人只是想簡單知道 Web Server 目前提供支援的 HTTP 版本。
(完)
沒有留言:
張貼留言