websocket.io

This commit is contained in:
2025-06-06 16:43:11 +02:00
parent 41717509f8
commit 82f4868f78
+2 -1
View File
@@ -117,8 +117,9 @@ audio.addEventListener('ended', () => {
}
});
// server WebSocket
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 3000 }); // Tu peux choisir un autre port si besoin
const wss = new WebSocket.Server({ port: 3000 });
wss.on('connection', function connection(ws) {
console.log('🟢 Un client WebSocket est connecté');