Express - req.ip returns 127.0.0.1
According to the express documentation:
When running an Express app behind a proxy, set (by using app.set()) the application variable trust proxy to one of the values listed in the following table.
You can set it to a boolean, ip address, number or a custom function. If you want to just get the client's proxy to your express app's req.ip, you can just set it to true.
app.set('trust proxy',true); app.get("/", (req, res)=>{ console.log(req.ip); });