Total Pageviews

Thursday, 12 April 2012

Polipo + autossh 配置指南

polipo 是一个轻量级的cache proxy,选择他是因为他能够实现从socks代理 到http代理的转换。

而且容易配置。



首先,我们还是用autossh这个利器实现 ssh tunnel,在/etc/rc.local中,加入:



[root@archlinux ~]# cat /etc/rc.local
#!/bin/bash
#
# /etc/rc.local: Local multi-user startup script.
#
echo "deadline" > /sys/block/sda/queue/scheduler

## for http(gfw blocked)

# first create a ssh tunnel(socks) then let polipo to talk to this socks proxy.

/usr/bin/autossh -M 20030 -f -N -C -c blowfish -D 127.0.0.1:9999 root@你的服务器IP -p 443 -i /root/server_usa




然后配置 polipo



[root@archlinux ~]# cat /etc/polipo/config
proxyAddress = "127.0.0.1"    # IPv4 only
proxyName = "polipo.server"
socksParentProxy = "127.0.0.1:9999"    // autossh搭建的socks代理
socksProxyType = socks5
chunkHighMark = 50331648
objectHighMark = 16384
diskCacheRoot = "/var/cache/polipo"    // 没目录需要手动创建
dnsQueryIPv6 = no
dnsNameServer = "127.0.0.1"    // dns指向本地pdnsd服务




配置过程很简单,reboot 后应该就能 看到 本地 127.0.0.1:8123绑定了polipo

ss -ln



LISTEN      0      128                             *:8123                           *:*

No comments:

Post a Comment