haste-compiler-0.4: Haskell To ECMAScript compiler

Safe HaskellNone

Haste.WebSockets

Description

WebSockets API for Haste.

Synopsis

Documentation

withWebSocketSource

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.

withBinaryWebSocketSource

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 ()Source

Send a string over a WebSocket.

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

Send a Blob over a WebSocket.