标签归档:Polipo

TP-Link WR720N刷入OpenWrt之四:HTTP代理

socks代理有了,我们再来个http代理。

opkg update
opkg install polipo

编辑配置文件

vi /etc/polipo/config

在尾端增加以下几行

proxyAddress = “0.0.0.0”
proxyPort = 8123
proxyName = “localhost”
cacheIsShared = false
socksParentProxy = “localhost:7070”
socksProxyType = socks5
diskCacheRoot = “”
localDocumentRoot = “”
disableLocalInterface = true
disableConfiguration = true
dnsUseGethostbyname = yes
disableVia=false
censoredHeaders = from,accept-language,x-pad,link
censorReferer = maybe
maxConnectionAge = 5m
maxConnectionRequests = 120
serverMaxSlots = 8
serverSlots = 2
tunnelAllowedPorts = 1-65535
maxAge = 0
maxExpiresAge = 0

Polipo的开机启动有些问题,原始的开机启动加载的配置文件很奇葩。所以我们用以下方式修改。

编辑开机启动文件

vi /etc/init.d/mypolipo

输入

#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org

START=99

start() {
service_start /usr/sbin/polipo -c ‘/etc/polipo/config’
}

stop() {
service_stop /usr/sbin/polipo -c ‘/etc/polipo/config’
}

然后设置执行权限,允许开启自启动,并运行

chmod +x /etc/init.d/mypolipo
/etc/init.d/mypolipo enable
/etc/init.d/mypolipo start

至此,端口为8123的HTTP代理就架设成功。与socks同在,各取所需吧。