• Filed under centos, linux, proxy
下载
git clone https://github.com/jech/polipo.git
cd polipo
(可选)使用发布的版本
git checkout polipo-1.1.1
安装
make all
su -c 'make install'
建立配置文件
mkdir /opt/polipo
nano /opt/polipo/config
复制http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/config.sample 内容并编辑
建立polipo账户
useradd polipo -r -s /usr/sbin/nologin
新建启动脚本
nano /etc/systemd/system/polipo.service
内容为
[Unit]
Description=polipo web proxy
After=network.target
[Service]
Type=simple
WorkingDirectory=/tmp
User=polipo
Group=polipo
ExecStart=/usr/bin/polipo -c /opt/polipo/config
Restart=always
SyslogIdentifier=Polipo
[Install]
WantedBy=multi-user.target
打开防火墙
firewall-cmd --permanent --add-port=8123/tcp
firewall-cmd --reload
尝试启动服务
systemctl start polipo
查看是否被selinux阻挡
sudo cat /var/log/audit/audit.log | grep polipo | grep denied
配置selinux rule
sudo cat /var/log/audit/audit.log | grep polipo | grep denied | audit2allow -M mypolipo
sudo semodule -i mypolipo.pp
重复以上操作直至selinux不再阻挡
自动启动服务
systemctl enable polipo
Polipo的其他配置
(转自:http://blog.youkuaiyun.com/xienaoban/article/details/54772942)
Polipo,和shadowsocks的socks5搭配比较不错。
打开配置文件:
sudo vim /etc/polipo/config
修改配置文件:
# This file only needs to list configuration variables that deviate
# from the default values. See /usr/share/doc/polipo/examples/config.sample
# and "polipo -v" for variables you can tweak and further information.
logSyslog = true
logFile = /var/log/polipo/polipo.log
socksParentProxy = "localhost:1080"
socksProxyType = socks5
logLevel=4
注意:请确保Shadowsocks正常工作。
然后重启polipo:
sudo service polipo stop
sudo service polipo start
Polipo默认的代理地址是 http_proxy=http://localhost:8123
那么每次对于希望over the wall的指令,只需在前面加一句http_proxy=http://localhost:8123
即可。当然每次输入这么一长串这比较麻烦,可以打开~/.bashrc
,在最后面添加一句
alias owall="http_proxy=http://localhost:8123"
这样以后只需在需要over the wall的指令前面加一句owall即可了。
先来测试下有没有成功,输入:
owall curl ip.gs
当前 IP:104.238.149.195 来自:日本东京都东京 choopa.com
如果不想每条指令都输入owall,可以
export http_proxy=http://localhost:8123