LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   wget is using not the proxy I just set in http_proxy (http://www.linuxquestions.org/questions/linux-software-2/wget-is-using-not-the-proxy-i-just-set-in-http_proxy-4175431488/)

eantoranz 10-10-2012 09:07 AM

wget is using not the proxy I just set in http_proxy
 
Hi!

I have in my .bashrc stuff settings for http_proxy and https_proxy. Works like a charm.

Now, I want to use _another_proxy to download one file from internet. I set/export http_proxy and https_proxy on the terminal I'm running wget and wget is still using the proxy that was set up in the variables before. why is that?

Thanks in advance.

Kubuntu 12.04 (updated)

acid_kewpie 10-10-2012 09:27 AM

what do you see if you run "echo $http_proxy"? note that the scope of variables is per session, you can't change them from a different terminal etc.

eantoranz 10-10-2012 09:37 AM

I know. Look:

Code:

$ echo $http_proxy $https_proxy
plata.cps.local:8080 plata.cps.local:8080
$ export http_proxy=helio.cps.local:8080
$ export https_proxy=helio.cps.local:8080
$ echo $http_proxy $https_proxy
helio.cps.local:8080 helio.cps.local:8080
$ wget http://releases.ubuntu.com/lucid/ubuntu-10.04.4-server-i386.iso
--2012-10-10 09:05:51--  http://releases.ubuntu.com/lucid/ubuntu-10.04.4-server-i386.iso
Resolving plata.cps.local (plata.cps.local)... 10.240.178.202
Connecting to plata.cps.local (plata.cps.local)|10.240.178.202|:8080... connected.
Proxy request sent, awaiting response... ^C

How about that?

acid_kewpie 10-10-2012 09:41 AM

Hmm, odd. there are a fair few other variables it might be seeing, anything else in "set | grep -i proxy" ?

eantoranz 10-10-2012 09:47 AM

Code:

$ set | grep -i proxy
UBUNTU_MENUPROXY=libappmenu.so
http_proxy=helio.cps.local:8080
https_proxy=helio.cps.local:8080
            -find -s -nice -nouserlib -noclasspath -autoproxy -main'            -- "$cur" ));
                        url proxy fetch push mirror skipDefaultUpdate
                core.gitProxy
                http.proxy
        PreferredAuthentications Protocol ProxyCommand PubkeyAuthentication \



---------- Post added 10-10-12 at 10:48 AM ----------

That's on the same session I used before.

acid_kewpie 10-10-2012 09:52 AM

Nope, I'm lost!

If you put the variable on the same command line, it does work correctly, right?

$ http_proxy=helio.cps.local:8080 wget http://releases.ubuntu.com/lucid/ubu...erver-i386.iso

pan64 10-10-2012 09:55 AM

do you have a wgetrc? ($HOME/.wgetrc)

eantoranz 10-10-2012 09:59 AM

I thought of the .rc file but I think I have none. Let me double check. Nope, nothing.

Actually, it does not work with the environment variable set on the same command line:

Code:

$ http_proxy=helio.cps.local:8080  wget http://releases.ubuntu.com/lucid/ubuntu-10.04.4-server-i386.iso
--2012-10-10 09:27:39--  http://releases.ubuntu.com/lucid/ubuntu-10.04.4-server-i386.iso
Resolving plata.cps.local (plata.cps.local)... 10.240.178.202
Connecting to plata.cps.local (plata.cps.local)|10.240.178.202|:8080... connected.
Proxy request sent, awaiting response... ^C
$ http_proxy=helio.cps.local:8080 https_proxy=helio.cps.local:8080 wget http://releases.ubuntu.com/lucid/ubuntu-10.04.4-server-i386.iso
--2012-10-10 09:28:57--  http://releases.ubuntu.com/lucid/ubuntu-10.04.4-server-i386.iso
Resolving plata.cps.local (plata.cps.local)... 10.240.178.202
Connecting to plata.cps.local (plata.cps.local)|10.240.178.202|:8080... connected.
Proxy request sent, awaiting response... ^C

weird... veeeeeeeeeeeeery weird.

pan64 10-10-2012 10:08 AM

try to unset those variables and use strace to see what's happened (which file was accessed before connecting)


All times are GMT -5. The time now is 07:38 PM.