Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 8 of 8

Thread: I need client IP address from Public IP server

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default I need client IP address from Public IP server

    Hi,

    I need help for how to get client ip address from Public ip server.

    for ex:

    String ipAddress = request.getHeader("X-FORWARDED-FOR");
    if(ipAddress == null)
    {
    ipAddress = request.getRemoteAddr();
    }

    I had use this code.This code is not working Public ip server.This code get only gate way ip only

    Plz give the solution for this.


  2. #2
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: I need client IP address from Public IP server

    As far as i know, you can not get directly, the Client's IP address.

  3. #3
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: I need client IP address from Public IP server

    I've moved this thread. Please read this before posting again: http://www.javaprogrammingforums.com...e-posting.html
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  4. #4
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: I need client IP address from Public IP server

    Quote Originally Posted by packiaraj View Post
    This code get only gate way ip only
    If the proxies are honest then X-Forwarded-For is as good as it gets. If they don't add that header - or falsify it - there's nothing you can do.

  5. #5
    Junior Member
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: I need client IP address from Public IP server

    is there any idea for how to get???

  6. #6
    Junior Member
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: I need client IP address from Public IP server

    can u send me any sample code ....

  7. #7
    Junior Member
    Join Date
    Feb 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: I need client IP address from Public IP server

    In oracle Forms i can get client ip from public ip set up

    Code

    Clientinfos.jar using this jar

    getIP= GET_CUSTOM_PROPERTY(BLOCK.BEAN,1,IP);


    But In java i cannot get ...

    Tell us any ide.....

  8. #8
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: I need client IP address from Public IP server

    Did you try studying about Clientinfos.jar?
    What classes it has? What does it support? What features can if combined, take you to the right direction?
    You need to go through the Clientinfos.jar in order to make your idea work.

Similar Threads

  1. [SOLVED] Server/client
    By lorider93p in forum Java Theory & Questions
    Replies: 1
    Last Post: February 8th, 2012, 01:36 PM
  2. server/client application fails when client closes
    By billykid in forum Java Networking
    Replies: 4
    Last Post: January 26th, 2012, 01:54 AM
  3. server and client
    By lanpan in forum What's Wrong With My Code?
    Replies: 2
    Last Post: December 24th, 2011, 09:29 AM
  4. Server <-> Client architecture.
    By daniel.j2ee in forum Java Networking
    Replies: 3
    Last Post: October 28th, 2011, 10:40 AM
  5. Client/Server
    By Dillz in forum Paid Java Projects
    Replies: 2
    Last Post: June 2nd, 2010, 05:19 AM