Added ip to connection log

This commit is contained in:
Artyom Abubakirov 2018-08-07 18:51:19 +05:00
parent 2bdeaa7960
commit 5bd8edc5b5

View File

@ -131,7 +131,8 @@ function rejectPeerResponse(peerType, reason) {
* Socket pipeline * Socket pipeline
*/ */
io.on('connection', function(socket) { 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) { socket.on('error', function(error) {
console.error('Connection ' + socket.id + ' error', error); console.error('Connection ' + socket.id + ' error', error);