apt-get install sudo
apt-get install bash
apt-get install curl
开启BBR(以下四条可以一起运行)
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
lsmod | grep bbr
https://www.v2fly.org/
访问https://github.com/v2fly/fhs-install-v2ray查看安装脚本,手动复制,自动复制带空格会失败
bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)
https://caddyserver.com/docs/install查看安装脚本
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
apt install caddy
配置文件访问https://guide.v2fly.org/advanced/wss_and_web.html
{
"inbounds": [
{
"port": 10000,
"listen":"127.0.0.1",
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "b888888d-7890-4d53-ad4f-8cda48b88888",
"alterId": 0
}
]
},
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/v2ray"
}
}
}
],
"outbounds": [
{
"protocol": "freedom",
"settings": {}
}
]
}
将以上代码覆盖粘贴到/usr/local/etc/v2ray/config.json
systemctl restart v2ray
Caddy 配置
# Caddy v2 (recommended)
https://baidu.com {
root * /usr/share/caddy
file_server
log {
output file /etc/caddy/caddy.log
}
tls {
protocols tls1.2 tls1.3
ciphers TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
curves x25519
}
@v2ray_websocket {
path /v2ray
header Connection Upgrade
header Upgrade websocket
}
reverse_proxy @v2ray_websocket localhost:10000
}
将以上代码覆盖粘贴到/etc/caddy/Caddyfile
systemctl restart caddy