Java Security FAQ: Send data to a 3rd host


Here's an applet that tries to send a datagram packet to www.sun.com. To do that, it first tries to get the InetAddress (the Java object for the IP address) for www.sun.com.

Here's the source.

Conclusion:

Applets can't get the IP address of hosts on the network they are running on. And even if they somehow knew ahead of time the IP address of a host on the network, they can't send use network connections to send data to any host other than to the host they came from.


Back to the Java Security FAQ