Skip to content

Hysteria 2 nodes

A Hysteria 2 node carries proxy traffic over QUIC on a UDP port. katana serves one when a node’s [node.api].node_type is Hysteria2 (also accepted: hysteria, hy2, in any case), or, on helium, which sets no node_type, when the panel’s node config says hysteria2. The panel still supplies the users and receives the traffic reports, as it does for every node. On Xboard and V2board the listener itself needs a few settings that the panel does not send, so they live in the node’s [node.hysteria] table. helium describes all of them but the congestion control; see Panel-described nodes.

This page covers both ways to run such a node: with the panel describing it, or with katana describing it from the config file. It lists every key under [node.hysteria], what the panel must send, how an official Hysteria 2 client authenticates, and the errors you are likely to meet. For the protocol itself as etemenanki-app serves it, see Hysteria 2 in etemenanki-app.

  • It listens on UDP. katana binds listen_ip:port as a UDP socket, so a Hysteria 2 node can share its port number with a TCP node on the same address, for example a Trojan node on TCP 443 and a Hysteria 2 node on UDP 443.
  • It always uses TLS. The TLS handshake is part of QUIC, so there is no plaintext mode. Every Hysteria 2 node needs [node.controller.cert] with mode = "file", whatever the panel says about TLS.
  • Its user list is updated in place. When the panel’s user list changes, the UDP socket stays bound and the remaining users stay connected; a removed user’s connections end.
  • --test can check it. The settings under [node.hysteria] are local, so katana --test checks them and reads the certificate and key. For other node types, --test cannot check what the panel will send. A helium Hysteria 2 node is one of those: --test checks its congestion alone, and refuses every other [node.hysteria] key.

On Xboard and V2board, the key [node.hysteria].port decides where the node’s port and obfuscation come from. A helium node is always described by its panel, and [node.hysteria].port is refused there:

flowchart LR
  A["node_type = Hysteria2"] --> B{"[node.hysteria] port"}
  B -->|"0"| C["Panel node config: port, obfs"]
  B -->|"non-zero"| D["[node.hysteria]: port, obfs"]
  C --> L["QUIC listener"]
  D --> L
  E["[node.hysteria]: credential, udp, masquerade, congestion"] --> L
  F["[node.controller.cert]"] --> L
  G["Panel user list"] --> L
Panel-described (port = 0) Locally described (port non-zero) helium
Listening port The panel’s port [node.hysteria].port The panel’s port
Obfuscation The panel’s obfs and obfs-password [node.hysteria].obfs and obfs_password The panel’s obfs
Rates (up_mbps, down_mbps, ignore_client_bandwidth) The panel’s, each overridden by [node.hysteria] when set there [node.hysteria] only The panel’s only
Node-config request (/UniProxy/config, helium’s config) Sent on every poll Never sent Sent on every poll
User list and traffic reports From and to the panel From and to the panel From and to the panel
Audit rules from the node’s routes (Xboard) Loaded Not loaded; only rule_list_path applies None sent; only rule_list_path applies
UDP relay (udp, udp_idle_timeout) and masquerade [node.hysteria] [node.hysteria] The panel’s udp and masquerade
credential [node.hysteria] [node.hysteria] Always the UUID
congestion [node.hysteria] [node.hysteria] [node.hysteria]

Describe the node locally when you want the port and obfuscation kept in the config file rather than in the panel. The panel must still know the node: katana asks it for the users of node_id and reports their traffic under that ID. On Xboard the lookup also uses the node type, so the node must exist there as a Hysteria node.

This file serves one Hysteria 2 node on UDP port 443 with Salamander obfuscation and UDP relay. Users and traffic reports go through an Xboard panel.

/etc/katana/config.toml
# katana Hysteria 2 node described locally: the port and the obfuscation
# come from [node.hysteria], so katana never asks the panel for the node's
# config. The panel still supplies the user list and receives the traffic
# reports for node_id 1.
[log]
level = "info"
[[node]]
panel_type = "NewV2board"
[node.api]
host = "https://panel.example.com"
node_id = 1
key = "replace-with-the-panel-key"
# Sent to the panel as node_type=hysteria2, which Xboard maps to its
# "hysteria" node type.
node_type = "Hysteria2"
[node.controller]
listen_ip = "0.0.0.0"
update_periodic = 60
# Every Hysteria 2 node needs a certificate file. Clients that verify it
# also need a subjectAltName for the name they use as SNI.
[node.controller.cert]
mode = "file"
cert_file = "/etc/katana/cert/fullchain.pem"
key_file = "/etc/katana/cert/privkey.pem"
[node.hysteria]
# Non-zero: this node is described here. Clients connect to UDP port 443.
port = 443
# The client's auth string is the user's UUID (the default).
credential = "uuid"
# Relay UDP as well as TCP; a quiet UDP session ends after 60 seconds.
udp = true
udp_idle_timeout = 60
# Salamander obfuscation. Clients need the same password.
obfs = "salamander"
obfs_password = "replace-with-a-long-random-password"
# Answer clients "auto": no fixed rate either way, and Cubic congestion
# control (both the defaults). With ignore_client_bandwidth = false, a client
# that declares its download rate is sent to at that rate, up to up_mbps.
ignore_client_bandwidth = true
congestion = "cubic"
# What anyone without a valid credential sees.
[node.hysteria.masquerade]
status = 404
body = "<html><body><h1>404 Not Found</h1></body></html>\n"
content_type = "text/html; charset=utf-8"
  1. Check the file. --test reads the certificate and key and checks every key under [node.hysteria]. It does not contact the panel.

    Terminal window
    katana --test -c /etc/katana/config.toml

    A valid file prints Configuration OK and exits with status 0. An invalid one prints the reason to stderr and exits with status 1:

    configuration error: node 1: udp_idle_timeout must be between 2 and 600 seconds
  2. Start katana. Once the panel has returned the user list, the node binds its socket and logs the address it bound, [::] on a dual-stack host (see Nodes):

    INFO katana::manager::node: node 1: listening on [::]:443

    If the node cannot come up, for example because the panel is unreachable or the port is taken, katana logs why and tries again. Common errors lists the messages.

  3. Open the port. Allow inbound UDP 443 in the host firewall and in any cloud security group. A rule for TCP 443 does not cover it.

  4. Connect a client. Give clients the user’s UUID as the auth string, the obfuscation password and the server name on the certificate. Authenticating clients has a complete client config.

To let the panel describe the same node instead, set port = 0 (or leave it out) and remove obfs and obfs_password:

/etc/katana/config.toml
[node.hysteria]
port = 0
udp = true

katana builds a Hysteria 2 listener from this table on a node whose node_type is a Hysteria 2 value. --test and a reload check congestion on every node, whatever its type. On a helium node only congestion may be set: helium’s node config describes the rest, and any other key below is refused, as the helium tab of Panel-described nodes shows. Unknown keys are refused, so a typo such as obsf stops --test with a parse error that names its line.

KeyTypeRequiredDefaultDescription
portu16no0The UDP port to listen on. A non-zero value makes this a locally described node: katana builds the node from this table and never calls the panel's node-config endpoint. 0 asks the panel for the port and the obfuscation, as for every other node type. A helium node refuses it: its panel always describes the node.
credentialstring (enum)no""How the client's auth string identifies a user. "" or uuid: the whole string is the user's UUID. user_pass: the string is label:uuid, split on the first colon, where the label is <uuid>@v2board.user on Xboard and V2board; the label is compared case-insensitively. The value itself is case-sensitive; anything else fails with unknown hysteria credential kind "…" (expected "uuid" or "user_pass"). A helium node refuses the key, so its users authenticate with their UUID alone.
udpboolnofalseRelay UDP as well as TCP. Off by default, unlike the upstream server: the listener then tells clients that UDP is disabled and relays TCP only. A helium node refuses it: the panel's udp says whether UDP is relayed.
udp_idle_timeoutu64no60Seconds a UDP session may carry no datagrams before katana closes it. Accepted range 2 to 600 (udp_idle_timeout must be between 2 and 600 seconds). The default 60 applies only when udp = true: the key is only valid with UDP on, and setting it while udp is off fails with udp_idle_timeout is set but udp is not enabled. A helium node refuses it: the panel's udp.idle_timeout_secs sets the timeout, held to the same range.
obfsstring (enum)no—Packet obfuscation for a locally described node. The only accepted value is salamander, in lowercase; anything else fails with unknown obfs "…" (expected "salamander"). With port = 0 the panel's obfuscation applies instead. A helium node refuses it: the panel's obfs sets the obfuscation.
obfs_passwordstringdepends—The Salamander key shared with every client, at least 4 bytes (obfs_password must be at least 4 bytes for salamander). Required when obfs is set. Setting it without obfs is refused with obfs_password is set but obfs is not; did you mean obfs = "salamander"?, so a typo cannot quietly turn obfuscation off. Same local-node rule as obfs, and a helium node refuses it too.
masqueradetableno{}The HTTP/3 response given to every request that does not carry a valid credential, written as [node.hysteria.masquerade]. Applies to locally described nodes and to nodes Xboard or V2board describe. A helium node refuses the table, with any key: the panel's masquerade sets the answer.
up_mbpsu64no—The most the node sends one client at, in Mbit/s. Overrides the panel's up_mbps. 0 is no cap. Used only when a fixed rate is agreed with a client, that is when ignore_client_bandwidth ends up false. A helium node refuses it: the panel's up_mbps applies.
down_mbpsu64no—The most the node receives at, in Mbit/s, told to every client in the handshake answer. Overrides the panel's down_mbps. 0 is no limit. A helium node refuses it: the panel's down_mbps applies.
ignore_client_bandwidthboolno—Answer every client with auto, so neither end sends at a fixed rate and both use congestion. Overrides the panel's value. Unset here and at the panel, it is true. With false, a client that declares its download rate is sent to at that rate, capped by up_mbps. A helium node refuses it: the panel's ignore_client_bandwidth applies, true when the panel leaves it out.
congestionstring (enum)no"cubic"Congestion control when no fixed rate is agreed: cubic, bbr or reno, in lower case. Anything else fails --test with unknown hysteria congestion "…" (expected "cubic", "bbr" or "reno"), on every node, Hysteria 2 or not. No panel sends it. The one key of this table a helium node may set.

A Hysteria 2 server looks like an HTTP/3 web server. A request with a wrong or missing credential, or aimed at any other path, gets this fixed response, so a wrong password looks exactly like a wrong URL. Leaving the table out, or setting only some keys, gives the missing keys the defaults below. Those defaults match the reply of an unconfigured upstream server. On helium the panel’s masquerade gives the response instead, and this table is refused.

KeyTypeRequiredDefaultDescription
statusu16no404The HTTP status code. Any code from 100 to 999 except 233, which is the Hysteria 2 authentication success status and would tell the prober it had authenticated (masquerade.status must not be 233, the Hysteria 2 authentication success status). Out-of-range values fail with masquerade.status is <code>, but must be 100 to 999.
bodystringno"404 page not found\n"The response body, sent as is with a matching Content-Length.
content_typestringno"text/plain; charset=utf-8"The value of the Content-Type header.

katana serves the masquerade only inside QUIC. It opens no TCP listener for it. With Salamander on, a client without the obfuscation password cannot finish the QUIC handshake, so it never reaches the masquerade at all.

The certificate comes from the node’s [node.controller.cert], never from the panel. For a Hysteria 2 node:

Key Requirement
mode Must be "file". The default "none" and the ACME modes "dns", "http" and "tls" all fail with hysteria2 node requires cert.mode = "file".
cert_file PEM certificate chain, leaf first. Both paths must be set, or the node fails with TLS node requires cert.cert_file and cert.key_file. A DER file fails with hysteria2: the certificate file contains no certificates.
key_file PEM private key in PKCS#8, PKCS#1 or SEC1 form, matching the certificate.
reject_unknown_sni Must stay false. true fails with node requests kernel-unsupported feature: cert.reject_unknown_sni.

The listener speaks TLS 1.3 only and offers the ALPN h3.

katana reads the files when the node starts and again at every poll, so a renewed certificate saved to the same paths reaches new connections at the next poll, and open connections continue. Replace the certificate and key in one step, so that katana never reads one without the other.

With port = 0, katana takes the port and the obfuscation from the panel on every poll, and on Xboard and V2board also the rates up_mbps, down_mbps and ignore_client_bandwidth (see Rates and congestion control). helium, where a node is always panel-described, also sends the UDP relay and the masquerade. katana does not use anything else the panel sends about the node: its TLS settings, server name and port-hopping settings have no effect on the listener. Port hopping is a client feature; on the server you forward the port range to the node’s port with a firewall rule. A change to the node’s host or server_name on Xboard therefore changes nothing on the node.

Create a node of type Hysteria in the panel and set its protocol version to 2. katana reads these fields from GET /api/v1/server/UniProxy/config:

Field Panel setting katana uses it as
server_port The node’s listening port (not the port shown to users) The UDP port, 1 to 65535. Any other value, 0 included, refuses the node: server_port 0 is not a port (1 to 65535).
obfs salamander when obfuscation is on, null when off The obfuscation type
obfs-password The obfuscation password The Salamander key
up_mbps, down_mbps Bandwidth up and down The node’s rates. Xboard sends no ignore_client_bandwidth, so they take effect only with [node.hysteria] ignore_client_bandwidth = false.

In the katana config, set panel_type = "NewV2board" and node_type = "Hysteria2" or "hysteria". katana sends node_type to the panel lowercased, and Xboard maps hysteria2 to its hysteria type. Xboard does not know hy2, so it rejects every request from a node configured that way.

Xboard subscription links put the user’s UUID in the Hysteria 2 password, which matches katana’s default credential.

katana checks the panel’s values as it reads the answer, with the same rules as the local keys: unknown obfs for any type other than salamander, and obfs_password must be at least 4 bytes for salamander for a short key. On Xboard and V2board the refusal is logged after parse UniProxy config response:, as in node 1: node_info failed: parse UniProxy config response: unknown obfs "x" (expected "salamander"); retrying in 1s. helium’s UDP relay and masquerade are held to the rules of udp_idle_timeout and [node.hysteria.masquerade] too. The local obfs and obfs_password keys are used only by a locally described node; --test and the reload check still check them.

A Hysteria 2 client sends one auth string. [node.hysteria].credential decides how katana finds the user in it:

credential Auth string on Xboard / V2board
"" or "uuid" (default) <uuid>
"user_pass" <uuid>@v2board.user:<uuid>
  • In uuid mode the whole string is compared byte for byte with each user’s UUID as the panel lists it, so letter case matters. Use this mode unless your clients were set up for upstream’s userpass authentication.
  • In user_pass mode katana splits the string at the first colon. The part before it is the user’s label, compared case-insensitively: <uuid>@v2board.user on UniProxy panels. The part after it is the UUID. This is the upstream server’s userpass format, so a client written for an upstream server works unchanged.
  • In both modes, katana reports each user’s traffic under their panel user ID.
  • On helium credential cannot be set, so the mode is always uuid. katana writes each UUID from helium in its lowercase hyphenated form, such as 11111111-2222-3333-4444-555555555555, and that is the auth string clients send.

A wrong auth string gets the masquerade response. The official client then reports the masquerade’s status code, for example authentication error, HTTP status code: 404.

client.yaml
server: proxy.example.com:443
auth: 11111111-2222-3333-4444-555555555555
obfs:
type: salamander
salamander:
password: replace-with-a-long-random-password
tls:
sni: proxy.example.com
socks5:
listen: 127.0.0.1:1080

Leave out the obfs block when the node has no obfuscation. A client whose obfuscation setting does not match the node’s never completes the QUIC handshake. It reports a timeout, not an authentication error.

udp is off by default. katana then tells each client, in the authentication reply, that UDP is disabled, and relays TCP only. The upstream server enables UDP by default, so set udp = true if your users expect it. With UDP on, katana closes a UDP session that has carried no datagrams for udp_idle_timeout seconds, checked once per second. On helium the panel’s udp turns the relay on, and its idle_timeout_secs is the idle timeout.

A Hysteria 2 client tells the server, in its authentication request, the rate it can receive at. The server answers with the rate it can receive at, or with auto. Where both ends agree on a rate, the sender uses Hysteria’s Brutal congestion control, which sends at that rate whatever the packet loss; otherwise both ends use ordinary congestion control. katana decides its side from three values, each taken from [node.hysteria] when set there and from the panel otherwise; on helium, from the panel alone:

Value Default Meaning
ignore_client_bandwidth true Answer auto: no fixed rate in either direction
up_mbps 0, no cap The most katana sends one client at
down_mbps 0, no limit The receive rate katana tells clients
ignore_client_bandwidth The client declares a receive rate katana answers katana sends with
true (the default) any auto congestion
false yes down_mbps in bytes per second, or 0 Brutal at the client’s rate, capped by up_mbps
false no down_mbps in bytes per second, or 0 congestion

congestion is cubic by default; bbr and reno are the alternatives. The client decides how it sends to katana from katana’s answer and its own settings.

The defaults keep a node on auto with Cubic. Xboard and V2board send up_mbps and down_mbps but no ignore_client_bandwidth, so a node keeps answering auto until you set ignore_client_bandwidth = false in [node.hysteria] or the panel sends false. helium always sends all three: ignore_client_bandwidth is true unless it says false, and its rates are whole numbers. Xboard’s and V2board’s figures are read as numbers or numeric strings, and a figure below 1 Mbit/s counts as none.

A change in the panel’s rates reaches connections made after it; open connections keep the rate they agreed. A Hysteria 2 user’s speed limit still applies on top: katana’s per-user token bucket, described in Speed limits, caps what the user moves whatever rate was agreed.

These limits apply to every Hysteria 2 node and cannot be changed:

Limit Value When it is reached
QUIC connections per node 262,144 A new connection’s handshake is refused.
Live proxy streams and UDP sessions per node 4,194,304 A new stream is reset, and a new session’s packets are dropped. The client’s other streams continue.
Concurrent streams per QUIC connection 65,536 The client waits for a free stream before opening another.
UDP sessions per QUIC connection 256 A new session’s packets are dropped.
QUIC idle timeout 30 s A connection that receives no packets for 30 seconds, or for the client’s own idle timeout if that is shorter, is closed. Client keep-alives count as packets.

None of them is per user. Refusals are logged at debug level, for example hysteria2: refusing a connection; the listener is full or stopping.

A Hysteria 2 stream goes through the same path as a flow on any other node: admission, the audit rules and routing, and the user’s speed limit. [node.controller].disable_sniffing = true turns off sniffing for Hysteria 2 streams too. A locally described node on Xboard never fetches the node config, so it has no audit rules from the panel’s routes; only the file named by rule_list_path applies. helium sends no routes, so the same holds for every helium node.

Change When it takes effect
The panel’s user list At the next poll, without rebinding. Remaining users stay connected; a removed user’s connections end.
The panel’s port or obfuscation (port = 0, or helium) At the next poll, dropping every connection on the node
helium’s masquerade, or its UDP relay turned on or off At the next poll, dropping every connection on the node, so that no client connected before keeps the old answer or the old UDP setting
The panel’s rates (port = 0, or helium), or helium’s UDP idle timeout alone At the next poll, for new connections. Open connections keep their rate and timeout.
Any key under [node.hysteria] in the file: port, credential, udp, udp_idle_timeout, obfs, obfs_password, the masquerade, up_mbps, down_mbps, ignore_client_bandwidth or congestion At once, dropping every connection on the node. The node gets a new panel client, which reads the node and its users again: on Xboard and V2board the client completes the panel’s description with this block. Setting or clearing port switches between the local and the panel description. On helium only congestion can be edited this way; adding any other key refuses the reload.
[node.controller].disable_sniffing or [node.controller.cert] in the file At once, dropping every connection on the node
[node.api].speed_limit in the file At once, without rebinding. Open connections stay and run at the new rate.

A config reload checks the values under [node.hysteria] before it applies anything. A saved edit that does not build, for example udp_idle_timeout = 1, refuses the whole reload with reload: node <name>: udp_idle_timeout must be between 2 and 600 seconds; keeping current config, and every node keeps running as it was. On a helium node, a key other than congestion refuses the reload the same way, with the message shown under Panel-described nodes. Run katana --test before you save.

Hot reload describes the whole reload process.

Errors from --test and from a starting node are prefixed with the node, for example configuration error: node 1: ….

Message Cause Fix
hysteria2 node requires cert.mode = "file" No certificate is configured, or an ACME mode is set. Set [node.controller.cert] with mode = "file", cert_file and key_file.
No such file or directory (os error 2) The certificate or key path does not exist. Check both paths; use absolute paths.
hysteria2: the certificate file contains no certificates cert_file is not a PEM certificate. Point it at the PEM chain, not a DER file or the key.
hysteria2: the key file contains no private key key_file holds no PEM private key, for example because it points at the certificate. Point it at the PEM key.
hysteria2: certificate and key do not match: … key_file belongs to another certificate. Use the key issued with this certificate.
obfs_password is set but obfs is not; did you mean obfs = "salamander"? A password without a type, locally or from Xboard with obfuscation switched off. Add obfs = "salamander", or remove the password.
unknown obfs "Salamander" (expected "salamander") Wrong spelling or case, or an Xboard node on protocol version 1. Write salamander in lowercase; set the Xboard node to version 2.
obfs_password must be at least 4 bytes for salamander The key is shorter than 4 bytes or missing. Use a long random value, for example from openssl rand -base64 24.
udp_idle_timeout is set but udp is not enabled udp_idle_timeout without udp = true. Set udp = true, or remove the timeout.
udp_idle_timeout must be between 2 and 600 seconds The value is outside 2 to 600. Pick a value in range.
unknown hysteria credential kind "UUID" (expected "uuid" or "user_pass") The value is not one of the accepted strings. It is case-sensitive. Use uuid or user_pass.
masquerade.status must not be 233, the Hysteria 2 authentication success status The masquerade status is 233. Use another status, such as 404.
masquerade.status is 1000, but must be 100 to 999 The masquerade status is outside 100 to 999. Use a real HTTP status code.
unknown hysteria congestion "BBR" (expected "cubic", "bbr" or "reno") congestion is not one of the accepted values. It is case-sensitive. --test checks it on every node, not only on Hysteria 2 nodes. Use cubic, bbr or reno.
[node.hysteria] udp is set, but a helium node's protocol is described by the panel; remove it (of [node.hysteria], only congestion is this host's to choose) A helium node sets a [node.hysteria] key other than congestion, or node_type; the message names the key. Remove the key, and set what it said in helium.
inbound <tag>: binding <address> failed: Address already in use (os error 98) Another process or node already holds that UDP port on listen_ip. Free the port or choose another.

A start that fails at the panel or at the listener is logged and tried again. node 1: node_info failed: …; retrying in <N>s means the panel’s node config could not be fetched or read, or that katana refused it, with the reason after parse UniProxy config response:, node 1: user_list failed: …; retrying in <N>s means the same for the user list, and node 1: initial start failed: …; retrying in <N>s means the node could not be built or bound. The first retry comes after 1 second, and the wait doubles after each failure up to 60 seconds, or up to update_periodic if that is shorter. Each attempt asks the panel again for the user list and, on a panel-described node, for the node config. Saving an edit to the node’s [[node]] entry retries at once, so you can fix the cause in the file without restarting katana. A change that cannot be applied later, for example an obfuscation from the panel that katana refuses, is logged, as node 1: node_info: parse UniProxy config response: … for that one, and katana keeps its last settings and tries again at the next poll.

On the client side:

Client symptom Cause
authentication error, HTTP status code: 404 (or your masquerade status) The auth string does not match the credential mode, or the user is not in the panel’s list for this node.
A timeout, no authentication error The obfuscation setting or password differs from the node’s, the UDP port is blocked, or the node is not listening.
x509: certificate relies on legacy Common Name field, use SANs instead The certificate has no subjectAltName.