Update socketcluster
This commit is contained in:
parent
e484258b3f
commit
4731265628
@ -17,11 +17,13 @@ module.exports.run = function(worker) {
|
|||||||
res.send('OK');
|
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') {
|
if (channel.substr(0, 3) === 'sc-' || channel === 'respond' || channel === 'log') {
|
||||||
scServer.exchange.publish(channel, data);
|
scServer.exchange.publish(channel, data);
|
||||||
} else if (channel === 'log-noid') {
|
} 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();
|
next();
|
||||||
});
|
});
|
||||||
|
@ -25,6 +25,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"express": "^4.13.3",
|
"express": "^4.13.3",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"socketcluster": "^3.0.0"
|
"socketcluster": "^4.3.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user