Fix socket.io not working properly in single-host clusters. (#6669)

This is because we don't use the cluster module, so the master nodejs process doesn't know about any of the clients through the socket API.
This commit is contained in:
Ben Lubar
2018-07-25 10:04:18 -05:00
committed by Barış Soner Uşaklı
parent e534bf803e
commit 44373afc52
3 changed files with 64 additions and 5 deletions

View File

@@ -28,7 +28,9 @@ Sockets.init = function (server) {
});
if (nconf.get('singleHostCluster')) {
io.adapter(require('socket.io-adapter-cluster')());
io.adapter(require('socket.io-adapter-cluster')({
client: require('./single-host-cluster'),
}));
} else if (nconf.get('redis')) {
io.adapter(require('../database/redis').socketAdapter());
} else {