Admin
privoxy的主要作用就是将sock5代理(shadowsocs/v2ray等本地代理端口)转发为http代理形式,因为终端及很多应用不支持sock5代理。
wget "http://www.privoxy.org/sf-download-mirror/Sources/3.0.26 (stable)/privoxy-3.0.26-stable-src.tar.gz"tar -xvf privoxy-3.0.26-stable-src.tar.gzcd privoxy-3.0.26-stableadduser privoxyyum install cvs -yautoheader && autoconf && ./configuremakemake install
Tips:
privoxy /usr/local/etc/privoxy 和 /usr/local/bin/privoxy
vim /usr/local/etc/privoxy/config
找到 listen 关键字, 修改监听地址(默认是:127.0.0.1)和端口(默认:8118):
# Example:## Suppose you are running Privoxy on a machine which has the# address 192.168.0.1 on your local private network# (192.168.0.0) and has another outside connection with a# different address. You want it to serve requests from inside# only:## listen-address 192.168.0.1:8118## Suppose you are running Privoxy on an IPv6-capable machine and# you want it to listen on the IPv6 address of the loopback# device:## listen-address [::1]:8118#listen-address 0.0.0.0:8118
找到 forward 关键字,修改(取消注释)转发sock5地址(1081是我的v2ray客户端本地端口)和跳过转发的本地地址:
# To chain Privoxy and Tor, both running on the same system, you# would use something like:#forward-socks5t / 127.0.0.1:1081 .## Note that if you got Tor through one of the bundles, you may# have to change the port from 9050 to 9150 (or even another# one). For details, please check the documentation on the Tor# website.## The public Tor network can't be used to reach your local# network, if you need to access local servers you therefore# might want to make some exceptions:#forward 192.168.*.*/ .forward 10.*.*.*/ .forward 127.*.*.*/ .
systemctl start privoxy
curl -x 127.0.0.1:8118 https://www.youtube.com
能够访问并打印网页内容即为成功
export http_proxy=http://127.0.0.1:8118export https_proxy=http://127.0.0.1:8118export ftp_proxy=http:>//127.0.0.1:8118
也可以将上述命令复制到~/.bashrc或者/etc/profile末尾,实现自动使用环境变量。
systemctl enable privoxy
https://note.xdq.me/centos-7-an-zhuang-privoxy-2/
https://www.5yun.org/14197.html
https://blog.acesheep.com/index.php/archives/54/#comment-221