diff --git a/index.js b/index.js index 303ed86..50db9d7 100644 --- a/index.js +++ b/index.js @@ -15,6 +15,7 @@ io.on('connection', (socket) => { socket.on('name', (n) => { console.log(n); name = n; + socket.broadcast.emit('join', name); }); socket.on('text', (text) => { diff --git a/static/index.html b/static/index.html index 55eb850..8c95cf9 100644 --- a/static/index.html +++ b/static/index.html @@ -4,13 +4,16 @@