Skip to content

QpackEncoder

Defined in: packages/format-http/src/qpack/qpack-encoder.ts:39

Encodes QPACK field sections (RFC 9204) for one HTTP/3 connection.

This encoder uses the static table and literals only, never the dynamic table: its sections never block the peer and need no acknowledgement, at some cost in size for repeated non-static fields. It still reads the peer’s decoder stream (receiveDecoderInstructions), which QPACK requires to be valid, and takeInstructions has nothing to send.

Encoding is O(n) in the fields’ total length.

new QpackEncoder(options?): QpackEncoder

Defined in: packages/format-http/src/qpack/qpack-encoder.ts:43

QpackEncoderOptions

QpackEncoder

encode(streamId, fields): Uint8Array<ArrayBuffer>

Defined in: packages/format-http/src/qpack/qpack-encoder.ts:57

Encode one field section for streamId. Names must already be lowercase, and names and values Latin-1. A sensitive field is sent with the ‘N’ bit, so no table on the path may keep it.

number

The stream the section is sent on, which a dynamic table reference would be acknowledged by.

Iterable<HpackField>

Uint8Array<ArrayBuffer>

The section, ready to be the payload of a HEADERS frame.

When a name or value is not Latin-1.


receiveDecoderInstructions(chunk): void

Defined in: packages/format-http/src/qpack/qpack-encoder.ts:91

Read instructions from the peer’s decoder stream, in any chunking.

Uint8Array

void

QPACK_DECODER_STREAM_ERROR when an instruction is invalid: acknowledging a section or insertions this encoder never sent.


takeInstructions(): Uint8Array<ArrayBuffer> | null

Defined in: packages/format-http/src/qpack/qpack-encoder.ts:136

Encoder stream bytes to send, or null when there are none — always, as this encoder never changes the dynamic table.

Uint8Array<ArrayBuffer> | null