mirror of
https://git.hmsn.ink/call/signal-server.git
synced 2026-03-20 00:02:16 +09:00
asdf
This commit is contained in:
@@ -10,6 +10,7 @@ const peers = new Map();
|
|||||||
wss.on('connection', (ws) => {
|
wss.on('connection', (ws) => {
|
||||||
const id = Math.random().toString(36).substring(2, 9);
|
const id = Math.random().toString(36).substring(2, 9);
|
||||||
peers.set(id, ws);
|
peers.set(id, ws);
|
||||||
|
console.log(`${id} connected!`);
|
||||||
ws.send(JSON.stringify({ type: 'your-id', id }));
|
ws.send(JSON.stringify({ type: 'your-id', id }));
|
||||||
|
|
||||||
ws.on('message', (data) => {
|
ws.on('message', (data) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user