wget也能使用tor代理
授权方式:署名,非商业用途,保持一致,转载时请务必以超链接(http://www.fwolf.com/blog/post/293)的形式标明文章原始出处和作者信息及本声明。这个不难,就简单说说,其实就是创建一个$HOME/.wgetrc,在里面写上:
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 no_proxy=”localhost,127.0.0.0/8,*.local”
在这种情况下,有时候还需要.wgetrc来指定不使用代理,呵呵。
![[Bloglines]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/bloglines.png)
![[co.mments]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/comments.png)
![[del.icio.us]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/delicious.png)
![[Digg]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/digg.png)
![[diigo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/diigo.png)
![[Facebook]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/facebook.png)
![[Furl]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/furl.png)
![[Google]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/google.png)
![[MySpace]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/myspace.png)
![[Reddit]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/reddit.png)
![[Rojo]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/rojo.png)
![[Slashdot]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/slashdot.png)
![[StumbleUpon]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/stumbleupon.png)
![[Technorati]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/technorati.png)
![[Windows Live]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/windowslive.png)
![[Yahoo!]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/yahoo.png)
![[Email]](http://www.fwolf.com/blog/wp-content/plugins/bookmarkify/email.png)
December 6th, 2007 at 20:05:06
[...] http://www.fwolf.com/blog/post/293 [...]