Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
This modules implements a websocket server whose state survives GHCi
reloads. To use it, run initialiseDef
once per GHCi session, and then
call broadcast
to send a JSON value to all clients that are currently
connected. All messages from clients are ignored.
initialise :: Config -> IO () Source #
Start the websocket server using the port specified in the config. Call once per GHCi session.
initialiseDef :: IO () Source #
Start the websocket server using the default config (port 9160). Call once per GHCi session.
broadcast :: ToJSON a => a -> IO () Source #
Send a JSON object to all clients. Throws an exception if initialise
has
not been run first.
Configuration
Server configuration
What to do with log messages
defaultConfig :: Config Source #
Default config, use port 9160 and ignore all log messages.