Naive安装与配置教程

Naive安装与配置教程
Photo by Christopher Gower / Unsplash

安装Go语言

sudo apt  install golang-go

下载编译带有forwardproxy模块的Caddy

go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
~/go/bin/xcaddy build --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive

在Arm服务上如果网络不通,可以改下caddy的权限:

setcap -r /usr/bin/caddy

编辑Caddyfile添加代理配置

:443, www.xxx.cn {  #已经解析的域名,也就是Naive的那个服务器地址
	route {
 		forward_proxy {
   			basic_auth user pass #第一个用户名user和密码pass,中间有空格
   			hide_ip
   			hide_via
   			probe_resistance
  		}

 		reverse_proxy  https://www.xxx.cn  { #伪装地址,示例中是博客网址,和代理域名保持一致
   			header_up  Host  {upstream_hostport}
   			header_up  X-Forwarded-Host  {host}
  		}
	}
}