-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | WebSocket library -- -- A library for creating Websocket servers @package network-websocket @version 0.2.1 -- | Library for creating Websocket servers. Some parts cribbed from Jeff -- Foster's blog post at -- http://www.fatvat.co.uk/2010/01/web-sockets-and-haskell.html module Network.Websocket -- | Server configuration structure data Config Config :: Int -> ConfigRestriction -> ConfigRestriction -> (WS -> IO ()) -> (WS -> String -> IO ()) -> (WS -> IO ()) -> Config -- | The port to bind to configPort :: Config -> Int -- | The origin URL used in the handshake configOrigins :: Config -> ConfigRestriction -- | The location URL used in the handshake. This must match the Websocket -- url that the browsers connect to. configDomains :: Config -> ConfigRestriction -- | The onopen callback, called when a socket is opened configOnOpen :: Config -> WS -> IO () -- | The onmessage callback, called when a message is received configOnMessage :: Config -> WS -> String -> IO () -- | The onclose callback, called when the connection is closed. configOnClose :: Config -> WS -> IO () data ConfigRestriction Any :: ConfigRestriction Only :: [String] -> ConfigRestriction -- | Connection state structure data WS WS :: Config -> Handle -> WS -- | The server's configuration wsConfig :: WS -> Config -- | The handle of the connected socket wsHandle :: WS -> Handle startServer :: Config -> IO () send :: WS -> String -> IO () instance Eq Status instance Show Request