aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes How to get visitors IP address in Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "How to get visitors IP address in Java?" Watch "How to get visitors IP address in Java?" New topic
Author

How to get visitors IP address in Java?

Vicky Thakor
Greenhorn

Joined: Sep 04, 2010
Posts: 19
I searched whole google, tried tons of codes but can't find answer how to get visitors ip address...




You can check out on my website... it shows 127.0.0.1

http://www.0signals.com/test/
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Try this: http://en.wikipedia.org/wiki/X-Forwarded-For
Vicky Thakor
Greenhorn

Joined: Sep 04, 2010
Posts: 19


This will give you IP address of visitor you can read thie article

How to get visitors IP address in Java?
http://www.javaquery.com/2011/12/how-to-get-visitors-ip-address-in-java.html
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Not sure what you're asking; can you rephrase the question with more detail? Are you saying the x-forwarded-for header doesn't contain the IP address? If so, talk to your system admin for where else you might look for it. It's also possible that header hasn't been set up.
Vicky Thakor
Greenhorn

Joined: Sep 04, 2010
Posts: 19
Tim i got the solution and thank you.....I pasted code here so other who visit this thread can find the solution...
 
 
subject: How to get visitors IP address in Java?