准备
安装 Hysteria 2
1 | # 方式一:官方脚本 |
安装 AnyTLS
1 | # 下载mihomo |
安装SSL证书
建立nginx配置文件
1 | sudo vi /etc/nginx/sites-enabled/<your_domain.com> |
内容,先别配置ssl,让certbot自己设置
1 | server { |
执行certbot申请证书
1 | sudo certbot --nginx -d <your_domain.com> |
将证书软链接到指定目录
1 | # 确保目录存在 |
Hysteria 2
配置
服务端
1 | sudo vi /etc/hysteria/config.yaml |
内容如下
1 | trafficStats: |
客户端
1 | hysteria2://user1:64_character_password@your_domain.com:30002/?sni=your_domain.com&insecure=0&udp=true&alpn=h3&obfs=salamander&obfs-password=32_character_password#Hy2 |
Systemd
创建service文件
1 | sudo vi /etc/systemd/system/hysteria.service |
内容如下
1 | [Unit] |
启动/验证
1 | # 启动 |
查看流量消耗
1 | curl http://127.0.0.1:10002/traffic |
AnyTLS
配置
服务端
1 | sudo vi /etc/mihomo/config.yaml |
内容如下
1 | mode: direct |
客户端
1 | anytls://uuid@your_domain.com:30003?security=tls&sni=your_domain.com&insecure=0&udp=true&fp=chrome#AnyTLS |
Systemd
创建service文件
1 | sudo vi /etc/systemd/system/mihomo-anytls.service |
内容如下
1 | [Unit] |
启动/验证
1 | # 启动 |
查看流量消耗
1 | curl http://127.0.0.1:10003/traffic |