get real ip
This commit is contained in:
@@ -48,7 +48,7 @@ app.use(express.urlencoded({ extended: true }));
|
||||
// Request logging
|
||||
app.use((req, res, next) => {
|
||||
logger.info(`${req.method} ${req.path}`, {
|
||||
ip: req.ip,
|
||||
ip: (req.headers['x-forwarded-for'] as string) || req.socket.remoteAddress,
|
||||
userAgent: req.get('User-Agent')
|
||||
});
|
||||
next();
|
||||
|
||||
Reference in New Issue
Block a user