mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6177] [MERGED] feat(sub): warn when salamander settings cannot reach the client #6139
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#6139
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/6177
Author: @n0ctal
Created: 8/5/2026
Status: ✅ Merged
Merged: 8/15/2026
Merged by: @MHSanaei
Base:
main← Head:upstream-warn-unexpressible-salamander📝 Commits (3)
11c46f5feat(sub): warn when salamander settings cannot reach the client078141cfix(sub): deduplicate salamander warningsd32d1d7Merge branch 'main' into upstream-warn-unexpressible-salamander📊 Changes
2 files changed (+78 additions, -0 deletions)
View changed files
➕
internal/sub/salamander_uri_test.go(+55 -0)📝
internal/sub/service.go(+23 -0)📄 Description
Summary
A hysteria2 URI can express salamander obfuscation only as
obfs=salamander+obfs-password. When the inbound'sfinalmaskcarries more than a password, the emitted link silently describes a server no standard client can reach. Log the keys that cannot be carried.Why
The comment above the current code is right that emitting the non-standard
fm=<json>dump breaks mihomo and other clients, so only the standard fields are written. The gap is what happens when the standard fields are not sufficient to describe the server.packetSizeis the case I hit. With it set, a client built from the generated link applies plain salamander, the server expects the padded variant, and the handshake fails — no error on the client, nothing in the panel, and traffic accounting stays at zero because no session is ever established. It reads as "hysteria2 is broken" rather than "this inbound cannot be expressed as a link", and it survived weeks of looking in the wrong place before a controlled A/B on a live server isolated it: same client, same credentials, same port — connects when the server has onlypassword, fails whenpacketSizeis present.This does not change the link, so nothing that works today stops working. It makes the reason discoverable.
Scope
internal/sub/service.go—extraSalamanderKeyslists salamander settings beyondpassword; the hysteria2 link builder logs a warning naming the inbound and those keys.internal/sub/salamander_uri_test.go— expressible settings report nothing,packetSizeis reported.Validation
go test ./internal/sub/ -count=1green;go build ./...,go vetclean,gofmtclean.packetSizepresent, Happ and INCY both fail on every hysteria2 entry and the inbound records no traffic; removing it makes the same links work immediately.Risk
None to the data plane. Warning-only, emitted at link build time, no change to the URI or to any stored setting.
Relation to #6166
To draw the boundary explicitly, since it is easy to read these as the same area: #6166 fixes the import direction — parsing standard
obfs/obfs-passwordparameters into an outbound. This is the export direction: warning when an inbound's salamander settings contain fields such aspacketSizethat the standard share URI cannot express at all.The two do not overlap in files or in substance, and #6166 cannot express
packetSizein a URI either — that is precisely the case this warns about rather than fixes.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.