Mac OS X socks代理环境变量 [英] Mac OS X socks proxy environment variable
问题描述
我知道可以通过网络应用程序设置socks代理服务器,并有一个Mac特定的实用程序来设置它,但我更喜欢只是设置socks代理服务器作为环境变量,如果可能的话。有没有人知道适当的 export
设置?
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?
如果任何人想知道这是可能的http代理, , export http_proxy = http:// my-proxy-server:1080 /
由JVM获取 http.proxyPort = 1080
和 http.proxyHost = my-proxy-server
。当作为Mac系统级别设置传递时,socks代理被看作 socksProxyHost = my-socks-proxy-server
,但是我不能确定等效的环境变量名。 >
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.
推荐答案
我找不到合适的环境变量,但找到了一个替代解决方案。添加到 bash_profile
为我工作
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"
这篇关于Mac OS X socks代理环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!