Skip to main content

WebSocket

The WebSocket class represents websocket connections in the page.


Methods

IsClosed

Added before v1.9 webSocket.IsClosed

Indicates that the web socket has been closed.

Usage

WebSocket.IsClosed

Returns


Url

Added before v1.9 webSocket.Url

Contains the URL of the WebSocket.

Usage

WebSocket.Url

Returns


Events

event Close

Added before v1.9 webSocket.event Close

Fired when the websocket closes.

Usage

WebSocket.Close += async (_, webSocket) => {};

Event data


event FrameReceived

Added in: v1.9 webSocket.event FrameReceived

Fired when the websocket receives a frame.

Usage

WebSocket.FrameReceived += async (_, webSocketFrame) => {};

Event data


event FrameSent

Added in: v1.9 webSocket.event FrameSent

Fired when the websocket sends a frame.

Usage

WebSocket.FrameSent += async (_, webSocketFrame) => {};

Event data


event SocketError

Added in: v1.9 webSocket.event SocketError

Fired when the websocket has an error.

Usage

WebSocket.SocketError += async (_, value) => {};

Event data