Skip to content

Instantly share code, notes, and snippets.

@sxfmol
Last active December 7, 2022 14:23
Show Gist options
  • Save sxfmol/90550b33fd3470608ef16545937e5d39 to your computer and use it in GitHub Desktop.
Save sxfmol/90550b33fd3470608ef16545937e5d39 to your computer and use it in GitHub Desktop.
panel安装
https://trojanpanel.github.io/
安装bbr加速
https://www.linuxcapable.com/how-to-enable-tcp-bbr-on-debian-11-bullseye/
1:vps
vultr.com
https://www.vultr.com/?ref=8886099
2:安装go环境
https://www.vultr.com/docs/install-the-latest-version-of-golang-on-debian/
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version
wget https://go.dev/dl/go1.19.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
echo "export GOPATH=~/.go" >> ~/.profile
source ~/.profile
go version
3: 域名申请与配置
https://www.namesilo.com
4: caddy
https://github.com/caddyserver
最近有更新
https://github.com/klzgrad/naiveproxy
caddy 教程资料
https://docboon.github.io/downloads/docboon-caddyManual.release/html/ch01.html
Caddy前置 Caddy去除path
https://zelikk.blogspot.com/2022/05/v2ray-websocket-tls-caddy-path-data-flow.html
server安装
https://caddyserver.com/
https://caddyserver.com/docs/install#debian-ubuntu-raspbian
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
修改 /etc/caddy/Caddyfile
运行naiveproxy
https://github.com/klzgrad/naiveproxy
/usr/bin/xcaddy build --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive
:443, tockcube.top
tls [email protected]
route {
forward_proxy {
basic_auth user123 pass123
hide_ip
hide_via
probe_resistance }
reverse_proxy http://qq.com
}
#naiveproxy
https://github.com/klzgrad/naiveproxy
https://github.com/caddyserver/forwardproxy
Caddyfile文件内容:
:443, naive.buliang0.tk #你的域名
tls [email protected] #你的邮箱
route {
forward_proxy {
basic_auth user pass #用户名和密码
hide_ip
hide_via
probe_resistance
}
#支持多用户
forward_proxy {
basic_auth user2 pass2 #用户名和密码
hide_ip
hide_via
probe_resistance
}
reverse_proxy https://demo.cloudreve.org { #伪装网址
header_up Host {upstream_hostport}
header_up X-Forwarded-Host {host}
}
}
启动
/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
下载静态网页
mkdir -p /var/www/html
apt install wget zip unzip -y
wget https://github.com/arcdetri/sample-blog/archive/master.zip
Unzip the downloaded sample web pages:
unzip master.zip
cp -rf sample-blog-master/html/* /var/www/html/
关于naiveproxy
https://github.com/klzgrad/naiveproxy
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
./.go/bin/xcaddy build --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive
sudo setcap cap_net_bind_service=+ep ./caddy
./caddy start
https://iyideng.win/black-technology/cgfw/naiveproxy.html
mac v2ray客户端
https://github.com/Cenmrev/V2RayX
其他 关于caddy
If that didn't work 😶
It's okay, you can fix it! First check the following things:
Service status: systemctl status caddy
Logs: journalctl --no-pager -u caddy
Are your site's files readable by the caddy user and group? ls -la /var/www/html
Is the caddy home directory writeable? ls -la /var/lib/caddy
Ensure your domain's A and/or AAAA records point to your machine's public IP address: dig example.com
Are your ports 80 and 443 externally reachable, and is Caddy able to bind to them? Check your firewalls, port forwarding, and other network configuration.
其他
https://www.losem.tk/952/
@sxfmol
Copy link
Author

sxfmol commented Dec 1, 2022

curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

@sxfmol
Copy link
Author

sxfmol commented Dec 5, 2022

安装
caddy1已经被官方放弃了,现在只能使用caddy2,而且v1和v2不兼容。使用caddy最重要的原因还是应为配置简单,出问题的话直接检查caddy就行了。

caddy想要使用正向代理功能需要安装http.forwardproxy插件,而该插件是非标插件,官方提供的下载中没有此插件,只能手动编译。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment