http2
Safe HaskellNone
LanguageHaskell2010

Network.HTTP2.Client.Internal

Contents

Synopsis

Documentation

newtype Request #

Constructors

Request OutObj 

Instances

Instances details
Show Request # 
Instance details

Defined in Network.HTTP.Semantics.Client.Internal

Methods

showsPrec :: Int -> Request -> ShowS

show :: Request -> String

showList :: [Request] -> ShowS

newtype Response #

Constructors

Response InpObj 

Instances

Instances details
Show Response # 
Instance details

Defined in Network.HTTP.Semantics.Client.Internal

Methods

showsPrec :: Int -> Response -> ShowS

show :: Response -> String

showList :: [Response] -> ShowS

data Config Source #

HTTP/2 configuration.

Constructors

Config 

Fields

  • confWriteBuffer :: Buffer

    This is used only by frameSender. This MUST be freed after frameSender is terminated.

  • confBufferSize :: BufferSize

    The size of the write buffer. We assume that the read buffer is the same size. So, this value is announced via SETTINGS_MAX_FRAME_SIZE to the peer.

  • confSendAll :: ByteString -> IO ()

    Not used when confSendAllWith is Just. When replacing it in a config which has one, e.g. from allocSimpleConfig, set confSendAllWith to Nothing or to a send of the same kind.

  • confSendAllWith :: Maybe (STM () -> ByteString -> IO (Either () ()))

    confSendAll which the library can give up on: Left when the STM action fires first. With it, a write which the peer does not read is ended by the timeout rather than by killing a thread. Part of the data may have gone, so the connection is closed after.

    Since: 5.4.13

  • confReadN :: Int -> IO ByteString

    When confReadNWith is Just, frames are read with it and only the connection preface with this. When replacing it in a config which has one, e.g. from allocSimpleConfig, set confReadNWith to Nothing or to a read of the same kind sharing its buffer.

  • confReadNWith :: Maybe (STM () -> Int -> IO ByteString)

    confReadN which the library can give up on: it answers with an empty string, as at end of input, when the STM action fires first. With it, the reader is stopped without being interrupted. It must share its buffer with confReadN.

    Since: 5.4.13

  • confPositionReadMaker :: PositionReadMaker
     
  • confTimeoutManager :: Manager
     
  • confMySockAddr :: SockAddr

    This is copied into Aux, if exist, on server.

  • confPeerSockAddr :: SockAddr

    This is copied into Aux, if exist, on server.

  • confReadNTimeout :: Bool
     
  • confOnInformational :: StreamId -> TokenHeaderTable -> IO ()

    Client only: called when a 1xx informational response (e.g. 103 Early Hints) is received on the given stream, ahead of the final response. No-op by default.

    Since: 5.4.2

data ClientConfig Source #

Client configuration

Constructors

ClientConfig 

Fields

Instances

Instances details
Eq ClientConfig Source # 
Instance details

Defined in Network.HTTP2.Client.Run

Methods

(==) :: ClientConfig -> ClientConfig -> Bool

(/=) :: ClientConfig -> ClientConfig -> Bool

Show ClientConfig Source # 
Instance details

Defined in Network.HTTP2.Client.Run

Methods

showsPrec :: Int -> ClientConfig -> ShowS

show :: ClientConfig -> String

showList :: [ClientConfig] -> ShowS

data Settings Source #

Constructors

Settings 

Fields

  • headerTableSize :: Int

    SETTINGS_HEADER_TABLE_SIZE

  • enablePush :: Bool

    SETTINGS_ENABLE_PUSH

  • maxConcurrentStreams :: Maybe Int

    SETTINGS_MAX_CONCURRENT_STREAMS

  • initialWindowSize :: WindowSize

    SETTINGS_INITIAL_WINDOW_SIZE

  • maxFrameSize :: Int

    SETTINGS_MAX_FRAME_SIZE

  • maxHeaderListSize :: Maybe Int

    SETTINGS_MAX_HEADER_LIST_SIZE. Our own value is also enforced: a field block whose decoded size (RFC 9113 section 6.5.2: the length of each field's name plus its value plus 32) exceeds it resets the stream. With Nothing, nothing is advertised but a limit of 64 KiB is enforced all the same (CVE-2026-49975).

  • pingRateLimit :: Int

    Maximum number of pings allowed per second (CVE-2019-9512)

  • emptyFrameRateLimit :: Int

    Maximum number of empty data frames allowed per second (CVE-2019-9518)

  • settingsRateLimit :: Int

    Maximum number of settings frames allowed per second (CVE-2019-9515)

  • rstRateLimit :: Int

    Maximum number of streams reset per second, whether by the peer's RST_STREAM (CVE-2023-44487) or by ours in answer to a stream error the peer caused (CVE-2025-8671)

Instances

Instances details
Eq Settings Source # 
Instance details

Defined in Network.HTTP2.H2.Settings

Methods

(==) :: Settings -> Settings -> Bool

(/=) :: Settings -> Settings -> Bool

Show Settings Source # 
Instance details

Defined in Network.HTTP2.H2.Settings

Methods

showsPrec :: Int -> Settings -> ShowS

show :: Settings -> String

showList :: [Settings] -> ShowS

data Aux #

Constructors

Aux 

Fields

Low level

data Stream Source #

Instances

Instances details
Show Stream Source # 
Instance details

Defined in Network.HTTP2.H2.Types

Methods

showsPrec :: Int -> Stream -> ShowS

show :: Stream -> String

showList :: [Stream] -> ShowS

data ClientIO Source #

Constructors

ClientIO 

Fields

runIO :: ClientConfig -> Config -> (ClientIO -> IO (IO a)) -> IO a Source #

Launching a receiver and a sender.