improve disconnect logs
This commit is contained in:
parent
3036b7d731
commit
95ad7392e6
1 changed files with 4 additions and 3 deletions
|
@ -37,7 +37,6 @@ const io = socketIO(server, {
|
||||||
res.writeHead(200, headers);
|
res.writeHead(200, headers);
|
||||||
res.end();
|
res.end();
|
||||||
},
|
},
|
||||||
perMessageDeflate: true,
|
|
||||||
maxHttpBufferSize: 5e6,
|
maxHttpBufferSize: 5e6,
|
||||||
pingTimeout: 10000
|
pingTimeout: 10000
|
||||||
});
|
});
|
||||||
|
@ -96,9 +95,11 @@ io.on('connection', socket => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on('disconnect', reason => {
|
socket.on('disconnect', (reason, details) => {
|
||||||
serverDebug(
|
serverDebug(
|
||||||
`${socket.id} was disconnected from url ${socket.conn.request.url} for the following reason: ${reason}`
|
`${socket.id} was disconnected from url ${socket.conn.request.url} for the following reason: ${reason}
|
||||||
|
${details?.message}
|
||||||
|
${details?.description}`
|
||||||
);
|
);
|
||||||
socket.removeAllListeners();
|
socket.removeAllListeners();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue