hpack module provides functions for working with HPACK as described in
RFC 7541.
References
hpack module provides functions for working with HPACK as described in
RFC 7541.
context() = #hpack_context{dynamic_table = any(), connection_max_table_size = non_neg_integer()}
header() = {header_name(), header_value()}
header_name() = binary()
header_value() = binary()
headers() = [header()]
| all_fields_indexed/2 | |
| decode/2 | Decodes the given binary into a list of headers using the given HPACK context. |
| encode/2 |
Encodes the given Headers using the given Context. |
| new_context/0 | Equivalent to new_context(4096).
|
| new_context/1 |
Returns a new HPACK context with the given MaxTableSize as the max table size. |
| new_max_table_size/2 |
Updates the max table size of the given HPACK context (Context) to the given
NewSize. |
all_fields_indexed(Headers, Hpack_context) -> any()
decode(Bin::binary(), Context::context()) -> {ok, {headers(), context()}} | {error, compression_error} | {error, {compression_error, {bad_header_packet, binary()}}}
Decodes the given binary into a list of headers using the given HPACK context.
If successful, returns a {ok, {Headers, NewContext}} tuple where Headers
are the decoded headers and NewContext is the new HPACK context.
{Headers, NewContext} = hpack:decode(Binary, OldContext).
Encodes the given Headers using the given Context.
When successful, returns a {ok, {EncodedHeaders, NewContext}} tuple where
EncodedHeaders is a binary representing the encoded headers and NewContext
is the new HPACK context.
Headers = [{<<":method">>, <<"GET">>}],
{ok, {EncodedHeaders, NewContext}} = hpack:encode(Headers, hpack:new_context()).
new_context() -> context()
Equivalent to new_context(4096).
new_context(MaxTableSize::non_neg_integer()) -> context()
Returns a new HPACK context with the given MaxTableSize as the max table size.
Updates the max table size of the given HPACK context (Context) to the given
NewSize.
Generated by EDoc