Cannot access localhost in IE5.5
Hi all,
I have a problem using IE 5.5:
I wrote an applet that tries to connect to port 1123 in my localhost.
There is a 'server' application that is listening in port 1123 of the same machine (localhost).
If I open the applet from netscape or appletviewer, the connection is ok and it works, but if I try to open the appletviewer from IExplorer 5.5, I have a message: "Cannot access localhost", even if I put
the IP address (127.0.0.1) instead of name 'localhost'.
Can someone help me?
Thanks in advance.
Pedro
[579 byte] By [
pverdugo] at [2007-9-26 4:29:38]

Hi, thanks for your fast answer.
I rewrote the applet, but the method getCodeBase().GetHost returned me a null string.
But if I try to get the host name with:
InetAddress ia=InetAddress.getLocalHost();
sHost=ia.getHostName();
I get that sHost = "localhost". And this is the real name of my machine. So I don't understand why I cannot execute this applet with IE 5.5. Maybe it's a security problem with IE.
I really don't know what source I must use to solve this problem.
Anyway, lots of thanks for your help.
There's more: IE treats applets that were loaded through the file system and applets that were loaded through a web server differently. (Yes, it is a security issue for IE.) Installing a small http server and accessing the applet through it would solve the problem.
But I wouldn't recommend hardcoding "localhost" or InetAddress.getLocalHost(). After all, you are going to put the applet out on some web server, right?
I have done what you are trying to do; it is possible :)