-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | WebSocket library -- -- WebSocket library @package network-websocket @version 0.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 -> String -> String -> (WS -> IO ()) -> (WS -> String -> IO ()) -> (WS -> IO ()) -> Config -- | The port to bind to configPort :: Config -> Int -- | The origin URL used in the handshake configOrigin :: Config -> String -- | The location URL used in the handshake. This must match the Websocket -- url that the browsers connect to. configLocation :: Config -> String -- | 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 () -- | Connection state structure data WS WS :: Config -> Handle -> WS -- | The server's configuration config :: WS -> Config -- | The handle of the connected socket handle :: WS -> Handle startServer :: Config -> IO () send :: WS -> String -> IO ()