安装tinyproxy代理
wget https://github.com/tinyproxy/tinyproxy/releases/download/1.10.0/tinyproxy-1.10.0.tar.gz
tar zxvf tinyproxy-1.10.0.tar.gz
cd tinyproxy-1.10.0
./configure --enable-xtinyproxy --enable-filter --enable-upstream --enable-transparent --enable-reverse --prefix=/usr/local/tinyproxy
make
make install
vi /usr/local/tinyproxy/etc/tinyproxy/tinyproxy.conf
/usr/local/tinyproxy/bin/tinyproxy -h
Usage: tinyproxy [options]
Options are:
-d Do not daemonize (run in foreground).
-c FILE Use an alternate configuration file.
-h Display this usage information.
-v Display version information.
Features compiled in:
XTinyproxy header
Filtering
Transparent proxy support
Reverse proxy support
Upstream proxy support
执行:
/usr/local/tinyproxy/bin/tinyproxy -c /usr/local/tinyproxy/etc/tinyproxy/tinyproxy.conf
测试代理节点是否生效(假设代理程序安装在10.10.10.10的机器,监听的是8888端口):
curl https://www.baidu.com/ --proxy 10.0.0.5:8888
如果是https代理加 -k 参数
curl https://www.baidu.com/ --proxy 10.0.0.5:8888 -k
Win10系统, 启动->设置->网络和Internet->代理->手动设置代理->服务器IP地址和端口号8888
Chrome浏览器->百度->搜索"ip"->显示: 香港
配置文件
注释掉 Allow,表示允许所有人访问代理
# Allow 127.0.0.1
去掉下面的注释, 表示隐藏掉Via请求头部,
DisableViaHeader Yes
以下是自定义玩法
添加head信息,https的代理不能添加(一条信息一条记录和ip访问限制设置一样)
AddHeader "Referer" "http://www.baidu.com"
反向代理
ReversePath "/" "http://www.apple.com"
ReverseOnly Yes
添加多段IP地址
Allow 10.27.80.0/24
Allow 11.65.48.0/24
Allow 18.90.12.145
状态统计
StatHost "tinyproxy.zdb.im"
访问 http://tinyproxy.zdb.im:8888/