Force wget proxy to non environment proxy

3

1

Is there a way to force wget to use a specific squid proxy when making connections? I normally use a squid proxy, but I need this specific request to go via a different one. I don't have to use wget; I just need a way to test squid's blocking rules by requesting various pages through it. This proxy is not my normal proxy on the network, and so I can't rely on wget taking the environment variable.

Also, this is as part of a script, so anything that avoids editing wget config files would be best. Can curl do this? I'm currently using the exit code of wget to determine if the connection was made.

Sirex

Posted 2010-08-17T13:19:45.247

Reputation: 10 321

Answers

5

You can set the http_proxy environment variable just for a specific invocation of wget:

http_proxy=http://specific-squid-proxy-host:3129/ wget http://server/page

Gilles 'SO- stop being evil'

Posted 2010-08-17T13:19:45.247

Reputation: 58 319