Get the actual client IP address behind a firewall in Java

I need the name IP address / computer name / Mac address of the client in my web application for a specific account. Using request.getRemoteHost()/request.getRemoteAddr() , I get the firewall information for the network instead of the actual client machine. I also tried to access the request header - X-Forwarded-For , as suggested in many answers. But he always comes back as Empty. I have no control over the Proxy Server / Firewall Server to configure it to add a header, as they are controlled by the Client.

Is there any other API in Java or javascript to retrieve the source IP address of the client for the request.

Any help is much appreciated ...

+5
source share
2 answers

Even if you get a real IP address (for example, run a signed applet or trick ActiveObject), you will not be able to use it - it is located behind the firewall and you cannot access it.

Perhaps you need to uniquely identify your computer / browser? There are other approaches to this. Cookies for starters.

+3
source

In fact, the internal IP address does not matter. Each home network has a computer with the address 192.168.0.2. Would you like to know this address?

Read more about the explanation here .

Here is the link to see the Mac address

+1
source

All Articles