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]
# 1
How about getCodeBase().getHost()?
jsalonen at 2007-6-29 17:41:13 > top of Java-index,Archived Forums,Java Programming...
# 2

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.

pverdugo at 2007-6-29 17:41:13 > top of Java-index,Archived Forums,Java Programming...
# 3

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 :)

jsalonen at 2007-6-29 17:41:13 > top of Java-index,Archived Forums,Java Programming...
# 4
Another time lot of thanks.Can you recommend me some site to download ansmall http server? I'm new developing java, sure you know it....Greetings from Barcelona.
pverdugo at 2007-6-29 17:41:13 > top of Java-index,Archived Forums,Java Programming...
# 5
I tried AnalogX SimpleServer:WWW and got the server running in two minutes. It will do well for testing purposes. http://www.tucows.com/preview/195634.html
jsalonen at 2007-6-29 17:41:13 > top of Java-index,Archived Forums,Java Programming...
# 6
ok, jsalonen.I downloaded AnalogXSimple Server and nowmy applet executes without problems inany browser.Thank you for your help.Pedro.
pverdugo at 2007-6-29 17:41:13 > top of Java-index,Archived Forums,Java Programming...