使用Privoxy为Openwrt的ssrplus开启http代理服务器

安装privoxy

opkg update
opkg install privoxy

配置

假设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    .'

保存重启 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的防火墙设置中打开http代理的端口,实验室其他Ubuntu主机可以直接通过环境变量设置http/https代理,在进行wget、curl和git等相关操作时,都会通过全局http代理,避免连接不畅,非常方便。之所以不使用socks5代理,因为wget不支持。

export http_proxy="http://[openwrt的地址]:8118"
export https_proxy="http://[openwrt的地址]:8118"

参考链接:Openwrt privoxy

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

糖醋奶茶

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值