安装Squid:
Squid是一个大名鼎鼎老牌软件,用于做HTTP缓存代理。它非常完善的支持HTTP/1.1 proxy协议,所以我的方法就是:让squid以https的方式提供forward proxy service,然后在客户端机器使用chrome访问被封的网站。
首先,我有一个国外的LINUX VPS主机,我要在它上面安装squid:从源代码编译:(编译的squid必须是3.3或以上的版本。2.x版好像没有加密代理功能)
yum install openssl openssl-devel gcc-c++ bzip2 gcc perl
(如果你的系统是DEBIAN/UBUNTU,则需运行命令:apt-get install openssl libssl-dev gcc g++ bzip2 perl,否则
编译时,会遇到错误提示:configure: error: library 'crypto' is required for OpenSSL。参见
http://superuser.com/questions/371901/openssl-missing-during-configure-how-to-fix)
wget http://www.squid-cache.org/Versions/v3/3.5/squid-3.5.7.tar.bz2
tar jxvf squid-3.5.7.tar.bz2
cd squid-3.5.7
./configure --prefix=/usr --sysconfdir=/etc/squid --libdir=/usr/lib --with-openssl
--enable-basic-auth-helpers="LDAP,MSNT,NCSA,PAM,SASL,SMB,YP,DB,POP3,getpwnam,squid_radius_auth,multi-domain-NTLM" --with-swapdir=/var/spool/squid --libexecdir=/usr/lib/squid
make (此步骤耗时15分钟)
make install
配置squid,(修改SQUID的配置文件squid.conf)
然后修改Squid的配置文件。把http_port变成https_port ,修改监听的端口号为443:
https_port 443 cert=/etc/squid/public.crt key=/etc/squid/private.key
其中cert和key分别是网站的HTTPS证书和私钥。在/etc/squid/目录中,运行