bot detector handling requests and disabling hit counter

This commit is contained in:
Klemek
2021-04-04 21:57:09 +02:00
parent 140e472e29
commit d69e10202c
3 changed files with 31 additions and 11 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ module.exports = (config, onConnect, onError) => {
const visitors = {};
const count = (req, path, cb) => {
if (!client.connected) {
const count = (req, path, disable, cb) => {
if (!client.connected || disable) {
cb();
} else {
const ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;