?
Solved

How to detect the IP address of a web client ?

Posted on 2006-11-29
7
Medium Priority
?
1,140 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
The top devops trends for 2017 are focused on improved deployment frequency, decreased lead time for change and decreased MTTR.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 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