輕量級 HTTP(s) 代理 TinyProxy
阿新 • • 發佈:2018-12-31
CentOS 下安裝 TinyProxy
yum install -y tinyproxy
啟動、停止、重啟
# 啟動
service tinyproxy start
# 停止
service tinyproxy stop
# 重啟
service tinyproxy restart
相關配置
預設配置檔案路徑
/etc/tinyproxy/tinyproxy.conf
允許所有人使用代理,註釋 Allow 127.0.0.1
# Allow 127.0.0.1
修改監聽埠號, 預設 8888
Port 1234
代理請求過濾,示例:僅允許代理請求 anoyi.com 的內容,配置如下:
# 指定過濾內容的檔案位置
Filter "/etc/tinyproxy/filter"
# 使用 URL 過濾而不是 domains
FilterURLs On
# 允許代理過濾檔案裡的地址,若不允許,此處設定為 No
FilterDefaultDeny Yes
然後在 /etc/tinyproxy/filter
檔案新增如下內容:
anoyi.com
檢視代理請求日誌
tail -f /var/log/tinyproxy/tinyproxy.log
應用場景
請求國外的資源,例如 谷歌,youtube 。。。