ExpressJsWebSockets with Express

Integrate WebSockets into your Express app to build real-time features like chat applications or live notifications.

const http = require('http');
const socketIo = require('socket.io');

const server = http.createServer(app);
const io = socketIo(server);

io.on('connection', socket => {
  console.log('User connected');
  socket.on('message', msg => io.emit('message', msg));
});