Network.WebSockets.Extensions

websockets-0.13.0.0: A sensible and clean way to write WebSocket-capable servers in Haskell.

Safe Haskell | None
Language | Haskell2010

Network.WebSockets.Extensions

Synopsis

- data ExtensionDescription = ExtensionDescription {
  - extName :: !ByteString
  - extParams :: ![ExtensionParam]
  }
- type ExtensionDescriptions = [ExtensionDescription]
- parseExtensionDescriptions :: ByteString -> Either String ExtensionDescriptions
- type NegotiateExtension = ExtensionDescriptions -> Either String Extension
- data Extension = Extension {
  - extHeaders :: Headers
  - extParse :: IO (Maybe Message) -> IO (IO (Maybe Message))
  - extWrite :: ([Message] -> IO ()) -> IO ([Message] -> IO ())
  }

# Documentation

data ExtensionDescription #

Constructors

ExtensionDescription |
Fields extName :: !ByteString extParams :: ![ExtensionParam]

#### Instances

Instances details

Show ExtensionDescription # |
Instance details Defined in Network.WebSockets.Extensions.Description Methods showsPrec :: Int -> ExtensionDescription -> ShowS # show :: ExtensionDescription -> String # showList :: [ExtensionDescription] -> ShowS #
Eq ExtensionDescription # |
Instance details Defined in Network.WebSockets.Extensions.Description Methods (==) :: ExtensionDescription -> ExtensionDescription -> Bool # (/=) :: ExtensionDescription -> ExtensionDescription -> Bool #

type ExtensionDescriptions = [ExtensionDescription] #

parseExtensionDescriptions :: ByteString -> Either String ExtensionDescriptions #

type NegotiateExtension = ExtensionDescriptions -> Either String Extension #

data Extension #

An extension is currently allowed to set extra headers and transform the parse/write functions of `Connection`.

This type is very likely to change as other extensions are introduced.

Constructors

Extension |
Fields extHeaders :: Headers extParse :: IO (Maybe Message) -> IO (IO (Maybe Message)) extWrite :: ([Message] -> IO ()) -> IO ([Message] -> IO ())