Get client Ip via socket is not working

Hi

I m currently doing some tests with my code, but I can’t figure out to get the current client IP. I’m trying to use req.socket.remoteAddr but when deploying I get an undefined remoteAddr.
Of course I don’t have this issue locally but only when deploying.
Is there an easy way to fix it?
(btw ive also test with req.connection.remoteAddr but got the same issue)

Thank you

Acc. to Request | Edgio Documentation, you can use req.headers[‘x-0-client-ip’]

ahh thanks a lot @rishi-raj-jain I didnt check properly the documentation :blush:

1 Like