privoxy为HTTP代理软件,tor为socket代理软件,且tor可以防止跟踪和窃听,如果可用的话 可以FQ,访问国外网站。最近要将tor和privoxy移植到mipsel平台,移植完成后在此整理一下,仅供爱好者参考。编译tor需要以下依赖包:

openssl-1.0.0k.tar.gz

zlib-1.2.8.tar.gzlibevent-2.0.20-stable.tar.gztor/privoxy软件如下:

privoxy-3.0.21-stable-src.tar.gz

tor-0.2.4.20注:tor网站为www.torproject.org,在国内貌似被封了,需要走VPN从国外下载。以下为编译步骤: ############# opensslchmod +x config./config --prefix=/home/aaron/router-tor/install/openssl-1.0.0k os/compiler:mipsel-linux-linux26-gcc#vi MakefileAR=mipsel-linux-linux26-armake make install############# zlibchmod +xconfig ./configure --prefix=/home/aaron/router-tor/install/zlib-1.2.8#vi MakefileCC=mipsel-linux-linux26-gcc LDSHARED=mipsel-linux-linux26-ldmakemake install############# libeventchmod +x configure./configure --prefix=/home/aaron/router-tor/install/libevent-2.0.20 CC=mipsel-linux-linux26-gcc AR=mipsel-linux-linux26-ar --host=mipsel-linuxmakemake install############# torchmod +x configure./configure --prefix=/tmp/tor CC=mipsel-linux-linux26-gcc AR=mipsel-linux-linux26-ar --host=mipsel-linux --enable-static-libevent --with-libevent-dir=/home/aaron/router-tor/install/libevent-2.0.20 --enable-static-openssl --with-openssl-dir=/home/aaron/router-tor/install/openssl-1.0.0k --enable-static-zlib --with-zlib-dir=/home/aaron/router-tor/install/zlib-1.2.8 --disable-asciidocmakemake install############# privoxyautoheader && autoconfchmod +x configure./configure --prefix=/tmp/privoxy CC=mipsel-linux-linux26-gcc AR=mipsel-linux-linux26-ar --host=mipsel-linuxmakemake install编译完成后需要放到mipsel平台进行测试#################################

测试privoxy如下 #################################在mipsel平台建立如下文件:/tmp/privoxy/default.action/tmp/privoxy/default.filter/tmp/privoxy/match-all.action/tmp/privoxy/trust/tmp/privoxy/user.action/tmp/privoxy/user.filter/tmp/privoxy/templates/tmp/privoxy/config/tmp/privoxy/templates/*config为配置文件,内容如下:#user-manual /usr/local/share/doc/privoxy/user-manual/confdir /tmp/privoxy#logdir /var/log/privoxyactionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.actionsfile default.action

# Main actions fileactionsfile user.action

# User customizationsfilterfile default.filterfilterfile user.filter

# User customizationslogfile logfilelisten-address

192.168.150.1:8118 #其实是mipsel平台IP地址,privoxy监听端口toggle

1enable-remote-toggle

0enable-remote-http-toggle

0enable-edit-actions 0enforce-blocks 0buffer-limit 4096enable-proxy-authentication-forwarding 0forwarded-connect-retries

0accept-intercepted-requests 0allow-cgi-request-crunching 0split-large-forms 0keep-alive-timeout 5tolerate-pipelining 1socket-timeout 300 forward-socks4a / 192.168.150.1:9050 . #其实是mipsel平台IP地址,tor监听端口,不要忘记最后的点以上所有文件内容为/tmp/privoxy/etc下的所有内容然后执行 chmod 666 -R /tmp/privoxy./privoxy /tmp/privoxy/config --user nobody.nobody --no-daemon切记user不要是root执行完成后netstat -na | grep 8118 会看到监听端口#################################

测试tor如下 #################################在mipsel平台建立如下文件:/tmp/tor/share/tor/geoip/tmp/tor/share/tor/geoip6以上文件为/tmp/tor/share/tor文件夹下内容/tmp/tor/cached-certs/tmp/tor/cached-microdesc-consensus/tmp/tor/cached-microdescs/tmp/tor/cached-microdescs.new以上文件为/root/.tor文件夹下内容 如找不到,请用find命令查找配置文件为torrc.conf,内容如下:SocksPort 192.168.150.1:9050 #tor监听端口 Log notice stderr#RunAsDaemon 1DataDirectory /tmp/tor#以下为桥配置/国内屏蔽tor,不用桥该软件不能工作bridge obfs2 91.11.17.184:443 e55095f89f8f7be4c3e209c5f5a91cabba474c40bridge obfs2 54.224.204.122:443 49d5cc0e690fd0321e749291f0eb98168e3c238bbridge obfs2 1.122.59.44:443 e24b6446ad4223d27ab075661962fc5d465d30ef查找桥方法: 给bridges@bridges.torproject.org发送邮件,内容为get bridges,然后可能会受到回复。注:必须用google的gmail邮箱或者yahoo邮箱,我第一次给它发邮件,它给我回复了,第二天再给 它发就没有回复了,因此获得桥信息比较麻烦。每次获得的桥信息一般一天就失效了,因为别人的机器 作为桥后,人家一旦关闭你就不能用了,我得到的桥信息第二天只有一条是有用的。我收到的信息为

91.11.17.184:443 e55095f89f8f7be4c3e209c5f5a91cabba474c40

54.224.204.122:443 49d5cc0e690fd0321e749291f0eb98168e3c238b

1.122.59.44:443 e24b6446ad4223d27ab075661962fc5d465d30ef配置完成后运行 ./tor -f torrc.conf执行完成后netstat -na | grep 9050 会看到监听端口#################################

测试是否可用 #################################在本机浏览器里设置代理为 192.168.150.1 端口为8118,然后在浏览器栏里输入 https://check.torproject.org/页面会显示Congratulations. This browser is configured to use Tor. Your IP address appears to be: 96.44.189.102到此配置完成。

快照源:http://www.cnblogs.com/wlibo666/p/3573922.html