{-# 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,SettingsHeaderTableSize,SettingsEnablePush,SettingsMaxConcurrentStreams,SettingsInitialWindowSize,SettingsMaxFrameSize,SettingsMaxHeaderBlockSize)
, SettingsValue
, fromSettingsKey
, toSettingsKey
, Settings(..)
, defaultSettings
, updateSettings
, WindowSize
, defaultInitialWindowSize
, maxWindowSize
, isWindowOverflow
, ErrorCode(ErrorCode,NoError,ProtocolError,InternalError,FlowControlError,SettingsTimeout,StreamClosed,FrameSizeError,RefusedStream,Cancel,CompressionError,ConnectError,EnhanceYourCalm,InadequateSecurity,HTTP11Required)
, fromErrorCode
, toErrorCode
, connectionPreface
, connectionPrefaceLength
, frameHeaderLength
, maxPayloadLength
, recommendedConcurrency
, ErrorCodeId
, SettingsKeyId
, FrameTypeId
) where
import qualified Data.ByteString as BS
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