Applet Server Connection

I am playing with writing an applet that connects to a simple java server that I have written. I can run the server with no problems and it sits happily on my PC waiting for something to connect to it.

I have also written an applet that when initiated tries to connect to the server application I have written, but when I open my html document with the applet in it I get the following security exception thrown :

com.ms.security.SecurityExceptionEx[MuClient.init]: cannot access "127.0.0.1":4130

Now I know that applets can only connect to the host from which they were downloaded, but am I not doing this if I launch both html and server locally? Does anyone know how I can get round this security exception?

Thanks,

Steven Licciardi

[779 byte] By [Licciardi] at [2007-9-26 1:22:52]
# 1

What does work is that you DO have a webserver running at your pc.

For example apache. Once you download your applet by using a webserver (which is what you normally do when downloading an applet from the internet, the html-page containing the applet) it should work just fine.

The applet will indeed see that it's from the same host where he originated from (your localhost).

By starting your applet manually by double-clicking the html page for example, it may not work (as you said yourself).

To get a webserver for example see www.apache.org.

Martijn

MartijnR at 2007-6-29 1:00:32 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2
Thanks that worked fine!! I had already downloaded a web server called MiniPortal but didn't realise I had to run my html document through the server. Full browny points awarded.This problem has been annoying me for weeks now.Thanks,Steven Licciardi
Licciardi at 2007-6-29 1:00:32 > top of Java-index,Archived Forums,New To Java Technology Archive...