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 ); };