一个交互式的HTTP/2(“H2”)控制台调试器:h2i

fpcm 9年前

h2i是一个一个交互式的HTTP/2(“H2”)控制台调试器。

Features:

  • send raw HTTP/2 frames
    • PING
    • SETTINGS
    • HEADERS
    • etc
    </li>
  • type in HTTP/1.n and have it auto-HPACK/frame-ify it for HTTP/2
  • pretty print all received HTTP/2 frames from the peer (including HPACK decoding)
  • tab completion of available commands
  • </ul>

    Not yet features, but soon:

    • unnecessary CONTINUATION frames on short boundaries, to test peer implementations
    • request bodies (DATA frames)
    • auto-completion of subcommands and options
    • send invalid frames for testing server implementations (supported by underlying Framer)
    示例:
    $ h2i  Usage: h2i <hostname>      -insecure          Whether to skip TLS cert validation    -nextproto string          Comma-separated list of NPN/ALPN protocol names to negotiate. (default "h2,h2-14")    $ h2i google.com  Connecting to google.com:443 ...  Connected to 74.125.224.41:443  Negotiated protocol "h2-14"  [FrameHeader SETTINGS len=18]    [MAX_CONCURRENT_STREAMS = 100]    [INITIAL_WINDOW_SIZE = 1048576]    [MAX_FRAME_SIZE = 16384]  [FrameHeader WINDOW_UPDATE len=4]    Window-Increment = 983041    h2i> PING h2iSayHI  [FrameHeader PING flags=ACK len=8]    Data = "h2iSayHI"  h2i> headers  (as HTTP/1.1)> GET / HTTP/1.1  (as HTTP/1.1)> Host: ip.appspot.com  (as HTTP/1.1)> User-Agent: h2i/brad-n-blake  (as HTTP/1.1)>    Opening Stream-ID 1:   :authority = ip.appspot.com   :method = GET   :path = /   :scheme = https   user-agent = h2i/brad-n-blake  [FrameHeader HEADERS flags=END_HEADERS stream=1 len=77]    :status = "200"    alternate-protocol = "443:quic,p=1"    content-length = "15"    content-type = "text/html"    date = "Fri, 01 May 2015 23:06:56 GMT"    server = "Google Frontend"  [FrameHeader DATA flags=END_STREAM stream=1 len=15]    "173.164.155.78\n"  [FrameHeader PING len=8]    Data = "\x00\x00\x00\x00\x00\x00\x00\x00"  h2i> ping    [FrameHeader PING flags=ACK len=8]      Data = "h2i_ping"    h2i> ping    [FrameHeader PING flags=ACK len=8]    Data = "h2i_ping"  h2i> ping  [FrameHeader GOAWAY len=22]    Last-Stream-ID = 1; Error-Code = PROTOCOL_ERROR (1)    ReadFrame: EOF

    项目主页:http://www.open-open.com/lib/view/home/1430535717662