Running an HTTP/2 client over TLS (over TCP). ALPN is "h2".
Modulehttp2-tls-0.4.5Haskell2010
Network.HTTP2.TLS.Server
- 7 types
- 31 values
- Packagehttp2-tls-0.4.5
- Exports38
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceServer.hs
Runners
9 declarationsRunning an HTTP/2 client over TLS (over TCP). ALPN is "h2".
Running an HTTP/2 client over TCP.
Running an HTTP/2 client over TCP.
Server type. Server takes a HTTP request, should generate a HTTP response and push promises, then should give them to the sending function. The sending function would throw exceptions so that they can be logged.
The sending function must only be called once.
Either a host name e.g., "haskell.org" or a numeric host
address string consisting of a dotted decimal IPv4 address or an
IPv6 address e.g., "192.168.0.1".
Port number.
Use the Num instance (i.e. use a literal) to create a
PortNumber value.
1 :: PortNumber1read "1" :: PortNumber1show (12345 :: PortNumber)"12345"50000 < (51000 :: PortNumber)True50000 < (52000 :: PortNumber)True50000 + (10000 :: PortNumber)60000
Instances10Bounded, Enum, Eq, Integral, Num, Ord, …
Bounded PortNumberDefined in network-3.2.8.0 · Network.Socket.TypesEnum PortNumberDefined in network-3.2.8.0 · Network.Socket.TypesEq PortNumberDefined in network-3.2.8.0 · Network.Socket.TypesIntegral PortNumberDefined in network-3.2.8.0 · Network.Socket.TypesNum PortNumberDefined in network-3.2.8.0 · Network.Socket.TypesOrd PortNumberDefined in network-3.2.8.0 · Network.Socket.TypesRead PortNumberDefined in network-3.2.8.0 · Network.Socket.TypesReal PortNumberDefined in network-3.2.8.0 · Network.Socket.TypesShow PortNumberDefined in network-3.2.8.0 · Network.Socket.TypesStorable PortNumberDefined in network-3.2.8.0 · Network.Socket.Types
runTLS :: Settings-> Credentials-> HostName-> PortNumber-> ByteStringALPN
-> (Manager -> IOBackend -> IO a)-> IO a
runTLSWithSocket :: Settings-> Credentials-> Socket-> ByteStringALPN
-> (Manager -> IOBackend -> IO a)-> IO a
Settings
14 declarationsDefault settings.
Timeout in seconds. (All)
settingsTimeout defaultSettings30
Send buffer size. (H2 and H2c)
settingsSendBufferSize defaultSettings4096
If the size of receiving data is less than or equal, the timeout is not reset. (All)
settingsSlowlorisSize defaultSettings50
When the size of a read buffer is lower than this limit, the buffer is thrown awany (and is eventually freed). Then a new buffer is allocated. (All)
settingsReadBufferSize defaultSettings16384
The allocation size for a read buffer. (All)
settingsReadBufferLowerLimit defaultSettings2048
Key logger.
Applications may wish to set this depending on the SSLKEYLOGFILE environment variable. The default is do nothing.
Default: do nothing
Deprecated. This field is meaningless now
The http2 library now spawns a thread for each connection. Its limit is based on settingsConcurrentStreams.
The maximum number of incoming streams on the net (H2 and H2c)
settingsConcurrentStreams defaultSettings64
The window size of a connection (H2 and H2c)
settingsConnectionWindowSize defaultSettings1048575
The window size of incoming streams (H2 and H2c)
settingsStreamWindowSize defaultSettings262144
TLS session manager (H2 and TLS)
Default: noSessionManager
The max size of early data (0-RTT) to be accepted. (H2 and TLS) 0 means that early data is not accepted.
settingsEarlyDataSize defaultSettings0
Rate limits
Maximum number of pings allowed per second (CVE-2019-9512)
settingsPingRateLimit defaultSettings10
Maximum number of empty data frames allowed per second (CVE-2019-9518)
settingsEmptyFrameRateLimit defaultSettings4
Maximum number of settings frames allowed per second (CVE-2019-9515)
settingsSettingsRateLimit defaultSettings4
Maximum number of reset frames allowed per second (CVE-2023-44487)
settingsRstRateLimit4
IO backend
7 declarationsSending and receiving functions. Tiemout is reset when they return. One exception is the slowloris attach prevention. See settingsSlowlorisSize.
Sending.
Sending many.
Receiving.
The socket for the request
Internal
4 declarationsConstructors
ServerIOsioMySockAddr :: SockAddrsioPeerSockAddr :: SockAddrsioReadRequest :: IO (a, Request)sioWriteResponse :: a -> Response -> IO ()Response MUST be created with responseBuilder. Others are not supported.