Macos – Setting proxy via http_proxy on Mac

environment-variablesmacosPROXY

I am using an HTTP proxy on MacOS 10.7 (which works for Safari.app, when set in the system preferences). I'm now trying to set the proxy for command-line applications using the $http_proxy environment variable. However, I'm seeing the following error (proxy details replaced by uppercase variables

$ export http_proxy=PROXY:PORT
$ wget http://www.google.com
--2012-01-31 17:31:31--  http://www.google.com/
Resolving PROXY (PROXY)... PROXY_IP
Connecting to PROXY (PROXY)|PROXY_IP|:PORT... failed: Connection refused.

Any ideas what I might be doing wrong? Thanks!

Best Answer

Astrofrog

I hope this is not a dumb answer but do you have real values for PROXY and PORT. It should normally look something like

export http_proxy=http://myproxy.myorg.com:8080/ 

or

export http_proxy=http://10.20.1.1:8080/ 

Also try setting the variable in caps eg.

export HTTP_PROXY=http://myproxy.myorg.com:8080/ 

Finally there is normally some sort of authentication\verification on the proxy for example it might need to be configured to check the source address. Is your address configured on it?

James

Related Question