ghcjs-base-0.2.0.0: base library for GHCJS

Safe HaskellNone
LanguageHaskell98

JavaScript.Web.WebSocket

Synopsis

Documentation

data WebSocketRequest Source

Constructors

WebSocketRequest 

Fields

url :: JSString
 
protocols :: [JSString]
 
onClose :: Maybe (CloseEvent -> IO ())

called when the connection closes (at most once)

onMessage :: Maybe (MessageEvent -> IO ())

called for each message

connect :: WebSocketRequest -> IO WebSocket Source

create a WebSocket

close :: Maybe Int -> Maybe JSString -> WebSocket -> IO () Source

close a websocket and release the callbacks