org.apache.tools.ant.taskdefs.optional.net
public class SetProxy extends Task
Examples
<setproxy/>do nothing
<setproxy proxyhost="firewall"/>set the proxy to firewall:80
<setproxy proxyhost="firewall" proxyport="81"/>set the proxy to firewall:81
<setproxy proxyhost=""/>stop using the http proxy; don't change the socks settings
<setproxy socksproxyhost="socksy"/>use socks via socksy:1080
<setproxy socksproxyhost=""/>stop using the socks server.
You can set a username and password for http with the proxyHost and proxyPassword attributes. On Java1.4 and above these can also be used against SOCKS5 servers.
Since: Ant 1.5
See Also:
java 1.4 network property list
UNKNOWN: category="network"
Field Summary | |
---|---|
protected String | proxyHost
proxy details |
protected int | proxyPort
name of proxy port |
Method Summary | |
---|---|
void | applyWebProxySettings()
if the proxy port and host settings are not null, then the settings
get applied these settings last beyond the life of the object and
apply to all network connections
Relevant docs: buglist #4183340 |
void | execute()
Does the work.
|
protected boolean | legacyResetProxySettingsCall(boolean setProxy)
make a call to sun.net.www.http.HttpClient.resetProperties();
this is only needed for java 1.1; reflection is used to stop the compiler
whining, and in case cleanroom JVMs dont have the class. |
void | setNonProxyHosts(String nonProxyHosts)
A list of hosts to bypass the proxy on. |
void | setProxyHost(String hostname)
the HTTP/ftp proxy host. |
void | setProxyPassword(String proxyPassword)
Set the password for the proxy. |
void | setProxyPort(int port)
the HTTP/ftp proxy port number; default is 80
|
void | setProxyUser(String proxyUser)
set the proxy user. |
void | setSocksProxyHost(String host)
The name of a Socks server. |
void | setSocksProxyPort(int port)
Set the ProxyPort for socks connections. |
Throws: BuildException thrown in unrecoverable error.
Returns: true if we did something
Parameters: nonProxyHosts lists of hosts to talk direct to
Parameters: hostname the new proxy hostname
Parameters: proxyPassword password to go with the username
Since: Ant1.6
Parameters: port port number of the proxy
Parameters: proxyUser username
Since: Ant1.6
Parameters: host The new SocksProxyHost value
Parameters: port The new SocksProxyPort value