Solved

How to detect the IP address of a web client ?

Posted on 2006-11-29
7
1,137 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 43 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 41 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 41 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

Technology Partners: 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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Popular third-party chat platforms like Slack, Discord, and Telegram are just a few of the many new productivity applications that are being hijacked by cybercriminals to create command-and-control (C&C) communications infrastructures for their malw…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 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