对于系统的所有用户,通过/etc/wgetrc或 仅对于具有~/.wgetrc文件的用户:

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

或通过-e放置在 URL 之后的选项:

wget ... -e use_proxy=yes -e http_proxy=127.0.0.1:8080 ...

也可以这样:
在命令行中输入:

$ export http_proxy=http://proxy_host:proxy_port

对于经过身份验证的代理,

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

然后运行

$ wget fileurl

对于 https,只需使用 https_proxy 而不是 http_proxy。你也可以把这些行放在你的 ~/.bashrc 文件中,这样你就不需要每次都执行它。

标签: linux

添加新评论