Setproxy Task


Sets Java's web proxy properties, so that tasks and code run in the same JVM can have through-the-firewall access to remote web sites, and remote FTP sites. You can nominate an HTTP and FTP proxy, or a SOCKS server, reset the server settings, or do nothing at all.


Attribute Description Type Required
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.|* String No
proxyhost the HTTP/FTP proxy host. Set this to for the HTTP proxy option to be disabled. String No
proxypassword Set the password for the proxy. Used only if the proxyUser is set. String No
proxyport the HTTP/FTP proxy port number int No; default is 80
proxyuser set the proxy user. Probably requires a password to accompany this setting. String No; default is
socksproxyhost The name of a SOCKS server. Set to to turn SOCKS proxying off. String No
socksproxyport Set the ProxyPort for SOCKS connections. int No; default is 1080


Do nothing


Set the proxy to firewall:80

<setproxy proxyhost="firewall"/>

Set the proxy to firewall:81

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

Stop using HTTP proxy; don't change SOCKS settings

<setproxy proxyhost=""/>

Use SOCKS via socksy:1080

<setproxy socksproxyhost="socksy"/>

Stop using the SOCKS server

<setproxy socksproxyhost=""/>

You can set a username and password for HTTP with the proxyHost and proxyPassword attributes. On Java 1.4 and above, these can also be used against SOCKS 5 servers.