So am trying to get the ip address of the visitors to my app on Haruko, am using an API for this, the API works well locally but when i deploy the app on Heroku, i get the IP of the Heroku server, it is an express.js app and am using this setting
app.set('trust proxy', true);
I have seen alot of solution to this problem but know works for me.
when i use
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
i get this result
clientIp: '::1',