Hi,
I am calling application which is on remote machine.I want to retrieve IP of remote machine in my java application.Can anyone tell me how i will be able to retrieve IP of remote machine.
Hi,
Actually some other application is accessing my application through entering URL of my application in browser.I want to know IP of that machine who is accessing my application.
So there is a servlet running in your app, or something like it? HttpServletRequest has the getRemoteAddr method that tells you where the request originated.
Also, if you are talking about a web application, you always have to make sure that the web server, like Apache or Nginx, which often sits in front of your Java app....actually FORWARDS that IP to you. Hint: X-Real-IP