From 95ad7392e622e058ee271fc55e89b04cf7fb4cd8 Mon Sep 17 00:00:00 2001 From: Mihaela Dumitru Date: Tue, 14 Feb 2023 15:49:10 +0200 Subject: [PATCH] improve disconnect logs --- src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 59f4cb6..76f28a9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -37,7 +37,6 @@ const io = socketIO(server, { res.writeHead(200, headers); res.end(); }, - perMessageDeflate: true, maxHttpBufferSize: 5e6, pingTimeout: 10000 }); @@ -96,9 +95,11 @@ io.on('connection', socket => { } }); - socket.on('disconnect', reason => { + socket.on('disconnect', (reason, details) => { 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(); });