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!

link|improve this question

50% accept rate
1  
Do you need a username/password for this proxy? – Daniel Beck Jan 31 at 16:45
No, I do not need a username/password – astrofrog Feb 10 at 11:28
feedback

1 Answer

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=http://foo.bar.biz:8080/

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.