ghci-websockets-0.0.1: A websocket server that survives GHCi reloads

Safe HaskellNone
LanguageHaskell2010

Ghci.Websockets

Contents

Synopsis

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

data Config Source #

Server configuration

Constructors

Config 

Fields

data Verbosity Source #

What to do with log messages

Constructors

Verbose

Write all log messages to stdout

Silent

Ignore all log messages

defaultConfig :: Config Source #

Default config, use port 9160 and ignore all log messages.