haste-compiler-0.5.5.0: Haskell To ECMAScript compiler

Safe HaskellNone
LanguageHaskell98

Haste.WebSockets

Description

WebSockets API for Haste.

Synopsis

Documentation

withWebSocket

Arguments

:: URL

URL to bind the WebSocket to

-> (WebSocket -> JSString -> CIO ())

Computation to run when new data arrives

-> CIO a

Computation to run when an error occurs

-> (WebSocket -> CIO a)

Computation using the WebSocket

-> CIO a 

Run a computation with a web socket. The computation will not be executed until a connection to the server has been established.

withBinaryWebSocket

Arguments

:: URL

URL to bind the WebSocket to

-> (WebSocket -> Blob -> CIO ())

Computation to run when new data arrives

-> CIO a

Computation to run when an error occurs

-> (WebSocket -> CIO a)

Computation using the WebSocket

-> CIO a 

Run a computation with a web socket. The computation will not be executed until a connection to the server has been established.

wsSend :: WebSocket -> JSString -> CIO ()

Send a string over a WebSocket.

wsSendBlob :: WebSocket -> Blob -> CIO ()

Send a Blob over a WebSocket.