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 Source #

Constructors

ExtensionDescription |

Fields

- extName :: !ByteString
- extParams :: ![ExtensionParam]

#### Instances

Instances details

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

type ExtensionDescriptions = [ExtensionDescription] Source #

parseExtensionDescriptions :: ByteString -> Either String ExtensionDescriptions Source #

type NegotiateExtension = ExtensionDescriptions -> Either String Extension Source #

data Extension Source #

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 ())