apt -y update && apt -y install wget socat curl && wget -c https://go.dev/dl/go1.21.1.linux-amd64.tar.gz -O - | tar -xz -C /usr/local && echo 'export PATH=$PATH:/usr/local/go/bin' > /etc/profile && source /etc/profile && go version
apt -y update && apt -y install wget socat curl && wget -c https://go.dev/dl/go1.21.1.linux-arm64.tar.gz -O - | tar -xz -C /usr/local && echo 'export PATH=$PATH:/usr/local/go/bin' > /etc/profile && source /etc/profile && go version
go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest && ~/go/bin/xcaddy build --output caddy --with github.com/mholt/caddy-l4 --with github.com/caddy-dns/cloudflare --with github.com/caddy-dns/duckdns --with github.com/mholt/caddy-dynamicdns --with github.com/mholt/caddy-events-exec --with github.com/WeidiDeng/caddy-cloudflare-ip --with github.com/mholt/caddy-webdav --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive && setcap cap_net_bind_service=+ep ./caddy && chmod +x caddy && mv caddy /usr/bin/
wget -P /etc/systemd/system https://raw.githubusercontent.com/TinrLin/NaiveProxy-installation/main/caddy.service
wget -O /usr/local/etc/caddy.json https://raw.githubusercontent.com/TinrLin/NaiveProxy-installation/main/caddy_443.json
wget -O /usr/local/etc/caddy.json https://raw.githubusercontent.com/TinrLin/NaiveProxy-installation/main/caddy_1234.json
/usr/bin/caddy run --environ --config /usr/local/etc/caddy.json
systemctl daemon-reload && systemctl enable --now caddy && systemctl status caddy