Link to home
Start Free TrialLog in
Avatar of octi
octi

asked on

socket through a firewall or proxy

How can I open a socket connection through a proxy or firewall?
Can I use the SocketImplementationFactory classes to write some settings for the socket? How?
Avatar of Jod
Jod

In general if a firewall is blocking certain ports then it should stop you completely - that is what it is supposed to do. Implementing your own SocketImplementationFactory will not help if the Firewall is simply refusing connections on the port you wish to open.

The following links explain the problem.

http://forum.java.sun.com/forum?14@@.ee78a3c
http://forum.java.sun.com/forum?14@@.eea6da6
http://forum.java.sun.com/forum?14@@.ee780c4

However - there are ways around this using HTTP connections for example.

The details are all here:

http://developer.java.sun.com/developer/technicalArticles/InnerWorkings/Burrowing/index.html
Avatar of octi

ASKER

I like the method but it is artificial, even if solve the problem of client/server conection (I did not try it yet). I like to find out wat is with this SocketImplementationFactory calss and how can bee used. Thans anyway.
              Octi
ASKER CERTIFIED SOLUTION
Avatar of mbormann
mbormann

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of octi

ASKER

I don't had the time to understand everything, what you did write here, but at least now I know what can I do with SocketImplementationFactory (or what I can't), if you are right...
        Octi

You will eventually need to write some native code on the platform you are working on to actually make the sockets if you wish to follow this route. there is plenty of free exaples around in C on how to do this.

Firewall will still block on ports that connections are disallowed on, but mb is an expert in many details of Firewalls so I'm sure he can help you here on set up of firewalls.
Avatar of octi

ASKER

It is this little program on this link:
http://developer.java.sun.com/developer/technicalArticles/InnerWorkings/Burrowing/index.html
Did you tried? Because I tried and it does not work. I get a message like "Error connection/ server"