I want to set the nonProxyHosts
list for a SOCKS5 proxy, i.e. the list of hostnames to which a direct connection should be used.
As the oracle docs describe, there are options named http.nonProxyHosts
and ftp.nonProxyHosts
to set proxy exclusions for HTTP and FTP, but there is no specific setting for SOCKS proxies.
I tried http.nonProxyHosts
, but this doesn't affect SOCKS connections.
The SOCKS proxy is set up via:
System.setProperty("socksProxyHost", "192.168.10.10");
System.setProperty("socksProxyPort", "3128");
But this causes that even DB connections to localhost
are using the SOCKS proxy, which is unacceptable.
How is this supposed to be used? How can I exclude certain hosts from the proxified connections?