mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
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#5608
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/4126
Author: @pwnnex
Created: 4/28/2026
Status: ❌ Closed
Base:
main← Head:fix/strip-legacy-reverse📝 Commits (1)
6a293b4xray-setting: strip legacy reverse block on save📊 Changes
3 files changed (+180 additions, -0 deletions)
View changed files
📝
web/html/settings/xray/reverse.html(+4 -0)📝
web/service/xray_setting.go(+57 -0)📝
web/service/xray_setting_test.go(+119 -0)📄 Description
closes #4115.
what users see
after upgrading xray-core to v26+ (3x-ui v2.9.x ships v26.4.x), any panel that has reverse-proxy configured via xray configs > reverse-proxy fails to start xray with:
the proxy stops working entirely. the only fix today is for the admin to manually edit the saved template and remove the
reverseblock by hand, which most users won't figure out.root cause
xray-core dropped the original reverse-proxy implementation (XTLS/Xray-core#5101) and replaced it with
VLESS Reverse Proxy— a per-client field on a vless inbound, not a top-level block. the panel UI was still writing configs in the legacy shape:xray refuses to parse it from v26 onwards.
fix
on
SaveXraySetting, run the template through a newStripLegacyReversehelper. if the top-levelreverseblock carriesportalsorbridges, it gets removed silently and a warning is written to the panel log. the rest of the config stays valid, xray starts again, and the next save makes the cleanup permanent.added a deprecation banner to the reverse-proxy tab in the panel so admins stop generating new broken configs from the UI. the tab itself is not removed (would break re-editing for users still on older xray), just labeled.
the new VLESS Reverse Proxy uses a
reversefield nested insideinbounds[].settings.clients[], not at the top level. the helper only matches the top-level legacy shape, so the new mechanism is left untouched (covered byTestStripLegacyReverse_DoesNotTouchNestedReverseFields).a full UI rewrite to support VLESS Reverse Proxy would be a separate, larger PR. this one is a band-aid that unblocks broken servers.
tests
6 unit tests in
xray_setting_test.go:RemovesPortalsAndBridges— direct repro of the issue, both fields presentOnlyPortals— config with only one of the twoNoOpWhenNoReverseBlock— clean config returns identical string, no diff churnLeavesNonLegacyReverseAlone— defensive, future-proofs against unrelatedreversefieldsDoesNotTouchNestedReverseFields— pins the boundary with the new VLESS Reverse Proxy mechanismInvalidJsonReturnsError— defensive on garbage inputgo build ./...,go test ./...,gofmtall clean.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.