Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Get Host IP using applet

  Asked By: Mada    Date: Nov 30    Category: Java    Views: 1596
  

With my limited understanding of java security, you simply can not
get the IP address of your own computer if using applet? instead you
must use java application.

However there is an example of this working just below:

http://reglos.de/myaddress/demo1.html

I would love to find out what makes it tick.

yet I dont quite see how it can be done.

I have tried this, but only get the loop back addr.

public class GetClientIP extends Applet {
public void init() {
try {
InetAddress thisIp =
InetAddress.getLocalHost();
System.out.println("IP:"+thisIp.getHostAddress());
}
catch(Exception e) {
e.printStackTrace();
}
}
}

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Get Host IP using applet Or get search suggestion and latest updates.




Tagged: