how can the client in java go through the proxy server

If a client written in java is deployed in a LAN, which is connectected to the internet through the proxy server, then does the clietn have to provide the option of connectiong through proxy?Also, please kindly give some explanations and recommend some related tutorials.
[300 byte] By [jhottera] at [2007-10-2 7:17:34]
# 1
What knid of a client are we talking aboutand does your client needs to connect something on the internet (Out side your LAN)does direct access is blocked using a firewall or something.
LRMKa at 2007-7-16 20:52:46 > top of Java-index,Archived Forums,Socket Programming...
# 2
yes, the client needs to talk to the remote server somewhere in the internet, which means the client must go through the proxy and firewall.By the way, is there any way to tell if the network has the proxy configured or not?
jhottera at 2007-7-16 20:52:46 > top of Java-index,Archived Forums,Socket Programming...
# 3

I got few more questions about your requirements

Dose your firewall block direct access to internet (I mean the connection that are initiated withing yur lan) if not you dont need a proxy otherwise you will need it.

Does your client program uses some sort of standerd protocole when talking to server like HTTP or FTP in that case you can use the proxy you have installed in your network. If you are using your own protocole you will have to either use a Socket proxy server or write a proxy for your protocole.

If you are using HTTP or FTP with some sort of third part library to handle the communication or java.net.URL objects then those APIs provide you functions to set the details of proxy servers to use.

I dont know much about using Socket proxy servers when creating sockets.

If you can give more technical informatino about ho your client communication with the server I can be more specific

LRMKa at 2007-7-16 20:52:46 > top of Java-index,Archived Forums,Socket Programming...
# 4

Java won't know if it is connected to a proxy server except for the server communicating with the socket is different then what the request was made on.

Or so that's how it should work.

There really is no option to go around a proxy - the proxy is there for a reason - to filter. If you could simply tell it to go around a proxy - the proxy would be useless.

watertownjordana at 2007-7-16 20:52:46 > top of Java-index,Archived Forums,Socket Programming...
# 5

I mean in some places they use HTTP proxy just to improve perfomance.

Ex:- My ISP has a proxy It is optional to go through it but if you do you get better download rates for static web content (which has been downloaded by another surfer before me).

And also some firewalls only there to block the externaly initiated connections in such cases winthin the LAN you can initiate a connection without any problems

But of course that may not be your case.

LRMKa at 2007-7-16 20:52:46 > top of Java-index,Archived Forums,Socket Programming...
# 6
See the http.proxyHost/proxyPort settings and also java.net.Proxy.
ejpa at 2007-7-16 20:52:46 > top of Java-index,Archived Forums,Socket Programming...