video-sync-backend / utils.js
rtrm's picture
rtrm HF Staff
fix: flatten server files and fix Dockerfile paths
4e06ea7 unverified
raw
history blame contribute delete
253 Bytes
function send(ws, msg) {
if (ws.readyState === ws.OPEN) ws.send(JSON.stringify(msg));
}
function broadcast(room, msg, exclude) {
for (const p of room.participants) {
if (p !== exclude) send(p, msg);
}
}
module.exports = { send, broadcast };