Sign in to follow this  
Followers 0
m2mike

Wget syntax with proxy

3 posts in this topic

If I want to use wget with a proxy, what is the correct syntax? I have tried the following with no success:

wget --proxy http_proxy = xxx.xxx.xxx.xxx:80 http://www.targeturl.com

wget --proxy=on http_proxy = xxx.xxx.xxx.xxx:80 http://www.targeturl.com

wget --proxy=on http_proxy = xxx.xxx.xxx.xxx:80/http://www.targeturl.com

Can someone post the correct syntax?

Edited by m2mike
0

Share this post


Link to post
Share on other sites

I had a similar problem!

You have to set the http_proxy variable first then you can use it in the wget... I have the exact syntax around here somewhere let me dig for it. Ok if you need the exact syntax I can post it for you tommrow, it's on my other partition but their is two ways to do it, one which is just using command line arguments work with export http_proxy and then using that proxy for wget, the other method is to add the information directly to the .wgetrc I've pasted the relevent man page parts for ya

STARTUP FILE

    Wget supports the use of initialization file .wgetrc. First a system-wide init file will be looked for (/usr/local/lib/wgetrc by default) and loaded. Then the user's file will be searched for in two places: In the environmental variable WGETRC (which is presumed to hold the full pathname) and $HOME/.wgetrc. Note that the settings in user's startup file may override the system settings, which includes the quota settings (he he).

    The syntax of each line of startup file is simple:

        variable = value

http_proxy = string

    Use the string as HTTP proxy, instead of the one specified in environment.

then you can manage use of the proxy with just

-Y on/off --proxy=on/off

    Turn proxy on or off. The proxy is on by default if the appropriate environmental variable is defined.

If this is all too confusing and strange I can get you the exact syntax I used tommrow. Good luck

-Dr^ZigMan

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0