diff --git a/app.js b/app.js index 8149592..98b8932 100644 --- a/app.js +++ b/app.js @@ -8,8 +8,17 @@ const instanceNumber = Math.floor(Math.random() * 101); const app = express(); app.get('/', (req, res) => { - var ip = req.headers['x-forwarded-for'] || req.ip; - res.send(`node-test instance ${instanceNumber}, your IP: ${ip}`); + var xFwdIp = req.headers['x-forwarded-for']; + var xRealIp = req.headers['x-real-ip']; + res.send( + { + instanceId: instanceNumber, + xForwardedFor: xFwdIp, + xRealIp: xRealIp, + requestIp: req.ip, + requestTime: Math.floor(Date.now() / 1000) + } + ); }); app.listen(PORT, HOST, () => {