简体   繁体   中英

Mac OS X socks proxy environment variable

I know it's possible to set the socks proxy server via network app and there is a Mac specific utility to set it but I prefer to just set the socks proxy server as an environment variable if possible. Does anyone know the appropriate export setting?

In case anyone is wondering this is possible for http proxy, for example, export http_proxy=http://my-proxy-server:1080/ get picked up by the JVM as http.proxyPort=1080 and http.proxyHost=my-proxy-server . When passed as Mac system level setting, socks proxy is seen as socksProxyHost=my-socks-proxy-server but I can't determine the equivalent environment variable name.

I couldn't find the appropriate environment variable to set but found an alternate solution. Adding this to bash_profile works for me

export _JAVA_OPTIONS="-Dhttp.proxyHost=my-proxy-server -Dhttp.proxyPort=1080 -DsocksProxyHost=my-socks-server"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM