TL;DR
Hysteria 2 是基于 QUIC 的高速代理协议(2024 重写,Hysteria 1 已停止维护)。优势:下载速度比 VLESS 快 30-50%(QUIC 拥塞控制 + 0-RTT 握手)。劣势:UDP 在墙内偶尔被限速。最佳用法:作为 VLESS Reality 的”高速补充”——4K 视频 / 大文件用 Hy2,日常浏览用 Reality。
Hysteria 2 是 2024 年发布的第二代 QUIC 代理协议。Hysteria 1 已停止维护。本篇按”为什么用 Hy2 / 与同类对比 / 配置 / 调优”四块讲清楚。
QUIC 与 TCP 的本质区别
VLESS Reality / Trojan 等基于 TCP:
- 握手 1-RTT
- 拥塞控制保守
- 无丢包恢复在应用层
Hysteria 2 基于 QUIC(UDP):
- 握手 0-RTT(首次连接后)
- 拥塞控制激进(BBR / Brutal)
- 应用层丢包恢复(FEC)
- 多路复用无队头阻塞
QUIC 的高速来自这些设计。代价:UDP 协议本身在某些网络上被深包检测限速。
Hysteria 2 vs 其它协议
| 维度 | Hysteria 2 | VLESS Reality | Trojan |
|---|---|---|---|
| 传输层 | UDP (QUIC) | TCP | TCP |
| 下载速度 | ★★★★★ | ★★★ | ★★★ |
| 响应延迟 | ★★★ | ★★★★ | ★★★★ |
| 反检测 | ★★★(OBFS) | ★★★★★ | ★★★ |
| 墙内稳定 | ★★★ | ★★★★★ | ★★★ |
| 海外稳定 | ★★★★★ | ★★★★★ | ★★★★ |
| 自建难度 | 中 | 中 | 低 |
| 适合场景 | 4K 视频 / 大下载 | 日常浏览 / 长会话 | 兼容老协议 |
服务端部署
安装 Hysteria 2
# Linux 一键脚本(apernet 官方)
bash <(curl -fsSL https://get.hy2.sh/)
# 或者从 GitHub Releases 手动
wget https://github.com/apernet/hysteria/releases/latest/download/hysteria-linux-amd64
chmod +x hysteria-linux-amd64
配置文件
/etc/hysteria/config.yaml:
listen: :443
# 必须有有效 TLS 证书
tls:
cert: /etc/letsencrypt/live/your-domain.com/fullchain.pem
key: /etc/letsencrypt/live/your-domain.com/privkey.pem
auth:
type: password
password: your-strong-password
# 可选:OBFS 混淆(墙内推荐)
obfs:
type: salamander
salamander:
password: another-strong-password
# 可选:限速(控制单用户带宽)
bandwidth:
up: 1 gbps
down: 1 gbps
# 可选:屏蔽某些目的(如不允许 BT)
acl:
inline:
- reject(geoip:cn)
- reject(suffix:torrent.com)
启动
systemctl enable --now hysteria-server
systemctl status hysteria-server
客户端配置(sing-box)
{
"outbounds": [{
"type": "hysteria2",
"tag": "hy2-jp",
"server": "your-vps.com",
"server_port": 443,
"password": "your-strong-password",
"obfs": {
"type": "salamander",
"password": "another-strong-password"
},
"tls": {
"enabled": true,
"server_name": "your-vps.com"
},
"up_mbps": 50,
"down_mbps": 500
}]
}
客户端配置(V2RayN / V2RayNG / Karing)
GUI 客户端:
- ”+” 新建节点
- 协议选 Hysteria 2
- 填:
- Server / Port
- Password
- OBFS Password(如果服务端开启)
- TLS SNI(服务端证书的域名)
- Up / Down 速率
- 保存 + 测试
OBFS 混淆深入
不开 OBFS 时:
- 抓包工具能看到清晰的 QUIC 握手 + DATAGRAM
- DPI 容易识别为 “Hysteria 2”
开 salamander OBFS 后:
- 所有 UDP 包内容变成随机字节
- DPI 看到的是”未知 UDP 流量”
- 大幅降低识别率
代价:
- 服务端 CPU 占用 +20-30%
- 客户端有少量额外开销
端口跳跃(Port Hopping)
防止端口级封锁:
listen: :20000-30000 # 服务端监听 10000 个端口范围
客户端配置:
{
"server": "your-vps.com",
"server_ports": "20000:30000",
...
}
客户端会每 30 秒随机切换一个端口。GFW 难以全部封锁。
性能调优
服务端
masquerade:
type: proxy
proxy:
url: https://www.bing.com
rewriteHost: true
# 不带 masquerade 时直连服务端 443 端口显示 Hysteria 默认页面
# 开 masquerade 后看到的是 Bing 镜像页面,增强伪装
客户端
- 调整 up_mbps / down_mbps 与你的实际带宽匹配
- 太高:CPU 占用激增
- 太低:限制速度
常见错误
”handshake failed: invalid certificate”
- 服务端 TLS 证书过期
- 客户端 server_name 与证书不匹配
- 客户端时间不准
”udp socket bound to port X but no traffic”
- VPS 防火墙未开 UDP 端口
- ISP 拦截 UDP 流量
”connection lost frequently”
- UDP 在你网络上被丢包
- 切到 TCP 协议(VLESS Reality)
何时选 Hysteria 2
| 场景 | 推荐协议 |
|---|---|
| 4K / 8K 视频 | Hysteria 2 |
| 大文件下载 | Hysteria 2 |
| 普通网页浏览 | VLESS Reality |
| 长会话(编程 / 视频会议) | VLESS Reality |
| 高度审查环境 | VLESS Reality + Reality vision |
| 服务端在墙内 | VLESS Reality(UDP 易被限速) |
| 服务端在海外 + 客户端在海外 | Hysteria 2 |
跨地区使用 Hysteria 2 节点
自建 Hy2 需要 VPS + 真域名 + 证书。机场服务的 Hy2 节点池通常做了端口跳跃 + OBFS。推荐 兼容 Clash / Singbox / V2Ray 的订阅 服务,多协议混合(VLESS Reality + Hysteria 2)切换。
来源与最后核对
- Hysteria 仓库:github.com/apernet/hysteria
- Hysteria 2 文档:v2.hysteria.network
- QUIC 协议规范:datatracker.ietf.org/doc/html/rfc9000
- BBR 拥塞控制:research.google/pubs/pub45646
本文最后实际验证日期:2026-05-18。