Module: Protocol::HPACK

Defined in:
lib/protocol/hpack/context.rb,
lib/protocol/hpack/error.rb,
lib/protocol/hpack/huffman.rb,
lib/protocol/hpack/version.rb,
lib/protocol/hpack/compressor.rb,
lib/protocol/hpack/decompressor.rb,
lib/protocol/hpack/huffman/machine.rb

Overview

Implementation of header compression for HTTP 2.0 (HPACK) format adapted to efficiently represent HTTP headers in the context of HTTP 2.0.

Defined Under Namespace

Classes: CompressionError, Compressor, Context, DecompressionError, Decompressor, Error, Huffman

Constant Summary collapse

HEADER_REPRESENTATION =

Header representation as defined by the spec.

{
  indexed: {prefix: 7, pattern: 0x80},
  incremental: {prefix: 6, pattern: 0x40},
  no_index: {prefix: 4, pattern: 0x00},
  never_indexed: {prefix: 4, pattern: 0x10},
  change_table_size: {prefix: 5, pattern: 0x20},
}
VERSION =
"1.4.0"
NAIVE =

Predefined options set for Compressor mew.org/~kazu/material/2014-hpack.pdf

{index: :never, huffman: :never}
LINEAR =
{index: :all, huffman: :never}
STATIC =
{index: :static, huffman: :never}
SHORTER =
{index: :all, huffman: :never}
NAIVE_HUFFMAN =
{index: :never, huffman: :always}
LINEAR_HUFFMAN =
{index: :all, huffman: :always}
STATIC_HUFFMAN =
{index: :static, huffman: :always}
SHORTER_HUFFMAN =
{index: :all, huffman: :shorter}
MODES =
{
  naive: NAIVE,
  linear: LINEAR,
  static: STATIC,
  shorter: SHORTER,
  naive_huffman: NAIVE_HUFFMAN,
  linear_huffman: NAIVE_HUFFMAN,
  static_huffman: NAIVE_HUFFMAN,
  shorter_huffman: NAIVE_HUFFMAN,
}