Are you an LLM? You can read better optimized documentation at /en\wiki\hysteria2.md for this page in Markdown format
Hysteria2 protocol
Hysteria2 is a high-speed network transport protocol built on QUIC, designed to deliver reliable high-speed connections over unstable, lossy networks.
Characteristics
- 🚀 Extreme speed: uses QUIC to reach very high throughput
- 📡 QUIC foundation: built on the Google QUIC stack, a modern network stack
- 🔄 Loss resilient: excellent packet loss recovery
- 📱 Mobile friendly: optimized for mobile networks
- 🎮 Low latency: supports 0-RTT connection establishment
- 🔐 Encryption built in: integrates ChaCha20
Configuration examples
Basic configuration
json
{
"outbounds": [
{
"type": "hysteria2",
"tag": "hysteria2-out",
"server": "example.com",
"server_port": 443,
"auth": "your-auth-string",
"up_mbps": 20,
"down_mbps": 100,
"tls": {
"enabled": true,
"server_name": "example.com"
}
}
]
}Full configuration
json
{
"outbounds": [
{
"type": "hysteria2",
"tag": "hysteria2-full-out",
"server": "example.com",
"server_port": 443,
"auth": "your-auth-string",
"up_mbps": 20,
"down_mbps": 100,
"socks5": {
"enabled": true,
"listen": "127.0.0.1",
"listen_port": 1080
},
"tls": {
"enabled": true,
"server_name": "example.com",
"certificate_path": "/path/to/certificate.crt",
"key_path": "/path/to/private.key"
}
}
]
}Without TLS (not recommended)
json
{
"outbounds": [
{
"type": "hysteria2",
"tag": "hysteria2-no-tls-out",
"server": "example.com",
"server_port": 443,
"auth": "your-auth-string",
"up_mbps": 20,
"down_mbps": 100
}
]
}Advanced configuration
Masquerading
json
{
"outbounds": [
{
"type": "hysteria2",
"tag": "hysteria2-obfs-out",
"server": "example.com",
"server_port": 443,
"auth": "your-auth-string",
"up_mbps": 20,
"down_mbps": 100,
"masquerade": "https://www.bing.com",
"tls": {
"enabled": true,
"server_name": "example.com"
}
}
]
}Dynamic bandwidth
json
{
"outbounds": [
{
"type": "hysteria2",
"tag": "hysteria2-dynamic-out",
"server": "example.com",
"server_port": 443,
"auth": "your-auth-string",
"up_mbps": 0,
"down_mbps": 0,
"tls": {
"enabled": true,
"server_name": "example.com"
}
}
]
}Load balancing across servers
json
{
"outbounds": [
{
"type": "hysteria2",
"tag": "hysteria2-1",
"server": "server1.example.com",
"server_port": 443,
"auth": "auth1",
"up_mbps": 20,
"down_mbps": 100
},
{
"type": "hysteria2",
"tag": "hysteria2-2",
"server": "server2.example.com",
"server_port": 443,
"auth": "auth2",
"up_mbps": 15,
"down_mbps": 80
},
{
"type": "urltest",
"tag": "auto",
"outbounds": ["hysteria2-1", "hysteria2-2"],
"url": "http://www.gstatic.com/generate_204",
"interval": 300
}
]
}Protocol details
Why QUIC
- 0-RTT connections: very low connection setup latency
- Multiplexing: avoids head-of-line blocking
- Congestion control: advanced algorithms built in
- Connection migration: connections survive network changes
- Forward error correction: lost packets are recovered automatically
Bandwidth settings
up_mbps: upstream bandwidth limit (Mbps)down_mbps: downstream bandwidth limit (Mbps)0: adjust bandwidth automatically- Sensible values improve both performance and stability
Encryption
- ChaCha20-Poly1305: a high-performance cipher
- AEAD: guarantees data integrity
- Key derivation: dynamic key generation
Use cases
High bandwidth
- Large file downloads and uploads
- Video streaming
- Cloud backup and sync
Unstable networks
- Mobile networks (4G/5G)
- Wireless networks
- High packet loss links
Game acceleration
- Real-time competitive games
- Cloud gaming
- Live streaming
Enterprise
- Video conferencing
- Remote work
- Data synchronization
Pros and cons
Pros
- Extremely fast, making full use of available bandwidth
- Excellent packet loss resilience
- Very low connection setup latency
- Friendly to mobile networks
- A modern protocol stack
- Built-in bandwidth control
Cons
- A relatively new protocol with an immature ecosystem
- May be identified on some restrictive networks
- Requires UDP, so network requirements are higher
- Configuration is fairly complex
- Some network equipment may not support QUIC
Comparison with other protocols
| Protocol | Speed | Latency | Stability | Compatibility | Anti-detection |
|---|---|---|---|---|---|
| Hysteria2 | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐ |
| VLESS | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| VMess | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
| Trojan | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
| Shadowsocks | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐ |
Performance tuning
Bandwidth strategy
- Be conservative: set slightly below your real bandwidth
- Adapt dynamically: let the protocol adjust to conditions
- Time-based tuning: use different settings at different times
- Spread load: multiple servers improve stability
Network
- Make sure UDP ports are open
- Configure an appropriate MTU
- Optimize DNS resolution speed
- Prefer nearby server nodes
Client
- Enable UDP forwarding
- Configure sensible timeouts
- Test network quality periodically
- Keep the client up to date
Security recommendations
- TLS: always enable TLS in production
- Authentication: use strong authentication strings
- Server hardening: keep the server configuration secure
- Access control: restrict which users may connect
- Traffic monitoring: watch for abnormal traffic patterns
Troubleshooting
Connection problems
- Check whether the UDP port is open
- Confirm the server supports Hysteria2
- Verify the authentication credentials
- Check firewall rules
Speed problems
- Adjust the bandwidth limits
- Choose a closer server
- Check local network conditions
- Optimize the DNS configuration
Stability problems
- Lower the bandwidth settings
- Enable masquerading
- Check the packet loss rate
- Switch to a backup server
Deployment notes
Server requirements
- UDP support
- Sufficient bandwidth
- A stable network
- A modern OS kernel
Client requirements
- QUIC support
- Permission to send UDP traffic
- Adequate system resources
- The latest client version