diff --git a/bin/worker.js b/bin/worker.js index 3461f30..0ab7cca 100644 --- a/bin/worker.js +++ b/bin/worker.js @@ -17,11 +17,13 @@ module.exports.run = function(worker) { res.send('OK'); }); - scServer.addMiddleware(scServer.MIDDLEWARE_EMIT, function (socket, channel, data, next) { + scServer.addMiddleware(scServer.MIDDLEWARE_EMIT, function (req, next) { + var channel = req.event; + var data = req.data; if (channel.substr(0, 3) === 'sc-' || channel === 'respond' || channel === 'log') { scServer.exchange.publish(channel, data); } else if (channel === 'log-noid') { - scServer.exchange.publish('log', { id: socket.id, data: data }); + scServer.exchange.publish('log', { id: req.socket.id, data: data }); } next(); }); diff --git a/package.json b/package.json index e507fb6..02ab439 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,6 @@ "dependencies": { "express": "^4.13.3", "minimist": "^1.2.0", - "socketcluster": "^3.0.0" + "socketcluster": "^4.3.1" } }