wget也能使用tor代理

这个不难,就简单说说,其实就是创建一个$HOME/.wgetrc,在里面写上:

http_proxy = http://127.0.0.1:8118/ use_proxy = on

这个$HOME/.wgetrc只是针对用户的设置,全局设置文件为/etc/wgetrc,上面两个设置选项在里面都有注释,不想用代理的时候,把第二个参数设置为off就可以了。

如果你安装tor只是为了在firefox下用, 并且使用了foxyproxy扩展的话,它可以甩掉privoxy,但是wget不行,8118端口就是默认的privoxy服务端口,tor只是socket代理,需要privoxy把http协议进行转换,所以一句话,不仅需要安装tor,还需要安装privoxy,安装方法参见我以前写的介绍

plod推荐Rail of War本地版本来是无法下载的,使用代理就可以了:

使用前: $ wget -c http://www.box.net/public/static/sqodscl31s.zip –15:40:19– http://www.box.net/public/static/sqodscl31s.zip => `sqodscl31s.zip’ Resolving www.box.net… 4.71.164.138 Connecting to www.box.net|4.71.164.138|:80… connected. HTTP request sent, awaiting response… 504 Gateway Time-out 15:41:56 ERROR 504: Gateway Time-out. 使用后: $ wget -c http://www.box.net/public/static/sqodscl31s.zip –16:10:18– http://www.box.net/public/static/sqodscl31s.zip => `sqodscl31s.zip’ Connecting to 127.0.0.1:8118… connected. Proxy request sent, awaiting response… 200 OK Length: 23,418,031 (22M) [application/zip] 0% [ ] 31,987 1019.58B/s ETA 8:33:44

只是速度。。。实在不敢恭维,不过好歹我们不仅能夠使用tor访问“不可达”的网站,还能夠下载“不可达”的文件了。

gentoo wiki上不推荐透过tor使用wget,但是文章我没有细看,反正能用了。另外如果使用了续传-c参数,某些代理服务器会在两次传输数据之间添加“transfer interrupted”这些文字,man wget上说以后考虑增加一个rollback参数,不知道实现了没有。

update @ 2007-03-13 如果系统中安装了squid,好像会自动设置一个环境变量:

declare -x http_proxy=”http://127.0.0.1:3128/” declare -x no_proxy=”localhost,127.0.0.0/8,*.local”

在这种情况下,有时候还需要.wgetrc来指定不使用代理,呵呵。

One thought on “wget也能使用tor代理”

Leave a Reply

Your email address will not be published. Required fields are marked *