如何使用Ant's GET task有代理?
我只看到用户名和密码,但没有代理主机:(
最佳答案
get
task docs 中的关键位是:
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.
所以你可以使用 setproxy
task对于旧版本的 Ant,或查看 proxy config 上的文档:
<setproxy proxyhost="firewall" proxyport="81"/>
(get
任务的用户名和密码属性用于远程系统,不适用于中间代理。)
关于java - Ant GET 任务和代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5179695/