mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6441] [Feature]: Advanced Subscription Customization (Injecting Fragment, Noise, ALPN) #4360
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4360
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Plus98ir on GitHub (Sep 9, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6441
Is your feature request related to a problem?
👋 Feature Request: Advanced Subscription Customization (Injecting Fragment, Noise, ALPN)
Hello again, and thank you for the amazing updates! The recent additions like the PWA have been fantastic. ❤️
🔍 Current Behavior
Currently, the subscription links generated by the panel provide standard, baseline configurations to clients (such as v2rayNG, v2rayN, etc.). However, there is no built-in way to append or inject advanced Xray parameters—like Fragment, Noise, or specific ALPN settings—directly from the panel into the exported subscription links.
💡 Proposed Solution
It would be a massive quality-of-life improvement for admins if we could customize the subscription output directly from the panel.
I suggest adding a "Subscription Customization" section (either globally or per-inbound) with the following capabilities:
Thank you for considering this suggestion and for your continuous hard work on this project! 🚀
Describe the solution you'd like
None
Alternatives you've considered
No response
Concrete use case
No response
Mockups, screenshots, or examples
No response
Which parts of the panel would this affect?
No response
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Sep 9, 2026):
Short answer: most of this already ships. FinalMask — which is Xray's current form of fragment and noise — can be injected into subscription output at three scopes, and ALPN at two, all server-side so clients get it on their next subscription update.
1. Globally, into every generated Xray JSON profile
Panel Settings → Sub Formats → Final Mask. It writes the
subJsonFinalMasksetting (internal/web/service/setting.go:125), andinternal/sub/json_service.go:686merges it into every outbound'sstreamSettings.finalmask:The field's own description in the panel (
internal/web/translation/en-US.json:1385): "Inject Xray finalmask TCP/UDP masks and QUIC parameters into every generated Xray JSON profile. Requires a client app that supports Xray JSON subscriptions and a recent Xray core."2. Per host
Hosts page → host → Final Mask (
Host.FinalMask,internal/database/model/model.go:1096). Unlike the global setting this reaches both output formats: merged into the JSON stream atinternal/sub/host_sub.go:150-158, and into the base64/raw share link'sfm=field atinternal/sub/host_sub.go:324. Hosts also carry a per-hostalpn(frontend/src/schemas/api/host.ts:33) plusmuxParams/sockoptParams(internal/database/model/model.go:1092-1093).3. Per inbound
The inbound edit form's transport section (
frontend/src/pages/inbounds/form/InboundFormModal.tsx:936). Note this one is a server-side change — the inbound then expects the mask as well — so for injection that only affects what clients receive, use (1) or (2).Available masks: TCP
fragment,sudoku,header-custom,xmc(frontend/src/schemas/protocols/stream/finalmask.ts:13); UDPsalamander,mkcp-legacy,header-custom,xdns,xicmp,noise,sudoku,realm; plus QUIC params (internal/sub/service.go:2485-2501). Documented at docs.sanaei.dev/docs/config/transports — "FinalMask replaces the per-transportheader/seedobfuscation that older Xray builds exposed" (docs/content/docs/en/config/transports.mdx:135).ALPN is not missing either: per inbound under TLS (
frontend/src/pages/inbounds/form/security/tls.tsx:274), emitted to share links asalpn=(internal/sub/service.go:1262-1263) and into JSON profiles (internal/sub/json_service.go:710), with the per-host value overriding it (internal/sub/service.go:1900).One caveat about v2rayNG/v2rayN specifically: on base64/raw subscriptions FinalMask travels as the compact
fm=<json>field, described in the source as "the compactfm=<json>share-link field used by v2rayN-compatible clients" (internal/sub/service.go:2635-2636). The panel emits it regardless; whether a given client applies it depends on that client's Xray core version. The JSON subscription format is the reliable carrier.The one part that genuinely does not exist
The legacy
freedom-outbound form of fragment/noise (outbounds[].settings.fragment/settings.noises) inside the generated client profile. The JSON template ships a fixeddirectoutbound with"noises": [](internal/sub/default.json:47-56) and nothing populates it — no Go file underinternal/referencesnoisesat all — whilesockoptis stripped from the proxy outbound (delete(streamSettings, "sockopt"),internal/sub/json_service.go:650). Those two fields are exposed only for the panel's own server-side outbounds (frontend/src/schemas/protocols/outbound/freedom.ts:57-58).So one question, and it decides whether anything is left to build here:
freedom-outboundfragment/noisesblock that clients like v2rayNG expose in their own settings? If it's the latter, this stays open as a narrow request; if FinalMask covers you, the three switches above work today.The global switch landed in
97f88fb1"feat(sub): modern xray JSON format with unified finalmask editor (#4912)" (2026-06-05), first released in v3.2.8 and present in v3.7.0.For the maintainer:
docs/content/docs/en/config/subscription.mdxcovers the subscription formats but never mentions the Sub Formats → Final Mask / Mux injection — FinalMask is only documented inconfig/transports.mdx, so this capability is easy to miss. Related earlier requests, both closed: #5075, #3203.Verdict: Already fixed
This reply was generated automatically; a maintainer may follow up.