I am writing a small chat applet. I need to use sockets (instead of HTTP
Tunnelling ) since my protocol demands it.
Now applets have a lot of problems with proxy servers and sockets, however
my applet works if you have a SOCKS server installed.
Most System Admins block access to almost all the ports for security reasons,
due to this I will have to tell the user to atleast allow the applet to talk
to one particular port (say 1234) on the server.
But this is not all, a strict firewall will also not let the applet open
its end of the Socket. What I mean by this is that when a Socket is opened
it connects to the remoteserver:remotepost on the server, but on its side
it also has to open a port, normally this port is taken by the JVM from a
list of free port and bound to the Socket. Thus now the Socket connects to
the remotePort on the Remote PC and the LocalPort it gets on the Local PC.
However when we come to a firewall, it is highly probable that the port the
JVM returns will not be able to make a connection outside. If I could specify
which port the JVM would use then I could tell the System Admin to open that
particular internal port. Right now the way my applet works, I would have
to tell the System Admin to open all the internal ports, which is not a very
wise thing to do.
Because of this I need to use the constructor
Socket s = new Socket(InetAddress,int,InetAddress,int);
But this gives me an error in IE saying
com.ms.security.SecurityException() cannot connect to "abc" where abc is
the name of my proxy server and firewall.
I could still use some help.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL