import { WSClient } from "https://deno.land/x/socket_client@0.1.0-alpha.1/src/client.ts";
Constructors
new
WSClient(config: WSConfig)Properties
fragments: Message[]
The current fragments.
headers: Headers
Headers that will be used when connecting.
logger: Logger
The logger used to log messages.
onclose: WSCloseEvent
The function to handle close event.
onerror: WSErrorEvent
The function to handle error event.
onmessage: WSMessageEvent
The function to handle message event.
onopen: WSOpenEvent
The function to handle open event.
state: WSState
The state of the connection.
uri: URL
The uri used to establish the WebSocket connection.
Methods
close(options?: CloseOptions)
Close the websocket connection.
connect()
Connect to the websocket.
sendMessage(mes: string | Uint8Array)
Send/Write a message frame to the websocket.