安裝privoxy
opkg update
opkg install privoxy
配置
假設(shè)socks5代理在1080端口
打開 /etc/config/privoxy
將其默認(rèn)配置清空,并修改為
config privoxy 'privoxy'
option confdir '/etc/privoxy'
option logdir '/var/log'
option logfile 'privoxy.log'
list listen_address '0.0.0.0:8118'
option forward_socks5 '/ 0.0.0.0:1080 .'
保存重啟 privoxy
/etc/init.d/privoxy restart
驗證
curl -x 127.0.0.1:8118 -I https://www.google.com
(完整的配置如下,可以自行添加)
config privoxy 'privoxy'
option confdir '/etc/privoxy'
option logdir '/var/log'
option logfile 'privoxy.log'
list filterfile 'default.filter'
# list filterfile 'user.filter'
list actionsfile 'match-all.action'
list actionsfile 'default.action'
# list actionsfile 'user.action'
# list listen_address '127.0.0.1:8118'
list listen_address '192.168.1.1:8118'
option toggle '0'
option enable_remote_toggle '1'
option enable_remote_http_toggle '0'
option enable_edit_actions '1'
option enforce_blocks '0'
option buffer_limit '4096'
option forwarded_connect_retries '0'
option accept_intercepted_requests '0'
option allow_cgi_request_crunching '0'
option split_large_forms '0'
option keep_alive_timeout '300'
option socket_timeout '300'
list permit_access '192.168.1.0/24'
option debug_1 '0'
option debug_512 '1'
option debug_1024 '0'
option debug_4096 '1'
option debug_8192 '1'
用途
在openwrt的防火墻設(shè)置中打開http代理的端口,實驗室其他Ubuntu主機(jī)可以直接通過環(huán)境變量設(shè)置http/https代理,在進(jìn)行wget、curl和git等相關(guān)操作時,都會通過全局http代理,避免連接不暢,非常方便。之所以不使用socks5代理,因為wget不支持。文章來源:http://www.zghlxwxcb.cn/news/detail-721341.html
export http_proxy="http://[openwrt的地址]:8118"
export https_proxy="http://[openwrt的地址]:8118"
參考鏈接:Openwrt privoxy文章來源地址http://www.zghlxwxcb.cn/news/detail-721341.html
到了這里,關(guān)于使用Privoxy為Openwrt的ssrplus開啟http代理服務(wù)器的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!