Results 1 to 7 of 7
  1. #1
    shinjan is offline Member
    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0

    Default Getting client IP address

    I need to track client IP address using jsp inside a private LAN. The client is behind a proxy server. So
    request.getRemoteAddr()
    gives me the proxy address. If I put the proxy settings of the client browser to 'automatic proxy', then I can get the real IP address of the client but not otherwise.
    Is there any way to get the client IP address with manual proxy configuration settings on?

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    depending on the proxy it might set some kind of HTTP header to indicate the address that it is proxying for, like the original address or something.

    but generally to get the client's address without http headers or the server side logs, we would need something to run on the client's machine, such as a java or flash applet, but even then this would most likely be the internal LAN IP address of the system, such as behind the local router they are using, and would not show their internet side address anyway,

  3. #3
    shinjan is offline Member
    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0

    Default

    I tried with some http headers but they gave me null...how to know which http header the proxy is using?
    What do I need to run on the client side?
    i need to know the client's private IP address...

  4. #4
    shinjan is offline Member
    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0

    Default

    I tried with many http headers....but they are all giving me null...specify which header should i use..

  5. #5
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    Well, it is also possible the proxy that is being used does not generate extra headers, or is not set up to inject the headers. My past experience with this we were using squid cache http proxy. they support a feature to allow an "X-Forwarded-For" http header to be set,
    when enabled with their configuration setting, squid would add this to the headers it requests to the real service it is acting as a proxy for. For some reason, it was viewed this feature is off by default in squid configuration.

    See also: SquidFaq/ConfiguringSquid - Squid Web Proxy Wiki

    So in that sense, if your proxy is not configured to already set this header for you, then its probably not something we could have changed.

    another idea, what about using HTTPS, where in theory that could not be proxied and the server would then see the remote client IP address. ?

  6. #6
    shinjan is offline Member
    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0

    Default

    @travishein
    I understand what you are saying...I think you have pointed out the reason correctly...I will ask my system administrator about it...
    in the mean time what is https and how can it be used/implemented?
    Last edited by shinjan; 12-19-2009 at 02:07 PM.

  7. #7
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    you know, like in a web browser, the SSL mode HTTPS, when the web server uses SSL certificates. TCP port 443, and so on.

    It used to be that HTTP proxies would not be able to proxy content for HTTPS (or any SSL - secure encrypted communication channel), because doing so would alter the message signature in a manner that would break the direct point-to-point encrypted channel. It is likely possible to proxy HTTPS traffice in some manner, but typically, an office / site HTTP proxy server would be set to pass through HTTPS data without proxying it, and thus without mangling the source IP address.

    But in later thinking of this, if you were inside an office LAN network segment, the gateway firewall would still NAT IP address translate the packets, and to the remote server, it would appear as though you came from the IP address that your office faces the internet with. But if the HTTP proxy is somewhere between your office and the target server, then this might allow the communications from your office to route to the server without going throught this proxy.

    This also assumes it is possible, and OK to make the server run HTTPS, and that your client is possible and OK to use HTTPS, and that the gateway end point in your office will allow HTTPS to pass through it.

Similar Threads

  1. Client IP Address
    By goodjonx in forum Networking
    Replies: 3
    Last Post: 09-23-2009, 11:27 AM
  2. Replies: 1
    Last Post: 10-05-2008, 04:12 PM
  3. How to get IP Address of the client
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-05-2008, 11:14 AM
  4. JSP getting IP address
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-29-2008, 10:05 AM
  5. Identify Client in Socket Client Server Application
    By masadjie in forum Networking
    Replies: 1
    Last Post: 12-20-2007, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •