haste-compiler-0.5.4.1: Haskell To ECMAScript compiler

Safe HaskellNone
LanguageHaskell98

Haste.WebSockets

Description

WebSockets API for Haste.

Synopsis

Documentation

withWebSocket Source

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 Source

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.