Skip to content

fix(sub): support Reality params for fallback inbounds via externalProxy#3991

Open
nnemirovsky wants to merge 2 commits intoMHSanaei:mainfrom
nnemirovsky:fix/fallback-inbound-subscription
Open

fix(sub): support Reality params for fallback inbounds via externalProxy#3991
nnemirovsky wants to merge 2 commits intoMHSanaei:mainfrom
nnemirovsky:fix/fallback-inbound-subscription

Conversation

@nnemirovsky
Copy link
Copy Markdown

Summary

  • Extract Reality settings (pbk, sni, sid, fp, spx) from stream config unconditionally so they are available when externalProxy overrides security to "reality" via forceTls. Previously these params were only read when security == "reality", which meant fallback inbounds with security: "none" couldn't generate correct subscription links even with externalProxy.
  • Add sni field to externalProxy entries to override the randomly selected serverName. This is needed when an inbound has extra serverNames for fallback routing (e.g., MTProto via VLESS fallback) that should not appear in client subscription links.
  • Fix genAllLinks crash (TypeError: undefined is not an object (evaluating 'x.length')) when remarkModel contains characters without a corresponding entry in the orders map.

Use case

When using VLESS Reality fallbacks to multiplex multiple services on port 443 (e.g., XHTTP + MTProto), the fallback target inbound must have security: "none" since the outer Reality inbound already handles TLS. Without this fix, subscription links for such inbounds either crash the UI or generate links without Reality params.

Extract Reality settings (pbk, sni, sid, fp, spx) from stream config
unconditionally rather than only when security is "reality". This allows
inbounds behind a VLESS fallback (security: "none") to generate correct
subscription links when externalProxy overrides security to "reality"
via forceTls.

Also fix genAllLinks crash when remarkModel contains characters without
a corresponding entry in the orders map (e.g., 'o' when externalProxy
is empty).
Allow externalProxy entries to specify a "sni" field that overrides the
randomly selected serverName in subscription links. This is needed when
an inbound has extra serverNames for fallback routing (e.g., MTProto)
that should not appear in client subscription links.
@nnemirovsky nnemirovsky force-pushed the fix/fallback-inbound-subscription branch from 98a001b to 0bc001b Compare April 2, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant