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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HpackDecoder(
options):HpackDecoder
Defined in: packages/format-http/src/hpack/hpack-decoder.ts:52
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”HpackDecoder
Accessors
Section titled “Accessors”tableSize
Section titled “tableSize”Get Signature
Section titled “Get Signature”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.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”decode()
Section titled “decode()”decode(
block):HpackField[]
Defined in: packages/format-http/src/hpack/hpack-decoder.ts:83
Decode one complete field block.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”The fields, in order.
Throws
Section titled “Throws”When the block is malformed; the decoder is no longer usable.
Throws
Section titled “Throws”When the fields exceed
maxHeaderListSize; the decoder stays usable.
setMaxTableSize()
Section titled “setMaxTableSize()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void