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. These can also be
used against SOCKS5 servers.
Modifier and Type | Class and Description |
---|---|
private static class |
Modifier and Type | Field and Description |
---|---|
private static final int | |
private String | nonProxyHosts
list of non proxy hosts |
protected String | proxyHost
proxy details |
private String | proxyPassword
password for http only |
protected int | proxyPort
name of proxy port |
private String | proxyUser
user for http only |
private static final int | |
private String | socksProxyHost
socks host. |
private int | socksProxyPort
Socks proxy port. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public 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 |
public void | |
public void | setNonProxyHosts(String
lists of hosts to talk direct to nonProxyHosts)A list of hosts to bypass the proxy on. |
public void | |
public void | setProxyPassword(String
password to go with the username proxyPassword)Set the password for the proxy. |
public void | |
public void | |
public void | |
public void | |
private void |
HTTP_PORT | back to summary |
---|---|
private static final int HTTP_PORT |
nonProxyHosts | back to summary |
---|---|
private String nonProxyHosts list of non proxy hosts |
proxyHost | back to summary |
---|---|
protected String proxyHost proxy details |
proxyPassword | back to summary |
---|---|
private String proxyPassword password for http only |
proxyPort | back to summary |
---|---|
protected int proxyPort name of proxy port |
proxyUser | back to summary |
---|---|
private String proxyUser user for http only |
SOCKS_PORT | back to summary |
---|---|
private static final int SOCKS_PORT |
socksProxyHost | back to summary |
---|---|
private String socksProxyHost socks host. |
socksProxyPort | back to summary |
---|---|
private int socksProxyPort Socks proxy port. Default is 1080. |
SetProxy | back to summary |
---|---|
public SetProxy() |
applyWebProxySettings | back to summary |
---|---|
public 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 |
execute | back to summary |
---|---|
public void execute() throws BuildException Overrides org. Does the work.
|
setNonProxyHosts | back to summary |
---|---|
public void setNonProxyHosts(String nonProxyHosts) A list of hosts to bypass the proxy on. These should be separated with the vertical bar character '|'. Only in Java 1.4 does ftp use this list. e.g. fozbot.corp.sun.com|*.eng.sun.com
|
setProxyHost | back to summary |
---|---|
public void setProxyHost(String hostname) the HTTP/ftp proxy host. Set this to "" for the http proxy option to be disabled
|
setProxyPassword | back to summary |
---|---|
public void setProxyPassword(String proxyPassword) Set the password for the proxy. Used only if the proxyUser is set.
|
setProxyPort | back to summary |
---|---|
public void setProxyPort(int port) the HTTP/ftp proxy port number; default is 80
|
setProxyUser | back to summary |
---|---|
public void setProxyUser(String proxyUser) set the proxy user. Probably requires a password to accompany this setting. Default=""
|
setSocksProxyHost | back to summary |
---|---|
public void setSocksProxyHost(String host) The name of a Socks server. Set to "" to turn socks proxying off.
|
setSocksProxyPort | back to summary |
---|---|
public void setSocksProxyPort(int port) Set the ProxyPort for socks connections. The default value is 1080
|
traceSettingInfo | back to summary |
---|---|
private void traceSettingInfo() list out what is going on |
Modifier and Type | Field and Description |
---|---|
private PasswordAuthentication |
Modifier and Type | Method and Description |
---|---|
protected PasswordAuthentication | getPasswordAuthentication()
Called when password authorization is needed.
|
auth | back to summary |
---|---|
private PasswordAuthentication auth |
ProxyAuth | back to summary |
---|---|
private ProxyAuth(String user, String pass) |
getPasswordAuthentication | back to summary |
---|---|
protected PasswordAuthentication getPasswordAuthentication() Overrides java. Doc from java. Called when password authorization is needed. Subclasses should override the default implementation, which returns null.
|