prepare for osc input

This commit is contained in:
2023-12-04 16:28:07 +01:00
parent 04a4f28f68
commit cc963ac54f
9 changed files with 99 additions and 19 deletions

View File

@ -15,6 +15,18 @@ console.log("Listening to: ws://localhost:3000. Open Topos.\n");
// Listening to WebSocket messages
const wss = new WebSocket.Server({ port: 3000 });
// Sending WebSocket messages
const inputWss = new WebSocket.Server({ port: 3001 });
inputWss.on("connection", function (ws) {
inputWss.clients.forEach(function each(client) {
// Send message to all clients except sender
if (client !== ws && client.readyState === WebSocket.OPEN) {
client.send("New client connected");
}
})
});
// Setting up for message broadcasting
wss.on("connection", function (ws) {
console.log("> Client connected");