diff --git a/config/development.json b/config/development.json index 47fb33db..0c79b8e3 100644 --- a/config/development.json +++ b/config/development.json @@ -1,6 +1,5 @@ { "isDev": true, - "logLevel": 3, "server": { "port": 8888, "/* secure */": "/* whether this connects via https */", diff --git a/config/production.json b/config/production.json index 82b3ee44..69c9e4be 100644 --- a/config/production.json +++ b/config/production.json @@ -1,6 +1,5 @@ { "isDev": false, - "logLevel": 3, "server": { "port": 8888, "/* secure */": "/* whether this connects via https */", diff --git a/package.json b/package.json index 6bb3f600..fa994920 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "dependencies": { "getconfig": "2.1.0", "node-uuid": "1.2.0", - "socket.io": "^1.3.7", + "socket.io": "1.3.7", "yetify": "0.0.1" }, "main": "server.js", @@ -14,7 +14,7 @@ "url": "git@github.com:andyet/signal-master.git" }, "devDependencies": { - "socket.io-client": "0.9.16", + "socket.io-client": "1.4.5", "precommit-hook": "0.3.10", "tape": "^2.13.1" }, diff --git a/sockets.js b/sockets.js index 41a1c221..e12dc188 100644 --- a/sockets.js +++ b/sockets.js @@ -5,11 +5,6 @@ var socketIO = require('socket.io'), module.exports = function (server, config) { var io = socketIO.listen(server); - if (config.logLevel) { - // https://github.com/Automattic/socket.io/wiki/Configuring-Socket.IO - io.set('log level', config.logLevel); - } - io.sockets.on('connection', function (client) { client.resources = { screen: false, @@ -142,7 +137,11 @@ module.exports = function (server, config) { } function clientsInRoom(name) { - return io.sockets.clients(name).length; + var clientsCount = 0; + for (var socketId in io.nsps['/'].adapter.rooms[name] || {}) { + clientsCount++; + } + return clientsCount; } };