http2-5.3.10: HTTP/2 library

Safe Haskell | None
Language | Haskell2010

Network.HTTP2.Client.Internal

Contents

- Low level

Synopsis

- newtype Request = Request OutObj
- newtype Response = Response InpObj
- data ClientConfig = ClientConfig {
  - scheme :: Scheme
  - authority :: Authority
  - cacheLimit :: Int
  - connectionWindowSize :: WindowSize
  - settings :: Settings
  }
- data Settings = Settings {
  - headerTableSize :: Int
  - enablePush :: Bool
  - maxConcurrentStreams :: Maybe Int
  - initialWindowSize :: WindowSize
  - maxFrameSize :: Int
  - maxHeaderListSize :: Maybe Int
  - pingRateLimit :: Int
  - emptyFrameRateLimit :: Int
  - settingsRateLimit :: Int
  - rstRateLimit :: Int
  }
- data Aux = Aux {
  - auxPossibleClientStreams :: IO Int
  }
- data Stream
- data ClientIO = ClientIO {
  - cioMySockAddr :: SockAddr
  - cioPeerSockAddr :: SockAddr
  - cioWriteRequest :: Request -> IO (StreamId, Stream)
  - cioReadResponse :: Stream -> IO Response
  - cioWriteBytes :: ByteString -> IO ()
  - cioCreateStream :: IO (StreamId, Stream)
  }
- runIO :: ClientConfig -> Config -> (ClientIO -> IO (IO a)) -> IO a

# Documentation

newtype Request Source #

Request from client.

Constructors

Request OutObj |

#### Instances

Instances details

Show Request |
Instance details Defined in Network.HTTP.Semantics.Client.Internal Methods showsPrec :: Int -> Request -> ShowS Source # show :: Request -> String Source # showList :: [Request] -> ShowS Source #

newtype Response Source #

Response from server.

Constructors

Response InpObj |

#### Instances

Instances details

Show Response |
Instance details Defined in Network.HTTP.Semantics.Client.Internal Methods showsPrec :: Int -> Response -> ShowS Source # show :: Response -> String Source # showList :: [Response] -> ShowS Source #

data ClientConfig Source #

Client configuration

Constructors

ClientConfig |

Fields

- scheme :: Scheme

  https or http

- authority :: Authority

  Server name

- cacheLimit :: Int

  The maximum number of incoming streams on the net

- connectionWindowSize :: WindowSize

  The window size of connection.

- settings :: Settings

  Settings

#### Instances

Instances details

Show ClientConfig Source # |
Instance details Defined in Network.HTTP2.Client.Run Methods showsPrec :: Int -> ClientConfig -> ShowS Source # show :: ClientConfig -> String Source # showList :: [ClientConfig] -> ShowS Source #
Eq ClientConfig Source # |
Instance details Defined in Network.HTTP2.Client.Run Methods (==) :: ClientConfig -> ClientConfig -> Bool Source # (/=) :: ClientConfig -> ClientConfig -> Bool Source #

data Settings Source #

HTTP/2 settings. See https://datatracker.ietf.org/doc/html/rfc9113#name-defined-settings.

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

- 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 reset frames allowed per second (CVE-2023-44487)

#### Instances

Instances details

Show Settings Source # |
Instance details Defined in Network.HTTP2.H2.Settings Methods showsPrec :: Int -> Settings -> ShowS Source # show :: Settings -> String Source # showList :: [Settings] -> ShowS Source #
Eq Settings Source # |
Instance details Defined in Network.HTTP2.H2.Settings Methods (==) :: Settings -> Settings -> Bool Source # (/=) :: Settings -> Settings -> Bool Source #

data Aux Source #

Additional information.

Constructors

Aux |

Fields

- auxPossibleClientStreams :: IO Int

  How many streams can be created without blocking.

# Low level

data Stream Source #

#### Instances

Instances details

Show Stream Source # |
Instance details Defined in Network.HTTP2.H2.Types Methods showsPrec :: Int -> Stream -> ShowS Source # show :: Stream -> String Source # showList :: [Stream] -> ShowS Source #

data ClientIO Source #

Constructors

ClientIO |

Fields

- cioMySockAddr :: SockAddr
- cioPeerSockAddr :: SockAddr
- cioWriteRequest :: Request -> IO (StreamId, Stream)
- cioReadResponse :: Stream -> IO Response
- cioWriteBytes :: ByteString -> IO ()
- cioCreateStream :: IO (StreamId, Stream)

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

Launching a receiver and a sender.