1
2
3
4
5
6
7
8
9
const app = require("express")();

app.set('trust proxy', true);

app.get("/", (req, res, next) => {
    res.end(req.ip);
});

app.listen(3000);
node v9.7.1 linux/amd64