Class WebSockets

Class for handling WebSockets connections Keeps track of and delegates the WebSocket connection Also provides methods for retrieving and closing connections

Hierarchy

  • WebSockets

Constructors

  • Constructor for WebSockets class

    Returns WebSockets

Properties

connections: Map<string, WebSocketConnection>
server: WebSocketServer

Methods

  • Method that handles incoming connections

    Parameters

    • ws: WebSocket

      The WebSocket instance

    Returns void

  • Handle WebSocket upgrade

    Parameters

    • request: IncomingMessage

      IncomingMessage object representing the request to the server

    • socket: Socket

      Socket object representing the underlying connection

    • head: Buffer

      Buffer holding the first packet of the upgraded stream

    Returns void

  • Asynchronous method that indicates if the WebSockets server is ready

    Returns

    A promise that resolves to a boolean indicating if the server is ready

    Returns Promise<boolean>

  • Returns Promise<void>

Generated using TypeDoc