diff --git a/components/_http.js b/components/_http.js index db92a1e..8190592 100644 --- a/components/_http.js +++ b/components/_http.js @@ -235,6 +235,17 @@ module.exports = class HTTPServer extends Component { }); }); + this.app.use((req, res, next) => { + req.realip = req.ip; + if (req.headers["cf-connecting-ip"]) + req.realip = req.headers["cf-connecting-ip"]; + + req.st403 = "

403: Permission denied


Permission denied.

"; + req.st404 = "

404: Page not finded


Please, recheck the URL address and try again.

"; + req.st500 = "500: Internal Server Error

Error:


Error catched. Check logs

"; + next(); + }); + this.app.use((req, res, next) => { const currentDomain = req.hostname; const isNotDomained = !this.syntax.domains[currentDomain]; @@ -246,13 +257,6 @@ module.exports = class HTTPServer extends Component { authPage(this, req, res, next) }); - this.app.use((req, res, next) => { - req.st403 = "

403: Permission denied


Permission denied.

"; - req.st404 = "

404: Page not finded


Please, recheck the URL address and try again.

"; - req.st500 = "500: Internal Server Error

Error:


Error catched. Check logs

"; - next(); - }); - this.app.use(cookieParser()); this.routelist.forEach(route => {