centos下privoxy安装及使用

下载

###下载安装文件
wget http://www.privoxy.org/sf-download-mirror/Sources/3.0.26%20%28stable%29/privoxy-3.0.26-stable-src.tar.gz
tar -zxvf privoxy-3.0.26-stable-src.tar.gz
cd privoxy-3.0.26-stable

privoxy-3.0.26-stable 是目前最新的稳定版,建议在下载前去 Privoxy 官网下载页 检查一下版本。

新建用户

Privoxy 强烈不建议使用 root 用户运行,所以我们使用 useradd privoxy 新建一个用户.

安装

autoheader && autoconf
./configure
make && make install

配置

```vi /usr/local/etc/privoxy/config```

找到以下两句,确保没有注释掉

listen-address 127.0.0.1:8118   # 8118 是默认端口,不用改,下面会用到
forward-socks5t / 127.0.0.1:0 . # 这里的端口写 shadowsocks 的本地端口(注意最后那个 . 不要漏了)

启动

privoxy --user privoxy /usr/local/etc/privoxy/config

开启系统代理

配置 /etc/profile

vi /etc/profile

添加下面两句:

export http_proxy=http://127.0.0.1:8118       #这里的端口和上面 privoxy 中的保持一致
export https_proxy=http://127.0.0.1:8118

运行以下:

source /etc/profile

测试生效

curl www.google.com

返回一大堆 HTML 则说明 shadowsocks 正常工作了。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注