WebSocketHandler class

The Zyno Bot Addons WebSocketHandler class extends the NodeJS built-in EventEmitter class.

const websocketHandler = new WebSocketHandler(httpServer: HttpServer);

constructor

The constructor of the WebSocketHandler class requires one argument. The argument must be an intance of the NodeJS built-in HTTP Server class and provides the data for the WebSocket server.

Properties

sockets

An array with entries which are instances of the WebSocket class and define the open WebSocket connections.

errorMessages

An array with the error messages made by the client side of the WebSocket from all the WebSocket connections.

Events

EventDescriptionArguments

connection

Gets emitted when a new WebSocket connection is made by a client.

WebSocket, RequestInfo

Last updated