ВОЙТИ

WebSocketEvents

  • CLOSE

    Event is triggered when the connection with a WebSocket is closed, i.e., the onclose method was called.

  • ERROR

    Event is triggered when the connection with a WebSocket has been closed because of an error, i.e., the onerror method was called.

  • MESSAGE

    Event is triggered when data is received through a WebSocket, i.e., the onmessage method was called.

  • OPEN

    Event is triggered when the connection with a WebSocket is opened, i.e., the onopen method was called.

Events

CLOSE

Event is triggered when the connection with a WebSocket is closed, i.e., the onclose method was called.

Parameters

  • WebSocket close code.

  • reason:

    String

    Reason why the server closed the connection.

  • wasClean:

    boolean

    Value indicating whether the connection was cleanly closed.

  • websocket:

    WebSocket

    WebSocket object that triggered the event.

ERROR

Event is triggered when the connection with a WebSocket has been closed because of an error, i.e., the onerror method was called.

Parameters

  • websocket:

    WebSocket

    WebSocket object that triggered the event.

MESSAGE

Event is triggered when data is received through a WebSocket, i.e., the onmessage method was called.

Parameters

  • data:

    string

    The data sent by the message emitter.

  • websocket:

    WebSocket

    WebSocket object that triggered the event.

OPEN

Event is triggered when the connection with a WebSocket is opened, i.e., the onopen method was called.

Parameters

  • websocket:

    WebSocket

    WebSocket object that triggered the event.