From 91e1d14e351260c834f2b852d4f14331eb1bb6c1 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Tue, 7 Jul 2015 16:25:58 +0200 Subject: [PATCH] Attempt of ip for socket --- lib/NodeLog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/NodeLog.js b/lib/NodeLog.js index 97c3dd2..2394215 100644 --- a/lib/NodeLog.js +++ b/lib/NodeLog.js @@ -44,7 +44,7 @@ Log.socket = {}; Log.socket.connection = function(socket) { log( '[SOK] ' + new Date() + ' ' + - socket.request.connection._peername.address + ' connection', + (socket.handshake.headers['x-forwarded-for'] || socket.handshake.address) + ' connection', Colors.MAGENTA ); }; @@ -52,7 +52,7 @@ Log.socket.connection = function(socket) { Log.socket.disconnect = function(socket) { log( '[SOK] ' + new Date() + ' ' + - socket.request.connection._peername.address + ' disconnect', + (socket.handshake.headers['x-forwarded-for'] || socket.handshake.address) + ' disconnect', Colors.MAGENTA ); };