Add hysteria2 realm service and support

This commit is contained in:
世界
2026-05-10 13:31:53 +08:00
parent 89d83aa6d2
commit 094808a4fa
20 changed files with 1167 additions and 33 deletions
+58 -2
View File
@@ -1,7 +1,8 @@
!!! quote "Changes in sing-box 1.14.0"
:material-plus: [hop_interval_max](#hop_interval_max)
:material-plus: [bbr_profile](#bbr_profile)
:material-plus: [bbr_profile](#bbr_profile)
:material-plus: [realm](#realm)
!!! quote "Changes in sing-box 1.11.0"
@@ -36,6 +37,13 @@
"bbr_profile": "",
"brutal_debug": false,
"realm": {
"server_url": "https://realm.example.com",
"token": "",
"realm_id": "",
"stun_servers": [],
"http_client": {}
},
... // Dial Fields
}
@@ -61,6 +69,8 @@
The server address.
Conflicts with `realm`.
#### server_port
==Required==
@@ -69,13 +79,15 @@ The server port.
Ignored if `server_ports` is set.
Conflicts with `realm`.
#### server_ports
!!! question "Since sing-box 1.11.0"
Server port range list.
Conflicts with `server_port`.
Conflicts with `server_port` and `realm`.
#### hop_interval
@@ -143,6 +155,50 @@ BBR congestion control algorithm profile, one of `conservative` `standard` `aggr
Enable debug information logging for Hysteria Brutal CC.
#### realm
!!! question "Since sing-box 1.14.0"
Connect to a Hysteria2 server through a Hysteria Realm rendezvous service.
The outbound queries the realm for the server's current public addresses, performs UDP hole-punching, and proceeds with the normal QUIC handshake.
Conflicts with `server`, `server_port` and `server_ports`.
The TLS SNI defaults to the host portion of `server_url`. Set `tls.server_name` to match the certificate the Hysteria2 server presents.
See [Hysteria Realm](/configuration/service/hysteria-realm/) for the rendezvous service.
#### realm.server_url
==Required==
Realm rendezvous service URL.
#### realm.token
Bearer token for the realm. Must match one of `users[].token` configured on the realm.
#### realm.realm_id
==Required==
The same slot identifier the target Hysteria2 server registered.
#### realm.stun_servers
==Required==
List of STUN servers (`host` or `host:port`) used to discover this client's public addresses.
Port defaults to `3478`.
#### realm.http_client
HTTP client used to talk to the realm.
See [HTTP Client](/configuration/shared/http-client/) for details.
### Dial Fields
See [Dial Fields](/configuration/shared/dial/) for details.
+58 -2
View File
@@ -1,7 +1,8 @@
!!! quote "sing-box 1.14.0 中的更改"
:material-plus: [hop_interval_max](#hop_interval_max)
:material-plus: [bbr_profile](#bbr_profile)
:material-plus: [bbr_profile](#bbr_profile)
:material-plus: [realm](#realm)
!!! quote "sing-box 1.11.0 中的更改"
@@ -36,6 +37,13 @@
"bbr_profile": "",
"brutal_debug": false,
"realm": {
"server_url": "https://realm.example.com",
"token": "",
"realm_id": "",
"stun_servers": [],
"http_client": {}
},
... // 拨号字段
}
@@ -59,6 +67,8 @@
服务器地址。
`realm` 冲突。
#### server_port
==必填==
@@ -67,13 +77,15 @@
如果设置了 `server_ports`,则忽略此项。
`realm` 冲突。
#### server_ports
!!! question "自 sing-box 1.11.0 起"
服务器端口范围列表。
`server_port` 冲突。
`server_port``realm` 冲突。
#### hop_interval
@@ -141,6 +153,50 @@ BBR 拥塞控制算法配置,可选 `conservative` `standard` `aggressive`。
启用 Hysteria Brutal CC 的调试信息日志记录。
#### realm
!!! question "自 sing-box 1.14.0 起"
通过 Hysteria Realm 会合服务连接 Hysteria2 服务器。
出站从 realm 查询服务器当前的公网地址,执行 UDP 打洞,然后进行常规的 QUIC 握手。
`server``server_port``server_ports` 冲突。
TLS SNI 默认使用 `server_url` 中的主机名。需设置 `tls.server_name` 以匹配 Hysteria2 服务器证书覆盖的名字。
会合服务参阅 [Hysteria Realm](/zh/configuration/service/hysteria-realm/)。
#### realm.server_url
==必填==
Realm 会合服务 URL。
#### realm.token
Realm 的 Bearer 令牌,需与 realm 上配置的 `users[].token` 之一匹配。
#### realm.realm_id
==必填==
目标 Hysteria2 服务器注册时使用的相同槽位标识符。
#### realm.stun_servers
==必填==
用于发现本客户端公网地址的 STUN 服务器列表(`host``host:port`)。
端口默认为 `3478`
#### realm.http_client
与 realm 通信使用的 HTTP 客户端。
参阅 [HTTP 客户端](/zh/configuration/shared/http-client/) 了解详情。
### 拨号字段
参阅 [拨号字段](/zh/configuration/shared/dial/)。