From 9884007a98e34f003c0dfe3a2e8ea6461066b6dd Mon Sep 17 00:00:00 2001 From: Evert Date: Tue, 27 Sep 2016 20:37:48 +0300 Subject: [PATCH] ipv6 bs --- teemant.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/teemant.js b/teemant.js index 8a20f6e..5163c15 100755 --- a/teemant.js +++ b/teemant.js @@ -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);