[Biojava-dev] URLs/ FireWalls and Proxies

Thomas Down td2@sanger.ac.uk
Fri, 27 Sep 2002 19:00:02 +0100


On Thu, Sep 26, 2002 at 03:50:01PM +1200, Schreiber, Mark wrote:
> Hi -
> 
> Does anyone have a code snippet that will let a java object retreive the
> contents of an URL from behind a firewall by going through a Squid
> proxy?

The builtin URL handlers are proxy-aware.  They are configured
using the system properties proxyHost and proxyPort (I believe you
can also set proxies for specific protocols, e.g. http.proxyHost,
http.proxyPort).  When I need these, I usually set them from the
command line, but there's no reason why your application couldn't
use System.setProperty, either at startup or from a configuration
interface.

Unless things have changed in 1.4 (I don't think they have) there's
no specific API for setting proxies.

     Thomas.