I have an node.js server application that needs to know the requested ip address in order to do some operation. The problem is that, when the user use /etc/hosts to register an Ip alias to access my server, the req.headers information on the server side shows the ip alias and not the ip requested.
I am using restify to serve my application, I already tried the req.connection but it is still no good.
I need that the javascript from my website knows what is actually the ip alias's ip address (pre-registered in the /etc/hosts) or that my node.js(restify) interprets the real ip_address requested and not the ip alias that the client uses.
Edit1: The main problem on getting the ip address requested on de server (nodejs) is that the requested for this cases is the ALIAS registered on the /etc/hosts. So it arrives at the server as just the named alias and not the ip (my server listens on multiple different IPs)