From ab2e65c1440778824c10cc55006f7f9e2c6ab740 Mon Sep 17 00:00:00 2001 From: Siyuan Miao Date: Tue, 11 Feb 2025 13:51:51 +0100 Subject: [PATCH] fix: 'ip' is possibly 'undefined' --- src/webrtc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webrtc.ts b/src/webrtc.ts index 361319c..fd3d9aa 100644 --- a/src/webrtc.ts +++ b/src/webrtc.ts @@ -250,7 +250,7 @@ export const registerWebsocketServer = (server: any) => { process.env.REAL_IP_HEADER && req.headers[process.env.REAL_IP_HEADER] ) || req.socket.remoteAddress; - activeConnections.set(id, [ws, ip.toString()]); + activeConnections.set(id, [ws, `${ip}`]); console.log("New socket for id", id); ws.on("error", async () => {