m-uising-box panel

Hysteria2 in m-ui: from certificate to a multi-server line

Hysteria2 is the protocol most people pick first for lossy or throttled links: QUIC-based, aggressive on retransmission, and simple for clients. Here is exactly what setting it up in m-ui involves.

1. A certificate, real or self-signed

Hysteria2 requires TLS. With a domain, Certificate → Issue gets a Let's Encrypt certificate (HTTP-01 or Cloudflare DNS-01) that renews itself. Without one, Certificate → Self-sign is one click; m-ui then marks the subscription so clients allow the insecure certificate (Clash Meta's skip-cert-verify, sing-box's insecure). Both paths are first-class; the dashboard's Quick Start accepts either.

2. The Hysteria2 line

Lines → Quick add → Hysteria2. The preset selects the protocol, TLS mode "certificate", and a free five-digit UDP port that no other line, the panel or another process on the server is using. The form then offers:

FieldWhat it does
PortThe UDP listen port. Open it on the firewall (UDP, not TCP).
Upload / download MbpsBandwidth hints handed to sing-box; 0 lets the congestion controller decide. Set them close to the server's real line rate if clients report unstable speed.
Obfuscation passwordEnables Salamander obfuscation with that password; clients receive it in the subscription. Leave empty for plain QUIC.
Port hoppingA range such as 20000-30000; see below.
ExitDirect, or one of your upstreams (WARP, a relay).
ServersWhich servers this line is deployed to — all, or a subset.

Saving renders the full configuration and hands it to sing-box's parser before anything is committed; a bad combination is rejected with sing-box's own message. The data plane then restarts for this new listener — with rollback to the previous configuration if the new one fails to start.

3. Port hopping

Hysteria2 port hopping lets clients rotate the destination UDP port inside a range, which helps where a single UDP flow gets throttled after a while. In m-ui you type the range once on the line. On each server the line is deployed to, m-ui installs a firewall redirect rule so every port in the range lands on the line's real listen port, and the subscription tells clients about the range (Clash Meta ports, sing-box and Shadowrocket equivalents). Removing the range removes the rule. Nothing to script by hand; the range is validated and normalised when you save.

4. Users

Tick "assign to all users" on the line, or assign per user. Each user already has a Hysteria2 password; quota, expiry, device limit and speed limits apply to this line like any other. Disabling a user swaps the inbound user table without restarting the listener, so other Hysteria2 sessions stay up.

5. What clients receive

All three come from the same address; the landing page offers one-tap import buttons and a QR code.

6. The same line on several servers

Deploy the line to all servers or pick some. The master pushes the line, the certificate settings and the user table to every node within 5 seconds; each node listens on the same port with its own certificate and its own port-hopping rule. The user's subscription then lists Hysteria2 – Tokyo, Hysteria2 – Frankfurt and so on, and their client picks by latency. Traffic from every server counts once against the user's quota.

Operations notes