安装privoxy
opkg update
opkg install privoxy
- 1
- 2
配置
假设socks5代理在1080端口
打开 /etc/config/privoxy
将其默认配置清空,并修改为
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 .'
- 1
- 2
- 3
- 4
- 5
- 6
保存重启 privoxy
/etc/init.d/privoxy restart
- 1
验证
curl -x 127.0.0.1:8118 -I https://www.google.com
- 1
(完整的配置如下,可以自行添加)
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'
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
用途
在openwrt的防火墙设置中打开http代理的端口,实验室其他Ubuntu主机可以直接通过环境变量设置http/https代理,在进行wget、curl和git等相关操作时,都会通过全局http代理,避免连接不畅,非常方便。之所以不使用socks5代理,因为wget不支持。
export http_proxy="http://[openwrt的地址]:8118"
export https_proxy="http://[openwrt的地址]:8118"
- 1
- 2
参考链接:Openwrt privoxy
安装privoxy
opkg update
opkg install privoxy
- 1
- 2
配置
假设socks5代理在1080端口
打开 /etc/config/privoxy
将其默认配置清空,并修改为
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 .'
- 1
- 2
- 3
- 4
- 5
- 6
保存重启 privoxy
/etc/init.d/privoxy restart
- 1
验证
curl -x 127.0.0.1:8118 -I https://www.google.com
- 1
(完整的配置如下,可以自行添加)
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'
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
用途
在openwrt的防火墙设置中打开http代理的端口,实验室其他Ubuntu主机可以直接通过环境变量设置http/https代理,在进行wget、curl和git等相关操作时,都会通过全局http代理,避免连接不畅,非常方便。之所以不使用socks5代理,因为wget不支持。
export http_proxy="http://[openwrt的地址]:8118"
export https_proxy="http://[openwrt的地址]:8118"
- 1
- 2
参考链接:Openwrt privoxy
评论记录:
回复评论: