Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
1  
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

2 Answers 2

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/

share|improve this 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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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