Implement websocket notifications for center status, mode and few other changes
This commit is contained in:
@@ -3,10 +3,18 @@ const WebSocket = require('ws');
|
||||
const WS_SERVER_PORT = process.env.WS_SERVER_PORT || 8191;
|
||||
|
||||
const ws = new WebSocket(`ws://localhost:${WS_SERVER_PORT}`);
|
||||
const ws2 = new WebSocket(`ws://localhost:${WS_SERVER_PORT}`);
|
||||
ws.on('open', () => {
|
||||
console.log('WebSocket connection established');
|
||||
ws.send(0);
|
||||
ws.send("client:0");
|
||||
});
|
||||
ws.on('message', (data) => {
|
||||
console.log(String(data));
|
||||
});
|
||||
ws2.on('open', () => {
|
||||
console.log('WebSocket connection established');
|
||||
ws.send("center:0");
|
||||
});
|
||||
ws2.on('message', (data) => {
|
||||
console.log(String(data));
|
||||
});
|
Reference in New Issue
Block a user