xud6的笔记本

proxy

A 4 post collection


centos 7 安装 privoxy

 •  Filed under centos, proxy, centos7, privoxy

安装编译工具

yum groupinstall "Development Tools"

下载privoxy最新版

http://sourceforge.net/projects/ijbswa/files/Sources/

编译

tar xzvf privoxy-3.0.23-stable-src.tar.gz
cd privoxy-3.0.23-stable
autoheader
autoconf
./configure      # (--help to see options)
make             # (the make from GNU, sometimes called gmake)

建立账户

sudo useradd privoxy -r -s /usr/sbin/nologin

安装

sudo make install

更改侦听地址

nano /usr/local/etc/privoxy/config

将listen-address值更改为 0.0.0.0:8118
重启

systemctl restart privoxy

打开防火墙端口

firewall-cmd --permanent --add-port=8118/tcp
firewall-cmd --reload

范例配置(使用本地socks5上级代理,本地地址不走代理)

nano /usr/local/etc/privoxy/config

增加

forward-socks5 / 127.0.0.1:12080 .
forward 10.*.*.*/ .
forward 192.168.*.*/ .
forward 127.*.*.*/ .
forward localhost/ .

centos 7 安装polipo

 •  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

安装delegate作为socks代理转http代理服务器

 •  Filed under linux, proxy

从ftp://ftp.delegate.org/pub/DeleGate/bin/linux/latest/ 下载最新的程序

wget ftp://ftp.delegate.org/pub/DeleGate/bin/linux/9.9.13/linux2.6-dg9_9_13.tar.gz

然后解压

tar -xf linux2.6-dg9_9_13.tar.gz
cd linux2.6-dg9_9_13

将其中的DGROOT文件夹拷贝到$home并重命名为delegate

mv DGROOT $home
cd $home
mv DGROOT delegate

重命名执行文件

cd delegate/bin
mv dg9_9_13 delegated

运行

./delegated -P8080 SERVER=http SOCKS=127.0.0.1:1080 -v ADMIN=you@your.domain

也可以使用delegated.conf

mv dg9_9_13.conf delegated.conf
./delegated

cow手动添加屏蔽地址

 •  Filed under proxy

google.com
google.com.hk
googleapis.com
gstatic.com
gmail.com
skyapi.onedrive.live.com
facebook.com
playstation.com
sonyentertainmentnetwork.com
ajax.aspnetcdn.com
gravatar.com
googlecode.com
s3.amazonaws.com