Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
This modules implements a websocket server whose state survives GHCi
reloads. To use it, run start
once per GHCi session, and then
use sendText
, sendHtml
and sendPlot
to show the
values on all clients that are currently connected.
Start the server with default settings (HTTP on port 3000, websockets on port 9160)
startConfig :: Config -> IO () Source #
Start the websocket and HTTP servers using the config
Sending messages
sendPlot :: [(Double, Double)] -> IO () Source #
Show a Plotly 2D line plot of the given points.
>>>
sendPlot [(1, 2), (2, 5), (3, 4), (4, 3)]
>>>
sendPlot $ fmap (\i -> let i' = (fromIntegral i / 10) in (i', sin i')) [1..100]
Configuration
What to do with log messages
defaultConfig :: Config Source #
Default config, use ports 9160 (websockets) and 3000 (http) and ignore all log messages.
cfHTTPPort :: Config -> Int Source #
HTTP port
cfVerbosity :: Config -> Verbosity Source #
What to do with log messages