box-socket-0.4.0: Box websockets
Safe HaskellSafe-Inferred
LanguageHaskell2010

Box.Socket

Description

Websocket components built with Boxes.

Synopsis

Documentation

data SocketConfig Source #

Socket configuration

>>> defaultSocketConfig
SocketConfig {host = "127.0.0.1", port = 9160, path = "/"}

Constructors

SocketConfig 

Fields

Instances

Instances details
Generic SocketConfig Source # 
Instance details

Defined in Box.Socket

Associated Types

type Rep SocketConfig :: Type -> Type #

Show SocketConfig Source # 
Instance details

Defined in Box.Socket

Eq SocketConfig Source # 
Instance details

Defined in Box.Socket

type Rep SocketConfig Source # 
Instance details

Defined in Box.Socket

type Rep SocketConfig = D1 ('MetaData "SocketConfig" "Box.Socket" "box-socket-0.4.0-HlgalyP7X7mGDHjMFHsc4B" 'False) (C1 ('MetaCons "SocketConfig" 'PrefixI 'True) (S1 ('MetaSel ('Just "host") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "port") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "path") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

runClient :: SocketConfig -> ClientApp () -> IO () Source #

Run a client app.

runServer :: SocketConfig -> ServerApp -> IO () Source #

Run a server app.

connect :: PendingConnection -> Codensity IO Connection Source #

Connection continuation.

clientApp :: Box IO (Either Text Text) Text -> Connection -> IO () Source #

A simple client app for a box with Left debug messages.

responderApp :: (Text -> Either Text Text) -> PendingConnection -> IO () Source #

Canned response function.

serverApp :: Box IO Text Text -> PendingConnection -> IO () Source #

Standard server app for a box.

receiver' :: Committer IO (Either Text Text) -> Connection -> IO Bool Source #

default websocket receiver with messages Lefts are info/debug

receiver :: Committer IO Text -> Connection -> IO () Source #

Receiver that only commits.

sender :: (WebSocketsData a, Show a) => Box IO Text a -> Connection -> IO () Source #

Sender that only emits.

responder :: (Text -> Either Text Text) -> Committer IO Text -> Connection -> IO () Source #

A receiver that responds based on received Text. lefts are quit signals. Rights are response text.