dcsimg
How to connect a client to server through a firewall?
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Andreas_K
Posted On:   Thursday, November 29, 2001 09:24 AM

I have constructed a javachat that works fine when inside the same network as the server. My question is: How can I make a client outside the network connect to the server? Should it be done with a proxy somehow? How do I do that?

Re: How to connect a client to server through a firewall?

Posted By:   Andrew_Cuthbertson  
Posted On:   Friday, November 30, 2001 07:09 AM


Depending upon the type of firewall there a several things that you can do.


for a masquerading firewall:


This is used transparently at the OS level and java needs no extra code to use this.



for a socks4 compatible firewall:


The JDK currently supports socks4. This is a protocol where the client software only opens a port to the firewall. Once this port is opened then the client can request the firewall to open ports elsewhere in the internet.


All you need to do is set some system properties to achieve this:


//SOCKS proxy host


System.setProperty("socksProxyHost",);


//SOCKS proxy port number


System.setProperty("socksProxyPort",);


Java will then use socks transparently.


for a web proxy firewall:


This is slightly more difficult. You will need to use port 80 for the communication through the firewall. Some even parse the html content. HTTP/1.1 supports a tunneling feature which you may be able to use.


Here is a useful read.


http://www.mokabyte.it/2000/06/firewallutil.htm

Re: How to connect a client to server through a firewall?

Posted By:   Dave_Butt  
Posted On:   Friday, November 30, 2001 03:17 AM

Look in to Tunneling using HTTP



Loads of pages on the web about this



If you implement this it will work for everyone.

Re: How to connect a client to server through a firewall?

Posted By:   Benoit_Quintin  
Posted On:   Thursday, November 29, 2001 11:24 AM

Have your Security admin unlock a port, or use port 80 on the server. Broadcasting over a firewall is definitely not recommended but if you still wnat to do it, choose your port, and broadcast your presence over it.
About | Sitemap | Contact