20

I had been using a proxy for a long time. Now I need to remove it. I have forgotten how I have added the proxy to wget. Can someone please help me get back to the normal wget where it doesn't use any proxy. As of now, I'm using

wget <link> --proxy=none

But I'm facing a problem when I'm installing using a pre-written script. It's painstaking to search all through the scripts and change each command. Any simpler solution will be very much appreciated.

Thanks

Naramsim
  • 8,059
  • 6
  • 35
  • 43
Trect
  • 2,759
  • 2
  • 30
  • 35

2 Answers2

39

Check your

  1. ~/.wgetrc
  2. /etc/wgetrc

and remove proxy settings.

Or use wget --no-proxy command line option to override them.

Logu
  • 904
  • 9
  • 15
  • I edited wgetrc and made use_proxy=off. But it still give the same error. – Trect Jul 31 '18 at 04:05
  • 3
    Did you check `wget --no-proxy`. What exact error you are seeing – Logu Aug 02 '18 at 15:13
  • What about `HTTPS_PROXY` and `HTTP_PROXY` environment variable. Will this method bypass these proxies as well? – PSKP Jun 02 '22 at 17:27
  • @PSKP the order is like this: 1. command_line options, 2. environment variables, 3. config files – Logu Dec 15 '22 at 15:56
7

In case your OS is alpine/busybox then the wget might vary from the one used by @Logu.

There the correct command is

wget --proxy off http://server:port/

Running wget --help outputs:

/ # wget --help
BusyBox v1.31.1 () multi-call binary.

Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
        [-o|--output-file FILE] [--header 'header: value'] [-Y|--proxy on/off]
        [-P DIR] [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

        --spider        Only check URL existence: $? is 0 if exists
        -c              Continue retrieval of aborted transfer
        -q              Quiet
        -P DIR          Save to DIR (default .)
        -S              Show server response
        -T SEC          Network read timeout is SEC seconds
        -O FILE         Save to FILE ('-' for stdout)
        -o FILE         Log messages to FILE
        -U STR          Use STR for User-Agent header
        -Y on/off       Use proxy
Naramsim
  • 8,059
  • 6
  • 35
  • 43