ws open debug

This commit is contained in:
jusax23 2023-03-08 17:07:08 +01:00
parent 44e2bf0da1
commit 7da2783b04
Signed by: jusax23
GPG key ID: 499E2AA870C1CD41
2 changed files with 8 additions and 2 deletions

View file

@ -12,7 +12,12 @@ export const activateWS = () => { activeWS = true; };
export const wsOnConnection = (socket: ws.WebSocket, req: http.IncomingMessage) => { export const wsOnConnection = (socket: ws.WebSocket, req: http.IncomingMessage) => {
let ip = req.socket.remoteAddress; 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); new wsClient(socket, req);
} }

View file

@ -22,7 +22,8 @@ const isFile = async (path: string) => {
} }
const loading = () => { const loading = () => {
var P = "⣾⣽⣻⢿⡿⣟⣯⣷"; //var P = "⣾⣽⣻⢿⡿⣟⣯⣷";
let P = "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏";
var x = 0; var x = 0;
let intID = setInterval(function () { let intID = setInterval(function () {
process.stdout.write("\r\x1b[1m" + P[(x++) % P.length]+" "); process.stdout.write("\r\x1b[1m" + P[(x++) % P.length]+" ");