zh

Hysteria2:基于QUIC的高速翻墙协议完整搭建教程

Hysteria2是一个基于UDP/QUIC协议的新型翻墙工具,专为高带宽场景设计。在国际线路质量较差(高丢包率)的情况下,Hysteria2利用QUIC的多路复用和拥塞控制优势,实现比TCP协议快2-5倍的实际下载速度。适合需要流畅观看YouTube 4K、Netflix等高清内容的用户。

Need this done for your project?

We implement, you ship. Async, documented, done in days.

Start a Brief

Hysteria2与TCP协议翻墙的速度差异

从中国到欧洲的国际线路,丢包率通常在3-8%之间,高峰期可达15%。TCP在高丢包环境下性能急剧下降(因为每个丢包都需要重传并减小拥塞窗口),而QUIC/UDP在相同丢包率下性能下降幅度小得多。

实测数据(上海到荷兰阿姆斯特丹,晚高峰):

  • Shadowsocks (TCP):丢包8%时,实测下载速度约5-10Mbps
  • Hysteria2 (QUIC):相同条件下,实测下载速度约25-50Mbps
  • VLESS+Reality (TCP+XTLS):约8-20Mbps

如果你的主要需求是流媒体,Hysteria2在带宽敏感场景下是最佳选择。如果更关注匿名性和稳定性,VLESS+Reality更合适。

服务端安装与配置

安装Hysteria2:

bash <(curl -fsSL https://get.hy2.sh/)

配置文件 /etc/hysteria/config.yaml:

listen: :443

tls:
  cert: /etc/hysteria/server.crt
  key: /etc/hysteria/server.key

auth:
  type: password
  password: YOUR-STRONG-PASSWORD

bandwidth:
  up: 100 mbps
  down: 100 mbps

masquerade:
  type: proxy
  proxy:
    url: https://www.cloudflare.com
    rewriteHost: true

生成自签名TLS证书:

openssl req -x509 -nodes -newkey ec -pkeyopt ec_paramgen_curve:P-256 -keyout /etc/hysteria/server.key -out /etc/hysteria/server.crt -days 3650 -subj '/CN=bing.com'

启动服务:

systemctl enable hysteria-server && systemctl start hysteria-server

客户端配置

Hysteria2有官方客户端和支持它的第三方客户端:

  • 官方CLI客户端:Linux/macOS/Windows均可用,配置文件驱动
  • Hiddify(推荐,图形界面):Android/Windows/macOS/Linux支持Hysteria2,一键添加服务器
  • NekoBox(Windows):支持Hysteria2的功能完整的代理客户端

Hiddify连接字符串格式:

hy2://PASSWORD@YOUR-VPS-IP:443?insecure=1#AnubizHost-HY2

insecure=1参数告诉客户端接受自签名证书。如果使用Let's Encrypt证书,删除此参数。

带宽设置:在客户端设置上行/下行带宽时,设置为你本地带宽的80%(避免超过VPS限制导致降速)。

适合Hysteria2的使用场景

最适合:

  • YouTube 4K、Netflix 1080p等高清视频流媒体
  • 大文件下载(GitHub Release、学术论文数据库)
  • 视频会议(Zoom、Google Meet)
  • 在线游戏(Hysteria2的低延迟特性对游戏有益)

不太适合:

  • 对延迟极度敏感的实时交易系统(QUIC的连接建立时间略长于TCP)
  • 需要最高匿名性的场景(VLESS+Reality更合适)
  • 移动数据网络(UDP在某些移动运营商会被QoS降速)

推荐的实践是:同时配置Hysteria2(用于高带宽需求)和VLESS+Reality(用于稳定性和匿名性),根据不同需求切换。AnubizHost的Small套餐($22.99/月)足以同时运行两个服务。

Why Anubiz Host

100% async — no calls, no meetings
Delivered in days, not weeks
Full documentation included
Production-grade from day one
Security-first approach
Post-delivery support included

Ready to get started?

Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.

Anubiz Chat AI

Online