"prettier": "^2.6.2",
"release-it": "^15.0.0",
"robohydra": "^0.6.9",
- "rollup": "^2.72.1",
+ "rollup": "^2.73.0",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-delete": "^2.0.0",
}
},
"node_modules/rollup": {
- "version": "2.72.1",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.1.tgz",
- "integrity": "sha512-NTc5UGy/NWFGpSqF1lFY8z9Adri6uhyMLI6LvPAXdBKoPRFhIIiBUpt+Qg2awixqO3xvzSijjhnb4+QEZwJmxA==",
+ "version": "2.73.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.73.0.tgz",
+ "integrity": "sha512-h/UngC3S4Zt28mB3g0+2YCMegT5yoftnQplwzPqGZcKvlld5e+kT/QRmJiL+qxGyZKOYpgirWGdLyEO1b0dpLQ==",
"dev": true,
"bin": {
"rollup": "dist/bin/rollup"
}
},
"rollup": {
- "version": "2.72.1",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.1.tgz",
- "integrity": "sha512-NTc5UGy/NWFGpSqF1lFY8z9Adri6uhyMLI6LvPAXdBKoPRFhIIiBUpt+Qg2awixqO3xvzSijjhnb4+QEZwJmxA==",
+ "version": "2.73.0",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.73.0.tgz",
+ "integrity": "sha512-h/UngC3S4Zt28mB3g0+2YCMegT5yoftnQplwzPqGZcKvlld5e+kT/QRmJiL+qxGyZKOYpgirWGdLyEO1b0dpLQ==",
"dev": true,
"requires": {
"fsevents": "~2.3.2"
"prettier": "^2.6.2",
"release-it": "^15.0.0",
"robohydra": "^0.6.9",
- "rollup": "^2.72.1",
+ "rollup": "^2.73.0",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-delete": "^2.0.0",
export abstract class AbstractUIServer {
public readonly chargingStations: Set<string>;
protected readonly uiServices: Map<ProtocolVersion, AbstractUIService>;
- protected uiServer: WSServer | HttpServer;
+ protected server: WSServer | HttpServer;
public constructor() {
this.chargingStations = new Set<string>();
export default class UIWebSocketServer extends AbstractUIServer {
public constructor(options?: ServerOptions) {
super();
- this.uiServer = new Server(options ?? Configuration.getUIServer().options);
+ this.server = new Server(options ?? Configuration.getUIServer().options);
}
public start(): void {
- this.uiServer.on('connection', (socket: WebSocket, request: IncomingMessage): void => {
+ this.server.on('connection', (socket: WebSocket, request: IncomingMessage): void => {
const protocolIndex = socket.protocol.indexOf(Protocol.UI);
const version = socket.protocol.substring(
protocolIndex + Protocol.UI.length
}
public stop(): void {
- this.uiServer.close();
+ this.server.close();
}
public sendResponse(message: string): void {
}
private broadcastToClients(message: string): void {
- for (const client of (this.uiServer as Server).clients) {
+ for (const client of (this.server as Server).clients) {
if (client?.readyState === OPEN) {
client.send(message);
}