http3-0.0.0: HTTP/3 library
Safe HaskellNone
LanguageHaskell2010

Network.QPACK

Description

Thread-safe QPACK encoder/decoder.

Synopsis

Encoder

data QEncoderConfig Source #

Configuration for QPACK encoder.

Instances

Instances details
Show QEncoderConfig Source # 
Instance details

Defined in Network.QPACK

defaultQEncoderConfig :: QEncoderConfig Source #

Default configuration for QPACK encoder.

>>> defaultQEncoderConfig
QEncoderConfig {ecDynamicTableSize = 4096, ecHeaderBlockBufferSize = 4096, ecPrefixBufferSize = 128, ecInstructionBufferSize = 4096, encStrategy = EncodeStrategy {compressionAlgo = Static, useHuffman = True}}

Decoder

data QDecoderConfig Source #

Configuration for QPACK decoder.

Instances

Instances details
Show QDecoderConfig Source # 
Instance details

Defined in Network.QPACK

defaultQDecoderConfig :: QDecoderConfig Source #

Default configuration for QPACK decoder.

>>> defaultQDecoderConfig
QDecoderConfig {dcDynamicTableSize = 4096, dcHuffmanBufferSize = 4096}

Decoder for debugging

type QDecoderS = EncodedFieldSection -> IO HeaderList Source #

QPACK simple decoder.

newQDecoderS :: QDecoderConfig -> Bool -> IO (QDecoderS, EncoderInstructionHandlerS) Source #

Creating a new simple QPACK decoder.

Types

type EncodedEncoderInstruction = ByteString Source #

Encoded encoder instruction.

type EncoderInstructionHandler = (Int -> IO EncodedEncoderInstruction) -> IO () Source #

Encoder instruction handler.

type EncoderInstructionHandlerS = EncodedEncoderInstruction -> IO () Source #

Simple encoder instruction handler.

type EncodedDecoderInstruction = ByteString Source #

Encoded decoder instruction.

type DecoderInstructionHandler = (Int -> IO EncodedDecoderInstruction) -> IO () Source #

Decoder instruction handler.

type InstructionHandler = (Int -> IO ByteString) -> IO () Source #

A type to integrating handlers.

type Size = Int #

Size in bytes.

Strategy

data EncodeStrategy #

Strategy for HPACK encoding.

Constructors

EncodeStrategy 

Fields

Instances

Instances details
Eq EncodeStrategy 
Instance details

Defined in Network.HPACK.Types

Show EncodeStrategy 
Instance details

Defined in Network.HPACK.Types

data CompressionAlgo #

Compression algorithms for HPACK encoding.

Constructors

Naive

No compression

Static

Using indices in the static table only

Linear

Using indices

Instances

Instances details
Eq CompressionAlgo 
Instance details

Defined in Network.HPACK.Types

Show CompressionAlgo 
Instance details

Defined in Network.HPACK.Types

Re-exports

type HeaderTable = (TokenHeaderList, ValueTable) #

A pair of token list and value table.

type TokenHeaderList = [TokenHeader] #

TokenBased header list.

type ValueTable = Array Int (Maybe HeaderValue) #

An array to get HeaderValue quickly. getHeaderValue should be used. Internally, the key is Token ix.

type Header = (HeaderName, HeaderValue) #

Header.

type HeaderList = [Header] #

Header list.

toHeaderTable :: [(CI HeaderName, HeaderValue)] -> IO HeaderTable #

Converting a header list of the http-types style to TokenHeaderList and ValueTable.

original :: CI s -> s #

Retrieve the original string-like value.

foldedCase :: CI s -> s #

Retrieve the case folded string-like value. (Also see foldCase).

mk :: FoldCase s => s -> CI s #

Make the given string-like value case insensitive.