milingo
6/15/2017 - 2:47 PM

sockets_server.js

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

const server = http.createServer(function (req, res) {
...  
});

const io = SocketIO(server);
io.on('connection', (socket) => {
  socket.emit('tic', { seconds: 0 });
  socket.on('tac', (data) => console.log(data));
});
  
server.listen(3000);