Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

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.