http2 - HTTP/2 数据压缩

标签 http2

我试图了解 HTTP/2 协议(protocol)压缩数据字段的方式。我在 rfc 中没有找到算法。我知道它是一个二进制协议(protocol)。
我正在寻找一种将二进制协议(protocol)恢复为人类可读内容的方法。我认为它就像写在标题中的gzip,但没有人有我可以查找二进制协议(protocol)引用的来源?

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 响应的响应正文被压缩(或不压缩)与使用 HTTP/1 的方式完全相同:Accept-Encoding:在请求和 Content-Encoding:在回应中。 HTTP/2 对正文的压缩没有任何新的作用,只有在 HTTP/1 中根本没有压缩的 header 。

关于http2 - HTTP/2 数据压缩,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39000834/

相关文章:

go - 如何从 net/http 请求中读取 HTTP/2 推送帧

nginx - 将 IPv4 与 IPv6 结合使用时,为什么我的服务器速度慢且 SSL 不匹配

HTTP2:如何表示支持? HTTP2 有 "Alternate-Protocol"吗?

http - 通过代理强制使用 HTTP1.1 而不是 HTTP2 (Charles)

php - 使用 PHP-FPM 和 Apache 时如何立即发送 HTTP/2 header

ssl - 在防火墙级别阻止 HTTP/2

ssl - 从浏览器拦截 TLS/HTTP/2

c++ - 通过 TLS 将 HTTP2 帧发送到服务器

http - HTTP2 中的 RST_STREAM 帧

server - HTTP/2 服务器推送和浏览器缓存