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'm running a ubuntu 10.04 i386 desktop edition. I have configured the http proxy via the http_proxy variable. When I use wget I get a connection refused but, curl, apt-get etc. work just fine. Any idea what I'm missing here?

$ echo $http_proxy
http://10.0.0.42:8080/
$ export HTTP_PROXY=$http_proxy
$ wget --proxy=on http://www.google.com
--2010-06-24 18:56:53--  http://www.google.com/
Resolving www.google.com... 74.125.95.106, 74.125.95.147, 74.125.95.99, ...
Connecting to www.google.com|74.125.95.106|:80... failed: Connection refused.
Connecting to www.google.com|74.125.95.147|:80... failed: Connection refused.
Connecting to www.google.com|74.125.95.99|:80... failed: Connection refused.
Connecting to www.google.com|74.125.95.103|:80... failed: Connection refused.
Connecting to www.google.com|74.125.95.104|:80... failed: Connection refused.
Connecting to www.google.com|74.125.95.105|:80... failed: Connection refused.
$ curl http://www.google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.co.in/">here</A>.
</BODY></HTML>
$ 
share|improve this question
add comment

3 Answers 3

I've found that some programs use the environment variable http_proxy (lower case), while others use HTTP_PROXY (upper case). Because it's quicker than looking up which program uses which variable, I tend to set 'em both.

share|improve this answer
add comment

After setting http_proxy like so:

export http_proxy="http://proxy.example.com:8080"

Use wget with this flag:

--proxy=on

You can use

--proxy-username="username" --proxy-passwd="password"

to set proxy username and password where required.

share|improve this answer
add comment
up vote 1 down vote accepted

Thanks for your help guys. I found the solution with some help from the ever helpful folks at #ubuntu. The problem turned out to be the no_proxy that was set to localhost once I unset it wget worked fine

share|improve this answer
add comment

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.