我想用代理下载一些wget的东西:
HTTP Proxy: 127.0.0.1
Port: 8080
代理不需要用户名和密码。
我该怎么做呢?
我想用代理下载一些wget的东西:
HTTP Proxy: 127.0.0.1
Port: 8080
代理不需要用户名和密码。
我该怎么做呢?
当前回答
使用tsocks通过socks5代理启动wget:
Install tsocks: sudo apt Install tsocks 配置tsocks # vi /etc/tsocks.conf Server = 127.0.0.1 Server_type = 5 Server_port = 1080 开始:tsocks wget http://url_to_get
其他回答
如果你只需要用代理执行一次wget,最简单的方法是用这样的一行程序来执行:
http_proxy=http://username:password@proxy_host:proxy_port wget http://fileurl
或使用https目标URL:
https_proxy=http://username:password@proxy_host:proxy_port wget https://fileurl
使用tsocks通过socks5代理启动wget:
Install tsocks: sudo apt Install tsocks 配置tsocks # vi /etc/tsocks.conf Server = 127.0.0.1 Server_type = 5 Server_port = 1080 开始:tsocks wget http://url_to_get
在命令行输入:
$ 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文件,这样你就不需要每次都执行了。
在Windows中——比如Fiddler——使用环境变量:
set http_proxy=http://127.0.0.1:8888
set https_proxy=http://127.0.0.1:8888
在Ubuntu 12中。x,我在$HOME/.wgetrc中添加了以下行
Http_proxy = http://uname:passwd@proxy.blah.com:8080 Use_proxy = on