http2-0.7.0: HTTP/2.0 library including frames and HPACK

Safe HaskellNone
LanguageHaskell2010

Network.HPACK

Contents

Description

HPACK: encoding and decoding a header list.

Synopsis

Encoding and decoding

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.

Constructors

Naive

No compression

Static

Using the static table only

Linear

Using indices only

data EncodeStrategy Source

Strategy for HPACK encoding.

Constructors

EncodeStrategy 

Fields

compressionAlgo :: CompressionAlgo

Which compression algorithm is used.

useHuffman :: Bool

Whether or not to use Huffman encoding for strings.

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

Headers

type HeaderList = [Header] Source

Header list.

type HeaderName = ByteString Source

Header name.

type HeaderValue = ByteString Source

Header value.

Basic types

type ByteStream = ByteString Source

Byte stream in HTTP request/response.

type Size = Int Source

Size in bytes.

type Index = Int Source

Index for table.