Safe Haskell | None |
---|---|
Language | Haskell2010 |
HPACK: encoding and decoding a header list.
- type HPACKEncoding = DynamicTable -> HeaderList -> IO (DynamicTable, ByteString)
- type HPACKDecoding = DynamicTable -> ByteString -> IO (DynamicTable, HeaderList)
- encodeHeader :: EncodeStrategy -> HPACKEncoding
- decodeHeader :: HPACKDecoding
- data DynamicTable
- newDynamicTableForEncoding :: Size -> IO DynamicTable
- newDynamicTableForDecoding :: Size -> IO DynamicTable
- data CompressionAlgo
- data EncodeStrategy = EncodeStrategy {}
- defaultEncodeStrategy :: EncodeStrategy
- data DecodeError
- type HeaderList = [Header]
- type Header = (HeaderName, HeaderValue)
- type HeaderName = ByteString
- type HeaderValue = ByteString
- type Size = Int
- type Index = Int
Encoding and decoding
type HPACKEncoding = DynamicTable -> HeaderList -> IO (DynamicTable, ByteString) Source
HPACK encoding, from HeaderList
to ByteString
.
type HPACKDecoding = DynamicTable -> ByteString -> IO (DynamicTable, HeaderList) Source
HPACK decoding, from ByteString
to HeaderList
.
encodeHeader :: EncodeStrategy -> HPACKEncoding Source
Converting HeaderList
for HTTP request to the low level format.
decodeHeader :: HPACKDecoding Source
Converting the low level format for HTTP request to HeaderList
.
DecodeError
would be thrown.
DynamicTable
data DynamicTable Source
Type for dynamic table.
newDynamicTableForEncoding :: Size -> IO DynamicTable Source
Creating DynamicTable
.
The default maxDynamicTableSize is 4096 bytes,
an array has 128 entries, resulting 1024 bytes in 64bit machine
newDynamicTableForDecoding :: Size -> IO DynamicTable Source
Creating DynamicTable
.
The default maxDynamicTableSize is 4096 bytes,
an array has 128 entries, resulting 1024 bytes in 64bit machine
Strategy for encoding
data CompressionAlgo Source
Compression algorithms for HPACK encoding.
data EncodeStrategy Source
Strategy for HPACK encoding.
EncodeStrategy | |
|
defaultEncodeStrategy :: EncodeStrategy Source
Default EncodeStrategy
.
>>>
defaultEncodeStrategy
EncodeStrategy {compressionAlgo = Linear, useHuffman = True}
Errors for decoding
data DecodeError Source
Errors for decoder.
IndexOverrun Index | Index is out of range |
EosInTheMiddle | Eos appears in the middle of huffman string |
IllegalEos | Non-eos appears in the end of huffman string |
TooLongEos | Eos of huffman string is more than 7 bits |
EmptyEncodedString | Encoded string has no length |
EmptyBlock | Header block is empty |
Headers
type HeaderList = [Header] Source
Header list.
type Header = (HeaderName, HeaderValue) Source
Header.
type HeaderName = ByteString Source
Header name.
type HeaderValue = ByteString Source
Header value.