Creates a new WebsocketServer instance and starts the server using the provided HTTP server.
The HTTP server object used to start the WebSocket server.
Private
connectionsPrivate
httpThe HTTP server object used to start the WebSocket server.
Private
loggingPrivate
serverStatic
Private
_fetchStatic
fetchDetermines whether the connection IP location functionality is enabled.
A boolean indicating if the connection IP location functionality is enabled.
Private
getRetrieves all currently established WebSocket connections.
An array of WebsocketConnection objects representing the established connections.
Private
initializePrivate
initializePrivate
loadUpdates the client information of the connection.
An object containing descriptions concerning the client device.
The associated WebsocketConnection object.
Private
onHandles the WebSocket connection close event.
The closed WebsocketConnection object.
A callback function that removes the closed connection from the list of established connections.
Private
onStatic
enableGenerated using TypeDoc
WebSocket Server
The WebSocketServer class is used to start and configure the WebSocket service. It provides full-duplex communication channels over a single TCP connection using the WebSocket protocol. This enables real-time, two-way communication between a client (e.g., a web browser) and a server, allowing for interactive web applications.