How hynetworks/hysteria works
Hysteria 2 is a censorship-resistant proxy. A client command loads configuration, establishes a QUIC-based core connection, and exposes it through proxy, forwarding, or tunnel modes; a server accepts sessions and provides proxying and related services. The README documents SOCKS5, HTTP, TCP/UDP forwarding, Linux TProxy, TUN, and customized QUIC. Authentication, access control, traffic logging, congestion control, masquerading, and NAT traversal are additional capabilities. Several domain branches are represented from documentation and the file tree; their internal wiring was not sampled, so unsupported links are omitted.
Main entry points: cmd/client.go Client CLI · server/server.go Server Session · client/client.go Client Session · cmd/server.go Server CLI
Components 23
Application
- Client CLI
app/cmd/client.go - Server CLI
app/cmd/server.go - Share URLs
app/internal/url/url.go
QUIC Core
- Client Session
core/client/client.go - Server Session
core/server/server.go - UDP Sessions
core/server/udp.go - Congestion Control
core/internal/congestion/bbr/bbr_sender.go - Proxy Protocol
core/internal/protocol/proxy.go
Proxy Extensions
- Outbound Routing
extras/outbounds/ob_direct.go - Access Rules
extras/outbounds/acl/compile.go - Authentication
extras/auth/http.go - Traffic Logging
extras/trafficlogger/http.go - Masquerade
extras/masq/server.go - NAT Traversal
extras/realm/client.go - Obfuscation
extras/obfs/conn.go - Speed Test
extras/outbounds/speedtest/server.go
Network Modes
- HTTP Proxy
app/internal/http/server.go - SOCKS5 Proxy
app/internal/socks5/server.go - TUN Interface
app/internal/tun/server.go - TCP/UDP Forwarding
app/internal/forwarding - Linux TProxy
app/internal/tproxy - TCP Redirect
app/internal/redirect
Other components
- Operator
Connections 24
- Operator → Client CLI: configures
- Operator → Server CLI: configures
- Client CLI → Client Session: creates client
app/cmd/client.go - Client CLI → TUN Interface: configures
app/cmd/client.go - HTTP Proxy → Client Session: dials through
app/internal/http/server.go - SOCKS5 Proxy → Client Session: dials through
app/internal/socks5/server.go - Client Session → Congestion Control: selects controller
core/client/client.go - Server Session → UDP Sessions: starts sessions
core/server/server.go - Server CLI → NAT Traversal: configures traversal
app/cmd/server.go - Client CLI → Share URLs: accepts share links
app/cmd/client.go - Client CLI → HTTP Proxy: offers mode
- Client CLI → SOCKS5 Proxy: offers mode
- Client CLI → TCP/UDP Forwarding: offers mode
- Client CLI → Linux TProxy: offers mode
- Client CLI → TCP Redirect: offers mode
- Server CLI → Server Session: runs server
- Server Session → Outbound Routing: routes traffic
- Server Session → Proxy Protocol: handles proxy protocol
- Server Session → Authentication: authenticates users
- Server Session → Access Rules: checks access
- Server Session → Traffic Logging: logs traffic
- Server CLI → Masquerade: configures disguise
- Client Session → Obfuscation: supports obfuscation
- Server Session → Speed Test: supports testing