socket.io

socket 服务端程序

https://github.com/socketio/socket.io

Socket.IO enables real-time bidirectional event-based communication. It consists of:

1
2
3
4
5
io.on('connection', socket => {
  socket.emit('request', /* … */); // emit an event to the socket
  io.emit('broadcast', /* … */); // emit an event to all connected sockets
  socket.on('reply', () => { /* … */ }); // listen to the event
});