forked from Hri7566/mpp-server-dev2
Merge branch 'master' of gitlab.com:Hri7566/mpp-server
This commit is contained in:
commit
14ff6a54f9
|
@ -0,0 +1,3 @@
|
|||
[submodule "mpp.hri7566.info"]
|
||||
path = mpp.hri7566.info
|
||||
url = git@gitlab.com:Hri7566/mpp.hri7566.info.git
|
|
@ -13,6 +13,7 @@ module.exports = Object.seal({
|
|||
defaultUsername: "Anonymous",
|
||||
adminpass: process.env.ADMINPASS,
|
||||
ssl: process.env.SSL,
|
||||
serveFiles: true,
|
||||
defaultRoomSettings: {
|
||||
// color: "#3b5054",
|
||||
// color2: "#001014",
|
||||
|
|
|
@ -12,11 +12,13 @@ var logger = new Logger("Database");
|
|||
|
||||
mongoose.connect(process.env.MONGO_URL, {
|
||||
useNewUrlParser: true,
|
||||
useUnifiedTopology: true
|
||||
useUnifiedTopology: true,
|
||||
connectTimeoutMS: 1000
|
||||
}, err => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
return;
|
||||
logger.error("Unable to connect to database service");
|
||||
process.exit(1);
|
||||
}
|
||||
logger.log("Connected");
|
||||
});
|
||||
|
|
|
@ -25,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;
|
||||
}
|
||||
});
|
||||
|
@ -36,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