mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5636] [Bug]: Sniffing Settings in Inbound Configuration Are Ignored in Generated Xray Config #3929
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#3929
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 @parsa-fathi on GitHub (Jun 28, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5636
Describe the bug
Title: Sniffing Settings in Inbound Configuration Are Ignored in Generated Xray Config
Description:
I found an issue with the sniffing configuration in the 3x-ui panel.
When creating an inbound (for example, a VLESS inbound) and enabling Sniffing, the options selected in the panel do not appear to affect the final generated Xray configuration.
For example, if I enable sniffing and select only HTTP in the UI, the generated configuration still contains:
Regardless of which sniffing options are selected in the panel, the generated configuration always includes all three protocols (
http,tls, andquic) indestOverride.Steps to Reproduce:
Expected Behavior:
The generated
sniffing.destOverridefield should reflect the options selected in the panel. For example, if only HTTP is selected:Actual Behavior:
The generated configuration always contains:
regardless of the settings chosen in the UI.
Additional Notes:
If these sniffing options are intentionally forced by the application and cannot be customized, the current UI is misleading because it suggests that the user can control the individual sniffing protocols.
In that case, it may be better to remove the protocol selection menu entirely. Otherwise, if the options are intended to be configurable, there appears to be a bug causing the selected settings to be ignored.
How to reproduce the problem
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.4.1
Xray-core version
26.6.22
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 26.04 LTS
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
None
Before submitting
@github-actions[bot] commented on GitHub (Jun 28, 2026):
I traced the full sniffing pipeline against the v3.4.1 source and found a key discrepancy worth noting before diagnosing further.
What the code does
The sniffing value is stored verbatim: the frontend serialises the form selection in
normalizeSniffing()(frontend/src/lib/xray/inbound-form-adapter.ts:255), POSTs it as a JSON string, and the Go model stores it unchanged in thesniffingDB column. Config generation inGenXrayInboundConfig()(internal/database/model/model.go:276) passesi.Sniffingdirectly to the Xray config struct — no transformation, no hardcoding. The pipeline is correct in the current source.The
fakednsdiscrepancyThe current Zod schema (
frontend/src/schemas/primitives/sniffing.ts:8) defines the defaultdestOverrideas['http', 'tls', 'quic', 'fakedns']. Your report shows['http', 'tls', 'quic']—fakednsis absent. If the bug were "the UI always submits the Zod defaults regardless of selection," the generated config would contain all four values includingfakedns. The absence offakednsmeans one of the following is more likely:fakednsin the default, and the edit is not persisting (for a reason described below).index.htmlin browser cache can cause the old JS to be loaded — clear the browser cache and reload the panel to rule this out.The
config.jsonfile is not the live config3x-ui writes
config.json(under the binary folder, e.g./usr/local/x-ui/bin/config.json) only at Xray process start. After that, inbound additions and edits are pushed to the running Xray instance via gRPC without rewriting the file. If you are readingconfig.jsondirectly, it will show the config from the last Xray restart, not the result of subsequent edits.To see the config that actually reflects the current DB state, use the panel API:
or call it from the server:
Steps to confirm the root cause
After saving with only HTTP selected, check the actual DB row:
If
sniffingstill contains the old["http","tls","quic"], the save is silently not persisting.Reopen the inbound in the panel UI. Does the Sniffing tab still show the selection you made, or has it reverted?
Confirm whether you are reading
config.jsonfrom disk or using the/panel/api/server/getConfigJsonendpoint.Clear the browser cache completely and retry the steps to rule out a stale JS bundle.
Please share the results of these checks — particularly the raw DB value and whether you are reading the file or the API — so the root cause can be pinned down.
This reply was generated automatically; a maintainer may follow up.