@minecraft/server-net
    Preparing search index...

    Class WebSocketClientBeta

    An active WebSocket client.

    Index

    Properties

    Methods

    Properties

    Contains a set of events related to this WebSocket client.

    isOpen: boolean

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

    Methods

    • Beta

      Returns void

      Closes the connection with the server.

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

      This function can throw errors.

      WebSocketNotConnectedError

    • Beta

      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