Script API - v1.26.30.27
    Preparing search index...

    An active WebSocket client.

    export class WebSocketClient {
    private constructor();
    readonly afterEvents: WebSocketClientAfterEvents;
    readonly isOpen: boolean;
    close(): void;
    send(payload: string): void;
    }
    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    Contains a set of events related to this WebSocket client.

    This property can't be read in early-execution mode.

    isOpen: boolean

    Set to true if the socket is current connected to the server.

    This property can't be read in early-execution mode.

    Methods

    • Returns void

      Closes the connection with the server.

      This function can't be called in restricted-execution mode.

      This function can throw errors.

      WebSocketNotConnectedError

      This function can't be called in early-execution mode.

    • Parameters

      • payload: string

        The payload that will be included in the network packet.

      Returns void

      Sends the provided payload to the server.

      This function can't be called in restricted-execution mode.

      This function can throw errors.

      RequestBodyTooLargeError

      WebSocketNotConnectedError

      This function can't be called in early-execution mode.