aspose file tools
The moose likes Portals and Portlets and the fly likes How to Obtain Remote IP Address Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Reply Bookmark "How to Obtain Remote IP Address" Watch "How to Obtain Remote IP Address" New topic
Author

How to Obtain Remote IP Address

Abiodun Okusolubo
Ranch Hand

Joined: Apr 25, 2004
Posts: 72
Hello Fellow Ranchers,
I need a workaround for a problem that I know it's not possible. Which is how to obtain IP Address from a client when they log into a portal. Any idea will be welcome.

Thanks


SCJP, SCWCD, SCJD : in the making.
abhishek jethwani
Greenhorn

Joined: Aug 11, 2006
Posts: 14
i don't know in which case you are asking this.

but if its a java application with socket programming then i think you can keep track of the ip from which the client is connecting.

but if it is done with RMI then you can't get the ip as client connect through stub which connected through name - "connecting name which we define" during binding server with rmi registry.
Abiodun Okusolubo
Ranch Hand

Joined: Apr 25, 2004
Posts: 72
Portal Application using Jetspeed 2
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4422
    
    2

It is extremely hard to get the client's IP address in a reliable manner.
Most of the 'net these days uses NAT to do address mapping, and many more folks use proxies.

If you want the address for logging, it can have a little value, and its easy. But if you need to actually know the real IP address, its very hard and often impossible to get it.

You can do things like run an bit of code on the client to get the IP address, but that is only what the client computer thinks is the address, when they use NAT, it may be not even close to real.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to Obtain Remote IP Address
 
Similar Threads
Way to get IP address through Java?
client IP address
get client's IP adress without servlets or jsp?
Tracking Remote Public IP address
How to obtain the destination machine information