How to determine the Host an Applet is loaded from

Where an applet is loaded from is determined as follows. If you have a codebase attribute in the applet tag and if the codebase contains a full url (i.e. including a host) then this host is where the applet is loaded from; otherwise the host is the same one as where the page containing the applet tag was loaded from. Note that any proxy servers that might have been used to make the connection to the final host that serves the applet are not considered in determining where the applet was loaded from - only the final host counts.

Here are some examples. Assuming these tags are embedded in a page that resides on www.page-server.org, then given:

<APPLET CODE="myclass.class" WIDTH=10 HEIGHT=10>
</APPLET>

myclass is loaded from www.page-server.org. Given

<APPLET CODEBASE="/home/goofy/jav"
        CODE="myclass.class" WIDTH=10 HEIGHT=10>
</APPLET>

again, myclass is loaded from www.page-server.org. However with

<APPLET CODEBASE="http://www.applet-server.org/home/goofy/jav"
        CODE="myclass.class" WIDTH=10 HEIGHT=10>
</APPLET>

myclass is loaded from www.applet-server.org.

[security]


Ronald Tschalär / 30. January 1998 / ronald@innovation.ch.