Getting socket ip on socket.io on heroku


I am using socket.io on heroku, and on socket connection I would like to get the client ip,currently I am getting an IP which is not the real IP (I think this is heroku's ip).

I am using socket.manager.handshaken[socket.id].address.address to get the user's ip.. do you have another way?

Try:

socket.manager.handshaken[socket.id].remoteAddress

If you need the client port then that would be: socket.manager.handshaken[socket.id].remotePort