Mac OS X socks proxy environment variable

无人久伴 提交于 2019-12-31 07:38:08

问题


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.


回答1:


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"


来源:https://stackoverflow.com/questions/13849760/mac-os-x-socks-proxy-environment-variable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!