Skip to content

HpackDecoder

Defined in: packages/format-http/src/hpack/hpack-decoder.ts:47

Decodes HPACK field blocks (RFC 7541), keeping the dynamic table of one direction of a connection.

Blocks must be decoded in the order they were sent, each exactly once: the table changes with every block. A block is always decoded to its end, even past maxHeaderListSize, so the table stays in sync with the encoder’s and only that block is lost.

Decoding is O(n) in the block size plus the decoded output, which maxHeaderListSize bounds.

new HpackDecoder(options): HpackDecoder

Defined in: packages/format-http/src/hpack/hpack-decoder.ts:52

HpackDecoderOptions

HpackDecoder

get tableSize(): number

Defined in: packages/format-http/src/hpack/hpack-decoder.ts:59

Current size of the dynamic table, in RFC 7541 §4.1 octets.

number

decode(block): HpackField[]

Defined in: packages/format-http/src/hpack/hpack-decoder.ts:83

Decode one complete field block.

Uint8Array

HpackField[]

The fields, in order.

When the block is malformed; the decoder is no longer usable.

When the fields exceed maxHeaderListSize; the decoder stays usable.


setMaxTableSize(size): void

Defined in: packages/format-http/src/hpack/hpack-decoder.ts:67

Lower or raise the table size this side allows, after advertising it. The encoder must then acknowledge a lowered size with an update.

number

void