Fixed json send bug
This commit is contained in:
parent
b5bd28fd45
commit
8eb35f4da3
@ -46,9 +46,10 @@ wss.on('connection', (ws) => {
|
|||||||
setInterval( () => {
|
setInterval( () => {
|
||||||
var data = {
|
var data = {
|
||||||
ctrl: 'idle',
|
ctrl: 'idle',
|
||||||
time: new Date().toTimeString()
|
date: new Date()
|
||||||
}
|
}
|
||||||
wss.clients.forEach( (client) => {
|
wss.clients.forEach( (client) => {
|
||||||
client.send( data );
|
// Send the msg object as a JSON-formatted string.
|
||||||
|
client.send( JSON.stringify( data ) );
|
||||||
});
|
});
|
||||||
}, 30000); // 30 s
|
}, 30000); // 30 s
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user