0

Possible Duplicate:
Getting the 'external' IP address in Java

i'm using JAVA for a write a simple messenger, but i need know the IP address of the machine where is running my program

Thanks.

Community
  • 1
  • 1
SebastianS
  • 79
  • 1
  • 15

1 Answers1

1

You can either parse a "what is my IP" website (like http://my-i-p.com/), which usually restrict the frequency you can get the IP.

Or, if you have your own web server, you can have the application contact a PHP page, for example, that prints the IP address on the page. Download that page to retrieve the IP address from the text.

Evan Mulawski
  • 54,662
  • 15
  • 117
  • 144