Spaces:
Running
Running
Download utils.js from rtrm/video-sync-backend: direct link, hf CLI and curl.
- Browser
- Download file 253 Bytes
-
https://huggingface.co/spaces/rtrm/video-sync-backend/resolve/main/utils.js
- Command line
-
hf download hf://spaces/rtrm/video-sync-backend/utils.js
-
curl -L -o utils.js https://huggingface.co/spaces/rtrm/video-sync-backend/resolve/main/utils.js
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 }; | |