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 -> Cont 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
Eq SocketConfig Source # | |
Defined in Box.Socket (==) :: SocketConfig -> SocketConfig -> Bool # (/=) :: SocketConfig -> SocketConfig -> Bool # | |
Show SocketConfig Source # | |
Defined in Box.Socket showsPrec :: Int -> SocketConfig -> ShowS # show :: SocketConfig -> String # showList :: [SocketConfig] -> ShowS # | |
Generic SocketConfig Source # | |
Defined in Box.Socket type Rep SocketConfig :: Type -> Type # from :: SocketConfig -> Rep SocketConfig x # to :: Rep SocketConfig x -> SocketConfig # | |
type Rep SocketConfig Source # | |
Defined in Box.Socket type Rep SocketConfig = D1 ('MetaData "SocketConfig" "Box.Socket" "box-socket-0.1.2-inplace" 'False) (C1 ('MetaCons "SocketConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "host") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "port") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "path") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) |
defaultSocketConfig :: SocketConfig Source #
official default
connect :: (MonadIO m, MonadConc m) => PendingConnection -> Cont 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.