在開了全局代理的情況下,wget 與 git 一樣,也需要再配置代理
方法一:參數設置
wget -e http_proxy=127.0.0.1:1089 google.com
--2020-03-01 11:53:55-- http://google.com/
Connecting to 127.0.0.1:1089... connected.
Proxy request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.com/ [following]
--2020-03-01 11:53:57-- http://www.google.com/
Reusing existing connection to 127.0.0.1:1089.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’
index.html [ <=> ] 12.56K --.-KB/s in 0s
2020-03-01 11:54:01 (160 MB/s) - ‘index.html’ saved [12863]
方法二:配置文件設置
進入目錄
cd ~
創建.wgetrc配置文件
n vim .wgetrc
設置代理
http_proxy = http://your_proxy:port
https_proxy = http://your_proxy:port
proxy_user = user
proxy_password = password
use_proxy = on
wait = 15