use of websockets

This commit is contained in:
2025-11-01 19:23:32 +01:00
parent 57c30a0156
commit d5f7b1598f
5 changed files with 131 additions and 100 deletions

View File

@@ -102,6 +102,8 @@ class WebSocketClient {
const message = JSON.parse(data);
const { type, data: payload, timestamp } = message;
console.log(`WebSocket message: type=${type}`, payload);
// Emit event with payload
if (type) {
this.emit(type, payload || {});