2012年5月7日星期一

[GFW BLOG(功夫网与翻墙)] 用 Stunnel 保护隐私

原文:http://igfw.net/archives/9024

「因为我们要更好的上网,结果我们浪费了大量时间在跟GFW,联通,电信中斗争。」 -。-

Stunnel 是个好东西,很小巧,它的原理是把服务器端的 http 代理加密成 https 代理,然后在本地也用 stunnel 把 https 代理转成 http 代理,这样在本地就有了一个 http 代理可用。goagent限制太多,自己搭建的服务器就是得花钱和浪费点时间。不过值得,相信我。

服务器端搭建:

1,http代理,用squid、polipo或者tinyporxy随便搞个http代理出来,此时这个代理是http的,直接用会被rst。
2,安装 stunnel ,配置大概如下,先用 openssl 产生一个证书:

openssl req -new -x509 -days 365 -nodes -out /etc/stunnel.pem -keyout /etc/stunnel.pem

cert = /etc/stunnel.pem
chroot = /var/run/stunnel4/
pid = /stunnel.pid
client = no
sslVersion = SSLv3
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
socket = l:SO_LINGER=1:1
socket = r:SO_LINGER=1:1

[http]
accept = 8888 #stunnel的端口
connect = 127.0.0.1:3128 #本地http端口

然后启动 stunnel,服务器端就搭建好了。但此时代理是https的,必须在本地做好了 stunnel 客户端转成 http 才行。

本地端:

本地端其实超级简单了。Mac上直接用 macport,brew 安装个 stunnel 即可。如果不便,直接下我的编译好的,在这。下载后 chmod +x stunnel

写一个配置文件:

client = yes #扮演客户端啦
pid=/var/run/stunnel.pid
debug = 7
foreground = no #是否前台运行还是后台运行
sslVersion = SSLv3
verify=0
[proxy]
accept = 127.0.0.1:9999
connect = xxx.xxx.xxx.xxx:8888

然后启动 stunnel 即可,执行 ./stunnel stunnel.conf

这样,在本地就有一个 9999 端口的 http 代理,世界清净了,没有 rst 和偷窥。你懂的。

原文http://w3.owind.com/pub/binary/2012/05/05/用-stunnel-保护隐私

stunnel的Windows和Android版本可以在 ftp://ftp.stunnel.org/stunnel/ 下载。




--
Posted By GFW BLOG 功夫网与翻墙 to GFW BLOG(功夫网与翻墙) at 5/07/2012 07:02:00 AM

--
1、翻墙利器赛风3下载地址: http://dld.bz/caonima326http://dld.bz/caonima745/
2、我们的订阅地址:http://feeds2.feedburner.com/chinagfwblog
3、停止订阅,请发邮件到
gfw-blog+unsubscribe@googlegroups.com
翻越防火长城,你可以到达世界上的每一个角落。(Across the Great Firewall, you can reach every corner in the world.)

没有评论:

发表评论