This commit is contained in:
Evert Prants 2016-09-27 20:37:48 +03:00
parent 8a9fb95c06
commit 9884007a98
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ io.sockets.on('connection', function (socket) {
let userip = socket.handshake.headers['x-real-ip'] || socket.handshake.headers['x-forwarded-for'] ||
socket.request.connection._peername.address || "127.0.0.1";
if(userip.indexOf('::ffff:') == 0)
userip = userip.substring(7);
if(config.server.debug)
console.log('clientID: '+socket.id+' from: ', userip);