How to set proxy for wget?

后端 未结 13 1858
陌清茗
陌清茗 2020-12-02 03:38

I want to download something with wget using a proxy:

HTTP Proxy: 127.0.0.1
Port: 8080

The proxy does not need username and pa

相关标签:
13条回答
  • 2020-12-02 04:05

    the following possible configs are located in /etc/wgetrc just uncomment and use...

    # You can set the default proxies for Wget to use for http, https, and ftp.
    # They will override the value in the environment.
    #https_proxy = http://proxy.yoyodyne.com:18023/
    #http_proxy = http://proxy.yoyodyne.com:18023/
    #ftp_proxy = http://proxy.yoyodyne.com:18023/
    
    # If you do not want to use proxy at all, set this to off.
    #use_proxy = on
    
    0 讨论(0)
  • 2020-12-02 04:06

    wget uses environment variables somthing like this at command line can work:

    export http_proxy=http://your_ip_proxy:port/
    export https_proxy=$http_proxy
    export ftp_proxy=$http_proxy
    export dns_proxy=$http_proxy
    export rsync_proxy=$http_proxy
    export no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
    
    0 讨论(0)
  • Add below line(s) in file ~/.wgetrc or /etc/wgetrc (create the file if it is not there):

    http_proxy = http://[Proxy_Server]:[port]
    https_proxy = http://[Proxy_Server]:[port]
    ftp_proxy = http://[Proxy_Server]:[port]
    

    For more information, https://www.thegeekdiary.com/how-to-use-wget-to-download-file-via-proxy/

    0 讨论(0)
  • 2020-12-02 04:14

    For all users of the system via the /etc/wgetrc or for the user only with the ~/.wgetrc file:

    use_proxy=yes
    http_proxy=127.0.0.1:8080
    https_proxy=127.0.0.1:8080
    

    or via -e options placed after the URL:

    wget ... -e use_proxy=yes -e http_proxy=127.0.0.1:8080 ...
    
    0 讨论(0)
  • 2020-12-02 04:15

    Type in command line :

    $ export http_proxy=http://proxy_host:proxy_port
    

    for authenticated proxy,

    $ export http_proxy=http://username:password@proxy_host:proxy_port
    

    and then run

    $ wget fileurl
    

    for https, just use https_proxy instead of http_proxy. You could also put these lines in your ~/.bashrc file so that you don't need to execute this everytime.

    0 讨论(0)
  • 2020-12-02 04:15

    In my ubuntu, following lines in $HOME/.wgetrc did the trick!

    http_proxy = http://uname:passwd@proxy.blah.com:8080

    use_proxy = on

    0 讨论(0)
提交回复
热议问题