I understand how to do this with the loaclhost but confused on how to do this with determine the clients ip, any help would be great.
Thanks
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.
I understand how to do this with the loaclhost but confused on how to do this with determine the clients ip, any help would be great.
Thanks
getRemoteAddr() of HTTPSERVLET.
This will give you the IP of the client but one thing, if client is using proxy, it may not give you the exact IP but the proxy that is being used by client.
If you want to get the exact IP of client, you'll have to use the header, this header is custom header for request and you should use it like,
I hope this will solve your problem.HTTPREQUEST req; req.getHeader("X-FORWARDED-FOR");
Last edited by Mr.777; April 4th, 2011 at 07:26 AM.