Wednesday 26 August 2020

How to get the user IP in express?

I have been trying to identify users based on IP addresses and this is what I am getting from request object :{"x-forwared-for": "10.110.0.5","remoteAddress": "::ffff:10.244.0.160","x-real-ip": "10.110.0.5","ip": "::ffff:10.244.0.160","headers": {"connection": "close","host": "www.footballexclusive.live","x-real-ip": "10.110.0.5","x-forwarded-for": "10.110.0.5","x-forwarded-host": "www.footballexclusive.live","x-forwarded-port": "80","x-forwarded-proto": "http","cache-control": "max-age=0","upgrade-insecure-requests": "1","user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36","accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","accept-encoding": "gzip, deflate","accept-language": "en-US,en;q=0.9,hi;q=0.8","if-none-match": "W/\"317-eb2ITwrZT5q7/tpqrnFedtccXnA\""}}​The IP I am getting is 10.110.0.5 and this does not match with whatsmyip and I have tried it on three different devices and getting the same IP. How do I get actual user IP?

Submitted August 26, 2020 at 08:41AM by GhostFoxGod

No comments:

Post a Comment