Safe Haskell | None |
---|---|
Language | Haskell2010 |
Websocket components built with Box
es.
Synopsis
- data SocketConfig = SocketConfig {}
- defaultSocketConfig :: SocketConfig
- runClient :: MonadIO m => SocketConfig -> ClientApp () -> m ()
- runServer :: MonadIO m => SocketConfig -> ServerApp -> m ()
- connect :: (MonadIO m, MonadConc m) => PendingConnection -> Codensity m Connection
- clientApp :: (MonadIO m, MonadConc m) => Box m (Either Text Text) Text -> Connection -> m ()
- responderApp :: (Text -> Either Text Text) -> PendingConnection -> IO ()
- serverApp :: (MonadConc m, MonadIO m) => Box m Text Text -> PendingConnection -> m ()
- receiver' :: MonadIO m => Committer m (Either Text Text) -> Connection -> m Bool
- receiver :: MonadIO m => Committer m Text -> Connection -> m ()
- sender :: (MonadIO m, WebSocketsData a, Show a) => Box m Text a -> Connection -> m ()
- responder :: MonadIO m => (Text -> Either Text Text) -> Committer m Text -> Connection -> m ()
Documentation
data SocketConfig Source #
Socket configuration
>>>
defaultSocketConfig
SocketConfig {host = "127.0.0.1", port = 9160, path = "/"}
Instances
defaultSocketConfig :: SocketConfig Source #
official default
connect :: (MonadIO m, MonadConc m) => PendingConnection -> Codensity m Connection Source #
Connection continuation.
clientApp :: (MonadIO m, MonadConc m) => Box m (Either Text Text) Text -> Connection -> m () Source #
A simple client app for a box with Left debug messages.
responderApp :: (Text -> Either Text Text) -> PendingConnection -> IO () Source #
Canned response function.
serverApp :: (MonadConc m, MonadIO m) => Box m Text Text -> PendingConnection -> m () Source #
Standard server app for a box.
receiver' :: MonadIO m => Committer m (Either Text Text) -> Connection -> m Bool Source #
default websocket receiver with messages Lefts are info/debug
sender :: (MonadIO m, WebSocketsData a, Show a) => Box m Text a -> Connection -> m () Source #
Sender that only emits.