Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If I run:

echo $http_proxy

It output:

http://user:pass@host:port

But when I run:

wget www.google.com

It output:

Resolviendo www.google.com... 209.85.195.104
Caching www.google.com => 209.85.195.104
Conectando a www.google.com|209.85.195.104|:80... Closed fd 3
falló: Expiró el tiempo de conexión.
Releasing 0x088293a8 (new refcount 1).
Reintentando.

--2010-07-07 19:40:00--  (intento: 2)  http://www.google.com/
Found www.google.com in host_name_addresses_map (0x88293a8)
Conectando a www.google.com|209.85.195.104|:80...

In English:

Resolving www.google.com... 209.85.195.104
Caching www.google.com => 209.85.195.104
conecting to www.google.com|209.85.195.104|:80... Closed fd 3
fail: conection time has expired.
Releasing 0x088293a8 (new refcount 1).
retrying.
...

What I am doing wrong?

NOTE: the https_proxy and ftp_proxy have the same value. And I already try to modify /etc/wgetrc and reinit without success.

share|improve this question
    
Can you elucidate what's in the [...] error there? Are you seeing [proxyhost|ip_address|:port], as expected with $http_proxy set correctly? Could you share an obfuscated version of wget --debug www.google.com? –  medina Jul 7 '10 at 21:07
    
ok, but it's Spanish –  damian Jul 7 '10 at 21:42

4 Answers 4

up vote 1 down vote accepted

Thanks for the debug logs.

So you're clearly not using up the env proxy settings you expect based on that output.

See http://www.gnu.org/software/wget/manual/wget.html#Proxies for some alternate methods of configuring the proxy settings.

It's not clear if you're in some kind of controlled environment, but it's also possible that the wget you're calling has been modified in some how -- perhaps there's a wrapper script that's stripping out the environment or disabling the proxy settings from being used (--no-proxy). Does file $(which wget) show it's an executable?

share|improve this answer
    
file $(which wget) outputs: /usr/bin/wget: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped –  damian Jul 8 '10 at 13:30

Is this Ubuntu? See the workaround at https://bugs.launchpad.net/ubuntu/+source/wget/+bug/585766 .

Also, you might need to set 'proxy = on' in your .wgetrc , in addition to setting the http_proxy environment variable. I think that is vaguely suggested at http://www.gnu.org/software/wget/manual/wget.html#Proxies .

share|improve this answer

Also, try to set $HTTP_PROXY instead.

share|improve this answer

Did you define http_proxy in /etc/wgetrc or ~/.wgetrc? Wget doesn't seem to read the environment variable, but it worked for me when I defined it in one of those files.

EDIT: I don't need to modify wgetrc if I set http_proxy in ~/.bashrc and remove no_proxy from /etc/environment.

share|improve this answer

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.