Compare commits
No commits in common. "main" and "v0.0.2" have entirely different histories.
13
app.js
13
app.js
@ -8,17 +8,8 @@ const instanceNumber = Math.floor(Math.random() * 101);
|
|||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
app.get('/', (req, res) => {
|
app.get('/', (req, res) => {
|
||||||
var xFwdIp = req.headers['x-forwarded-for'];
|
var ip = req.headers['x-forwarded-for'] || req.ip;
|
||||||
var xRealIp = req.headers['x-real-ip'];
|
res.send(`node-test instance ${instanceNumber}, your IP: ${ip}`);
|
||||||
res.send(
|
|
||||||
{
|
|
||||||
instanceId: instanceNumber,
|
|
||||||
xForwardedFor: xFwdIp,
|
|
||||||
xRealIp: xRealIp,
|
|
||||||
requestIp: req.ip,
|
|
||||||
requestTime: Math.floor(Date.now() / 1000)
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(PORT, HOST, () => {
|
app.listen(PORT, HOST, () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user