Sunday, May 20, 2001 11:54 AM
Your definition of "it does not seem to work" seems a
little strange. It sounds like it does
just not the way you wanted it to work.
You say "I am able to get the contents
of the URL even though my proxy server is not running".
As it turns out this is what Sun's implementation ofURLConnection
is supposed to do - it tries your proxy
first then if it can't connect it tries directly. If a direct
connection also fails, then you get an exception.
This fallback position is useful, for example, when you
are trying to reach an address on your local network
(which should typically not pass through a proxy).
If your network setup allows direct connections to
the outside to
bypass the proxy, and relies on the clients to voluntarily
use the proxy, then your network setup is wrong.
Note also that there is no such property as "http.proxySet".
The Networking FAQ has several entries related to
URLConnections through a proxy from which
you can get further information.