5

I need the IP Address/Machine Name/Mac Address of the Client in my web application for a particular usecase. Using request.getRemoteHost()/request.getRemoteAddr() I get the details of the Firewall for the Network instead of the actual client machine. I also tried accessing the request header - X-Forwarded-For, as suggested in many answers. But it is always returned as Empty. I do not have control over the Proxy Server/Firewall Server to configure it to add the header, as they are Customer controlled.

Is there any other API in Java or javascript to retrieve the original Client IP for the request.

Any help is greatly appreciated...

Leela Addagulla
  • 181
  • 1
  • 1
  • 10

2 Answers2

3

Even if you get real IP address (for example run signed Applet or trick ActiveObject) you cannot use it - it is behind firewall and you cannot access it.

Probably your need to uniquely identify computer/browser? There are some other approaches to do so. Cookies for start.

Marsha
  • 187
  • 1
  • 8
  • I would not be accessing the IP, As you said I only need to uniquely identify the client for my app. can you throw some more light on the cookies approach? – Leela Addagulla May 01 '15 at 16:44
  • http://www.w3schools.com/js/js_cookies.asp Just add something unique to your page – Marsha May 02 '15 at 01:39
1

Actually internal IP Address has no value. Every home network has computer with address 192.168.0.2. Will it help you to know this address?

See more detail explanation here.

Here is link to see the Mac Address

Community
  • 1
  • 1
Alex
  • 4,457
  • 2
  • 20
  • 59
  • I don't necessarily need an IP. I would prefer Mac Address if possible. Is there a way to get the Mac Address of the actual client machine behind firewall? – Leela Addagulla May 01 '15 at 16:48
  • http://stackoverflow.com/questions/10277440/getting-the-mac-address-of-a-client-with-a-browser – Alex May 01 '15 at 17:40