服务器端 ~~~ var io = require('socket.io')(80); io.on('connection', function (socket) { socket.broadcast.emit('user connected'); }); ~~~