This commit is contained in:
2025-09-19 21:40:12 +09:00
parent 24d86365a2
commit 31197bcd1b

View File

@@ -10,6 +10,7 @@ const peers = new Map();
wss.on('connection', (ws) => {
const id = Math.random().toString(36).substring(2, 9);
peers.set(id, ws);
console.log(`${id} connected!`);
ws.send(JSON.stringify({ type: 'your-id', id }));
ws.on('message', (data) => {