|
|
@ -1531,9 +1531,11 @@ var getActiveSessions = function (Env, ctx, cb) {
|
|
|
|
Object.keys(ctx.users).forEach(function (u) {
|
|
|
|
Object.keys(ctx.users).forEach(function (u) {
|
|
|
|
var user = ctx.users[u];
|
|
|
|
var user = ctx.users[u];
|
|
|
|
var socket = user.socket;
|
|
|
|
var socket = user.socket;
|
|
|
|
var conn = socket.upgradeReq.connection;
|
|
|
|
var req = socket.upgradeReq;
|
|
|
|
if (ips.indexOf(conn.remoteAddress) === -1) {
|
|
|
|
var conn = req && req.connection;
|
|
|
|
ips.push(conn.remoteAddress);
|
|
|
|
var ip = (req && req.headers && req.headers['x-forwarded-for']) || (conn && conn.remoteAddress);
|
|
|
|
|
|
|
|
if (ip && ips.indexOf(ip) === -1) {
|
|
|
|
|
|
|
|
ips.push(ip);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|