Common Protocols

Protocol proxyHost proxyPort nonProxyHosts proxyUser proxyPassword
http Y Y Y Y Y
https Y Y also use http.nonProxyHosts Y Y
ftp Y Y Y Y Y

For nonProxyHosts, a list of hosts that should be reached directly without the proxy. The list is separated by '|' (i.e. pipe symbol). The patterns may start or end with a '*' for wildcards.

If the protocol value is Y for a particular header, it means you can combine the protocol with the header (e.g. http is Y for proxyHost in the table, thus we can combine it as http.proxyHost) to form a single property.

SOCKS Protocol

Property Description
socksProxyHost The host of the SOCKS proxy server.
socksProxyPort The port (i.e. defaulting to 1080) where SOCKS proxy server is listening.
socksProxyVersion The version (i.e. defaulting to 5) of the SOCKS protocol supported by the server.
java.net.socks.username The username for authenticating to SOCKSv5 proxy server.
java.net.socks.password The password for authenticating to SOCKSv5 proxy server.

System Proxy

java.net.useSystemProxies set this property to true to use the system proxy.

Simple Example of Using Some of the Properties

java -Dhttp.proxyHost=localhost -Dhttp.proxyPort=808 ApplicationAccessingTheNet