{-# LANGUAGE OverloadedStrings #-}
module Network.HTTP2.Frame (
Frame (..),
FrameHeader (..),
FramePayload (..),
HeaderBlockFragment,
Padding,
isPaddingDefined,
encodeFrame,
encodeFrameChunks,
encodeFrameHeader,
encodeFrameHeaderBuf,
encodeFramePayload,
EncodeInfo (..),
encodeInfo,
module Network.HTTP2.Frame.Decode,
FrameType (
FrameType,
FrameData,
FrameHeaders,
FramePriority,
FrameRSTStream,
FrameSettings,
FramePushPromise,
FramePing,
FrameGoAway,
FrameWindowUpdate,
FrameContinuation
),
fromFrameType,
toFrameType,
minFrameType,
maxFrameType,
framePayloadToFrameType,
Priority (..),
Weight,
StreamId,
isControl,
isClientInitiated,
isServerInitiated,
testExclusive,
setExclusive,
clearExclusive,
FrameFlags,
defaultFlags,
testEndStream,
testAck,
testEndHeader,
testPadded,
testPriority,
setEndStream,
setAck,
setEndHeader,
setPadded,
setPriority,
SettingsList,
SettingsKey (
SettingsKey,
SettingsTokenHeaderTableSize,
SettingsEnablePush,
SettingsMaxConcurrentStreams,
SettingsInitialWindowSize,
SettingsMaxFrameSize,
SettingsMaxHeaderListSize
),
SettingsValue,
fromSettingsKey,
toSettingsKey,
defaultPayloadLength,
maxPayloadLength,
WindowSize,
defaultWindowSize,
maxWindowSize,
isWindowOverflow,
ErrorCode (
ErrorCode,
NoError,
ProtocolError,
InternalError,
FlowControlError,
SettingsTimeout,
StreamClosed,
FrameSizeError,
RefusedStream,
Cancel,
CompressionError,
ConnectError,
EnhanceYourCalm,
InadequateSecurity,
HTTP11Required
),
fromErrorCode,
toErrorCode,
connectionPreface,
connectionPrefaceLength,
frameHeaderLength,
recommendedConcurrency,
ErrorCodeId,
SettingsKeyId,
FrameTypeId,
) where
import qualified Data.ByteString as BS
import Network.Control (WindowSize)
import Imports
import Network.HTTP2.Frame.Decode
import Network.HTTP2.Frame.Encode
import Network.HTTP2.Frame.Types
connectionPreface :: ByteString
connectionPreface :: ByteString
connectionPreface = ByteString
"PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
connectionPrefaceLength :: Int
connectionPrefaceLength :: Int
connectionPrefaceLength = ByteString -> Int
BS.length ByteString
connectionPreface