Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to detect the IP address of a web client ?

Posted on 2006-11-29
7
Medium Priority
?
1,146 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
This week I attended a Startup Week Chattanooga talk on Gender Diversity in Technology. Check out what I learned.
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…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

618 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