Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 5 down vote accepted

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
share|improve this answer

You must log in to answer this question.

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