Authentication occurs during the initial HTTP/3 handshake. A Hysteria client MUST send a specific POST request to the server. If the server validates the credentials, it responds with a unique HTTP status code 233 HyOK.
Client Authentication Request
Method: POST
Path: /auth
Host: hysteria
Required Headers:
Hysteria-Auth: The authentication credentials.Hysteria-CC-RX: The client's maximum receive rate in bytes per second (use 0 if unknown).Hysteria-Padding: (Optional) A random padding string to obfuscate request patterns.
Server Authentication Response
Status Code: 233 HyOK
Required Headers:
Hysteria-UDP: true or false (indicates if the server supports UDP relay).Hysteria-CC-RX: The server's maximum receive rate in bytes per second. Special values:0: Unlimited bandwidth.auto: The server refuses to provide a value; the client must use its own congestion control.
Hysteria-Padding: (Optional) A random padding string.
Note: If the status code is anything other than 233, the client MUST consider authentication failed and disconnect. To prevent active probing, it is recommended that Hysteria servers host actual content or act as a reverse proxy.
// Client Request
POST /auth HTTP/3
Host: hysteria
Hysteria-Auth: [your_credentials]
Hysteria-CC-RX: 1000000
Hysteria-Padding: [random_string]
// Server Response
HTTP/3 233 HyOK
Hysteria-UDP: true
Hysteria-CC-RX: auto
Hysteria-Padding: [random_string]