Documentation
¶
Overview ¶
Package hysteria2 is the node's Hysteria2 engine (engine.Engine) on top of the hysteria core library (github.com/apernet/hysteria/core/v2).
One Engine serves every hysteria2 inbound on the node; each inbound is one core server on its own UDP port.
- Users: an immutable credential index (sha256(token) -> credential) behind an atomic pointer. A users-only Apply swaps it without touching the listener; a spec change restarts only that inbound.
- Kick: the core can only close a connection from inside LogTraffic, so dropping a credential from the index (or an explicit Kick token, or an expired term) makes the next packet of that connection fail.
- Traffic: per-credential atomic counters, reported from the user's side (core tx = up, core rx = down).
- Masquerade: the decoy over HTTP/3 (core MasqHandler) and HTTPS on TCP (masq.go).
- Egress: Env.Egress (internal/node/egress), with an IP-preserving sniffing RequestHook; explicit domain destinations are resolved by the node.
Index ¶
Constants ¶
const Protocol = "hysteria2"
Protocol is the plugin id this engine serves.
Variables ¶
var BindIP net.IP
BindIP is the local address the inbounds listen on (the QUIC UDP port and the TCP decoy). nil is all interfaces, which is what a node must do and the only value production ever has. Tests that run a real engine set it to a loopback address in TestMain: a test binary listening on every interface makes Windows ask for a firewall rule on each run.
var Factory engine.Factory = New
Factory is the engine.Factory the agent registers for "hysteria2".
Functions ¶
Types ¶
This section is empty.