HTTP/2プロトコルがデータフィールドを圧縮する方法を理解しようとしています。私はrfcでアルゴリズムを見つけられませんでした。私はそのバイナリプロトコルを知っています。 バイナリプロトコルを人間が読み取り可能なコンテンツに戻す方法を探しています。私はヘッダーに書いてあるようなgzipだと思ったが、バイナリプロトコルrefernceを探すことができるソースは誰にもないのだろうか? Accept-Encoding:
応答要求及びContent-Encoding:
で:HTTP/2データ圧縮
Frame 55: 151 bytes on wire (1208 bits), 151 bytes captured (1208 bits) on interface 0
Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst:00:00:00_00:00:00 (00:00:00:00:00:00)
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
Transmission Control Protocol, Src Port: 443 (443), Dst Port: 55300 (55300), Seq: 1087, Ack: 1078, Len: 85
Secure Sockets Layer
HyperText Transfer Protocol 2
Stream: HEADERS, Stream ID: 13, Length 47
Length: 47
Type: HEADERS (1)
Flags: 0x04
0... .... .... .... .... .... .... .... = Reserved: 0x00000000
.000 0000 0000 0000 0000 0000 0000 1101 = Stream Identifier: 13
[Pad Length: 0]
Header Block Fragment: 8854012a5a839bd9ab5f87497ca589d34d1f5c0333333861...
[Header Length: 177]
[Header Count: 6]
Header: :status: 200
Header: access-control-allow-origin: *
Header: content-encoding: gzip
Header: content-type: text/html
Header: content-length: 338
Header: date: Wed, 17 Aug 2016 15:14:25 GMT
Padding: <MISSING>
Frame 56: 442 bytes on wire (3536 bits), 442 bytes captured (3536 bits) on interface 0
Ethernet II, Src: 00:00:00_00:00:00 (00:00:00:00:00:00), Dst: 00:00:00_00:00:00 (00:00:00:00:00:00)
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1
Transmission Control Protocol, Src Port: 443 (443), Dst Port: 55300 (55300), Seq: 1172, Ack: 1078, Len: 376
Secure Sockets Layer
HyperText Transfer Protocol 2
Stream: DATA, Stream ID: 13, Length 338
Length: 338
Type: DATA (0)
Flags: 0x01
0... .... .... .... .... .... .... .... = Reserved: 0x00000000
.000 0000 0000 0000 0000 0000 0000 1101 = Stream Identifier: 13
[Pad Length: 0]
Data: 1f8b080000096e8800ff9cd2416b1b311005e0b3ffc5eb9e...
Padding: <MISSING>
HTTP/2はデータペイロードの新しい圧縮を追加せず、ヘッダーを追加します。あなたは明らかに、RFC:https://tools.ietf.org/html/rfc7540#ref-COMPRESSIONのHPACK文書へのリンクで、十分な見栄えをしていませんでした(..または単に「圧縮」を検索する)。 –
私はヘッダー圧縮の仕組みを知っています。私はこの行に興味があります。データ:1f8b080000096e8800ff9cd2416b1b311005e0b3ffc5eb9e ...これはヘッダにはないので、hpackはそこでは使われていません。gzipではありません。どのように動作するかを知るために – dneyer
'1f8b08'はgzip圧縮の最初のバイトなので、gzipです。さらに、レスポンスヘッダーには 'content-encoding:gzip'と書かれているので、DATAフレームにはgzippedレスポンスボディが含まれています。 – sbordet