Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using an HTTP proxy on MacOS 10.7 (which works for, 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
--2012-01-31 17:31:31--
Connecting to PROXY (PROXY)|PROXY_IP|:PORT... failed: Connection refused.

Any ideas what I might be doing wrong? Thanks!

share|improve this question
Do you need a username/password for this proxy? – Daniel Beck Jan 31 '12 at 16:45
No, I do not need a username/password – astrofrog Feb 10 '12 at 11:28

Connection refused indicates that that the given ip address and port are atleast in theory valid but the host is blocking the connection because a) firewall doesnt let your connection to the actual proxy server software or b) there is no proxy server running in that particular host in that particular port.

First line of debugging this would be to use telnet in terminal.

  1. telnet PROXY PORT
  2. telnet PROXY_IP PORT

If both cases fail with "connection refused", problem is in the other (proxy) end or you dont have proper name/ip/port for your proxy.

If either one fails and another works, there's definitely some sort of dns error (which again, you might not be able to fix on your own)

PS. Atleast on linux, typically http and https proxy variables are exported with full urls including the protocol: export http_proxy=

share|improve this answer


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= 


export http_proxy= 

Also try setting the variable in caps eg.

export HTTP_PROXY= 

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?


share|improve this answer
I assume he's simply protecting his privacy by replacing actual IP and Ports with PROXY/PORT. – Michael Frank Dec 30 '13 at 2:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .