Ant GET 任务和代理 [英] Ant GET task and proxy
问题描述
如何使用Ant 的 GET 任务 使用代理?
我只看到用户名和密码,但没有代理主机:(
I only see there username and password, but there is no proxy host :(
推荐答案
get
task docs 是:
The key bit in the get
task docs is:
代理.从 Apache Ant 1.7.0 开始,Ant在Java1.5或更高版本上运行可以使用操作的代理设置系统如果启用了 -autoproxy选项.还有'setproxy'早期 Java 版本的任务.和代理开启,请求针对本地主机可能无法正常工作预期,如果请求被中继到代理.
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
任务对于旧版本的 Ant,或查看 proxy config 上的文档:
So you can use the setproxy
task for older versions of Ant, or see the docs on proxy config:
<setproxy proxyhost="firewall" proxyport="81"/>
(get
任务的用户名和密码属性是针对远程系统的,不是针对中间代理的.)
(The username and password attributes of the get
task are for the remote system, not for intermediate proxies.)
这篇关于Ant GET 任务和代理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!