ChannelClient.Transports.Websocket (channel_client v0.1.1)

Copy Markdown

WebSocket transport for ChannelClient.Socket, built on the :websocket_client library.

Both :text and :binary frames are received and forwarded to the owning socket, so servers that emit binary encoded JSON (or any payload the configured json_library can decode) are supported. Outbound frames are always sent as :text frames.

Summary

Functions

Receives serialized messages from the remote WS endpoint and forwards them to the client sender process.

Sends serialized messages to the remote WS endpoint.

Functions

init(opts)

onconnect(ws_req, state)

ondisconnect(reason, state)

websocket_handle(other_msg, arg2, state)

Receives serialized messages from the remote WS endpoint and forwards them to the client sender process.

websocket_info(arg1, arg2, state)

Sends serialized messages to the remote WS endpoint.

websocket_terminate(reason, conn_state, state)