mirror of
https://github.com/jetkvm/cloud-api.git
synced 2025-09-16 08:38:15 +00:00
fix: 'ip' is possibly 'undefined'
This commit is contained in:
parent
771e1488d4
commit
ab2e65c144
@ -250,7 +250,7 @@ export const registerWebsocketServer = (server: any) => {
|
|||||||
process.env.REAL_IP_HEADER && req.headers[process.env.REAL_IP_HEADER]
|
process.env.REAL_IP_HEADER && req.headers[process.env.REAL_IP_HEADER]
|
||||||
) || req.socket.remoteAddress;
|
) || req.socket.remoteAddress;
|
||||||
|
|
||||||
activeConnections.set(id, [ws, ip.toString()]);
|
activeConnections.set(id, [ws, `${ip}`]);
|
||||||
console.log("New socket for id", id);
|
console.log("New socket for id", id);
|
||||||
|
|
||||||
ws.on("error", async () => {
|
ws.on("error", async () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user