require express

This commit is contained in:
Hri7566 2022-05-28 22:41:58 -04:00
parent 04defb8008
commit 50d8c8d5fd
4 changed files with 1651 additions and 2 deletions

View File

View File

@ -26,6 +26,7 @@
"chalk": "^4.1.1", "chalk": "^4.1.1",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
"events": "^3.1.0", "events": "^3.1.0",
"express": "^4.18.1",
"fancy-text-converter": "^1.0.9", "fancy-text-converter": "^1.0.9",
"keccak": "^2.1.0", "keccak": "^2.1.0",
"level": "^7.0.0", "level": "^7.0.0",

View File

@ -5,6 +5,7 @@ const http = require("http");
const fs = require('fs'); const fs = require('fs');
const RoomSettings = require('./RoomSettings'); const RoomSettings = require('./RoomSettings');
const Logger = require("./Logger.js"); const Logger = require("./Logger.js");
const express = require('express');
class Server extends EventEmitter { class Server extends EventEmitter {
constructor(config) { constructor(config) {
@ -24,7 +25,8 @@ class Server extends EventEmitter {
server: this.https_server, server: this.https_server,
backlog: 100, backlog: 100,
verifyClient: (info) => { verifyClient: (info) => {
if (banned.includes((info.req.connection.remoteAddress).replace("::ffff:", ""))) return false; const ip = (info.req.connection.remoteAddress).replace("::ffff:", "");
if (banned.includes(ip)) return false;
return true; return true;
} }
}); });
@ -35,7 +37,8 @@ class Server extends EventEmitter {
port: config.port, port: config.port,
backlog: 100, backlog: 100,
verifyClient: (info) => { verifyClient: (info) => {
if (banned.includes((info.req.connection.remoteAddress).replace("::ffff:", ""))) return false; const ip = (info.req.connection.remoteAddress).replace("::ffff:", "");
if (ip) return false;
return true; return true;
} }
}); });

1645
yarn.lock Normal file

File diff suppressed because it is too large Load Diff