mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-24 14:55:02 +03:00
fix(sub): keep serverNames out of a reality host's JSON client config (#6691)
* fix(sub): keep serverNames out of a reality host's JSON client config
A host with an SNI on a REALITY inbound set both serverName and the
server-side serverNames list on the per-host stream. Both the JSON and
Clash renderers have already reduced the stream to its client form by
then, so serverNames was never read, and the JSON subscription shipped
it in the proxy outbound. xray-core refuses to start that config
("non-empty serverNames, please use serverName instead"), which breaks
every JSON-subscription client on the inbound. Set serverName only.
Fixes #6690
* docs(sub): keep the host reality SNI comments within two lines
Same two-line comment cap the #6694 review applied.
This commit is contained in:
@@ -162,14 +162,13 @@ func applyHostStreamOverrides(ep map[string]any, stream map[string]any) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Reality SNI override (host only): JSON realityData reads serverNames and
|
||||
// clash reads serverName, so set both forms.
|
||||
// Reality SNI override (host only): the stream is already in client form, and xray
|
||||
// refuses a reality client carrying the server-side serverNames list (#6690).
|
||||
if isHostEndpoint(ep) {
|
||||
if sec, _ := stream["security"].(string); sec == "reality" {
|
||||
if rs, ok := stream["realitySettings"].(map[string]any); ok && rs != nil {
|
||||
if sni, ok := externalProxySNI(ep); ok {
|
||||
rs["serverName"] = sni
|
||||
rs["serverNames"] = []any{sni}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user