ReadonlyidentifierA unique identifier for this connection (UUID string).
ReadonlyreadyThe current connection state.
Close the WebSocket connection with a normal closure code (1000). If a close callback is registered, it is invoked synchronously.
Destroy this WebSocket, releasing all resources without invoking callbacks.
Called automatically by hs.http.shutdown(). After destroy(), do not use this object.
Send a text message to the server.
The connection must be open (readyState === 1).
The text message to send.
This WebSocket, for chaining.
Set the callback invoked when the connection is closed by the remote end.
Called with the WebSocket close code and reason.
This WebSocket, for chaining.
Set the callback invoked when a connection or protocol error occurs.
Called with the error description.
This WebSocket, for chaining.
Set the callback invoked when a text message is received from the server.
Called with each received message.
This WebSocket, for chaining.
Set the callback invoked when the connection is established.
Called when the connection opens.
This WebSocket, for chaining.
A WebSocket client connection created by
hs.http.openWebSocket(). The connection opens immediately when returned. Use the chainable setter methods to register event callbacks, then callsend()to transmit messages. Do not instantiateHSWebSocketdirectly — usehs.http.openWebSocket().