IAdapter IAdapter - 1 year ago 176
Java Question

Ant GET task and proxy

How to use Ant's GET task with proxy?

I only see there username and password, but there is no proxy host :(

Answer Source

The key bit in the gettask docs is:

Proxies. Since Apache Ant 1.7.0, Ant running on Java1.5 or later can use the proxy settings of the operating system if enabled with the -autoproxy option. There is also the 'setproxy' task for earlier Java versions. With proxies turned on, requests against localhost may not work as expected, if the request is relayed to the proxy.

So you can use the setproxy task for older versions of Ant, or see the docs on proxy config:

<setproxy proxyhost="firewall" proxyport="81"/>

(The username and password attributes of the gettask are for the remote system, not for intermediate proxies.)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download