const io = require('socket.io')(3555); const nsp = io.of('/randomFree'); class randomFree { constructor() { nsp.on('connection', (socket) => { console.log('someone connected'); this.match(); }); } match() { let clients = Object.keys(nsp.sockets); console.log(clients); if(clients.length > 1) { } } join(user){ //join randomFree queue room } } module.exports = new randomFree();