From 5bd8edc5b526d5695906baceab47356a29327beb Mon Sep 17 00:00:00 2001 From: Artyom Abubakirov Date: Tue, 7 Aug 2018 18:51:19 +0500 Subject: [PATCH] Added ip to connection log --- server.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index 8e5a05a..30e9753 100755 --- a/server.js +++ b/server.js @@ -131,7 +131,8 @@ function rejectPeerResponse(peerType, reason) { * Socket pipeline */ io.on('connection', function(socket) { - console.log('Connection received with sessionId - ' + socket.id); + let sHeaders = socket.handshake.headers; + console.log('Connection received with sessionId - ' + socket.id + ' and ip - ' + sHeaders['x-forwarded-for']); socket.on('error', function(error) { console.error('Connection ' + socket.id + ' error', error);