ws open debug
This commit is contained in:
parent
44e2bf0da1
commit
7da2783b04
2 changed files with 8 additions and 2 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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]+" ");
|
||||||
|
|
Loading…
Reference in a new issue