[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to detect the IP address of a web client ?

Posted on 2006-11-29
7
Medium Priority
?
1,151 Views
Last Modified: 2012-05-05

Hi you experts:

My Java web application needs to know the IP address of each client.
Is there any Java technology to do it ?

Thanks in advance.

Albert.
0
Comment
Question by:AlbertYou
5 Comments
 
LVL 16

Expert Comment

by:suprapto45
ID: 18042843
Hi Albert,

Yes, in your Servlet (or whatever technology you used), you can access the client's IP by request.getRemoteAddr();
0
 
LVL 2

Author Comment

by:AlbertYou
ID: 18042884

What if the client is connecting via a proxy server ?
Is there any way to get the real IP address of the web client instead of the proxy server ?

0
 
LVL 16

Accepted Solution

by:
suprapto45 earned 172 total points
ID: 18042896
>>"What if the client is connecting via a proxy server ?"
As far as my experiences tell me, request.getRemoteAddr(); is sufficient. If not, there is nothing else we can do. There may be a solution but I really do not have idea on that.

David
0
 
LVL 5

Assisted Solution

by:dasmaer
dasmaer earned 164 total points
ID: 18044478
Suprapto is right there, we can only find details supplied by the user browser and the connection to your app.  Google HTTP server variables and see what you can work with.
0
 

Assisted Solution

by:geoff2k
geoff2k earned 164 total points
ID: 18048832
Some proxy servers can be configured to forward the actual client IP address, but if we're talking about an internet application, I wouldn't count on it... you could always take a look at the headers you're getting at the server with request.getHeaderNames() and request.getHeader()
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
In the below post we have mentioned the best hosting type for startups. Also, check out some of the superlative web hosting companies that are proposing affordable web hosting solutions to host your startup website.
Integration Management Part 2
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question