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.

1 Answer 1


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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .