Documentation
¶
Overview ¶
Package hpack is an HPACK encoder whose choices follow a browser's (profile.HPACK): which fields enter the dynamic table, which entry a literal's name refers to, and when strings are Huffman-coded. Decoding stays with golang.org/x/net/http2/hpack; only what the client sends is fingerprinted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder encodes header blocks for one connection. It is not safe for concurrent use; the connection serialises header blocks.
func NewEncoder ¶
NewEncoder returns an encoder following policy, which must be a valid profile's (profile.Validate requires http2.hpack): there is no default, since how a browser encodes headers must be measured (decision 0008).
func (*Encoder) AppendBlock ¶
AppendBlock encodes fields in order and appends the header block to dst.
func (*Encoder) SetPeerTableSize ¶
SetPeerTableSize applies the peer's SETTINGS_HEADER_TABLE_SIZE, capped by the policy's MaxTableSize. The next block starts with size updates (RFC 7541, 4.2): the smallest size set since the last block if it went below the size then in effect, then the final one. An unchanged size is signalled only under SizeUpdatesAlways.