| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Network.HPACK
Description
HPACK: encoding and decoding a header list.
- type HPACKEncoding = DynamicTable -> HeaderList -> IO (DynamicTable, ByteStream)
- type HPACKDecoding = DynamicTable -> ByteStream -> 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 ByteStream = ByteString
- type Size = Int
- type Index = Int
Encoding and decoding
type HPACKEncoding = DynamicTable -> HeaderList -> IO (DynamicTable, ByteStream) Source
HPACK encoding, from HeaderList to ByteStream.
type HPACKDecoding = DynamicTable -> ByteStream -> IO (DynamicTable, HeaderList) Source
HPACK decoding, from ByteStream 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.
Constructors
| EncodeStrategy | |
Fields
| |
defaultEncodeStrategy :: EncodeStrategy Source
Default EncodeStrategy. compressionAlgo is Linear and useHuffman is True.
Errors for decoding
data DecodeError Source
Errors for decoder.
Constructors
| 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 |
Instances
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.
Basic types
type ByteStream = ByteString Source
Byte stream in HTTP request/response.