Socket Server
A library to ease user tracking over socket
Installation
npm install @copartit/socket_server
Usage
var app = require('express')();
var server = require('http').Server(app);
const PORT = process.env.PORT || 3000;
const SocketServer = require('../src/index.js');
SocketServer.setup(server);
server.listen(PORT, function () {
console.log(`Listening On *:${PORT}`);
});
Run Demo
For Single Instance Server: nodemon ./test/index.js
Open localhost:3000 to test features
For Multi Instance Server: pm2 start && pm2 monit
Open localhost over 3000, 3001, 3002, 3003 ports to test functionality over multiple servers
To Stop Multiple Instance Server: pm2 delete all