forked from Hri7566/mpp-server-dev2
require express
This commit is contained in:
parent
04defb8008
commit
50d8c8d5fd
|
@ -26,6 +26,7 @@
|
|||
"chalk": "^4.1.1",
|
||||
"dotenv": "^8.2.0",
|
||||
"events": "^3.1.0",
|
||||
"express": "^4.18.1",
|
||||
"fancy-text-converter": "^1.0.9",
|
||||
"keccak": "^2.1.0",
|
||||
"level": "^7.0.0",
|
||||
|
|
|
@ -5,6 +5,7 @@ const http = require("http");
|
|||
const fs = require('fs');
|
||||
const RoomSettings = require('./RoomSettings');
|
||||
const Logger = require("./Logger.js");
|
||||
const express = require('express');
|
||||
|
||||
class Server extends EventEmitter {
|
||||
constructor(config) {
|
||||
|
@ -24,7 +25,8 @@ class Server extends EventEmitter {
|
|||
server: this.https_server,
|
||||
backlog: 100,
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
@ -35,7 +37,8 @@ class Server extends EventEmitter {
|
|||
port: config.port,
|
||||
backlog: 100,
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue