From 7da2783b0402c2d076164e761178e59d95c612bd Mon Sep 17 00:00:00 2001 From: jusax23 Date: Wed, 8 Mar 2023 17:07:08 +0100 Subject: [PATCH] ws open debug --- src/api/ws.ts | 7 ++++++- src/setup/config.ts | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/api/ws.ts b/src/api/ws.ts index 61fd9d7..3f04630 100644 --- a/src/api/ws.ts +++ b/src/api/ws.ts @@ -12,7 +12,12 @@ export const activateWS = () => { activeWS = true; }; export const wsOnConnection = (socket: ws.WebSocket, req: http.IncomingMessage) => { let ip = req.socket.remoteAddress; - if (!activeWS || bruteforcecheck(ip ?? "")) return void socket.close(); + if (!activeWS || bruteforcecheck(ip ?? "")) { + debug("WebSocket", "Rejected ip for bruteforce suspicion:", ip); + socket.close(); + return; + } + debug("WebSocket", "Opend new WebSocket from ip:", ip); new wsClient(socket, req); } diff --git a/src/setup/config.ts b/src/setup/config.ts index ea81b95..41deb4a 100644 --- a/src/setup/config.ts +++ b/src/setup/config.ts @@ -22,7 +22,8 @@ const isFile = async (path: string) => { } const loading = () => { - var P = "⣾⣽⣻⢿⡿⣟⣯⣷"; + //var P = "⣾⣽⣻⢿⡿⣟⣯⣷"; + let P = "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏"; var x = 0; let intID = setInterval(function () { process.stdout.write("\r\x1b[1m" + P[(x++) % P.length]+" ");