feat(sub): warn when salamander settings cannot reach the client - #6177
feat(sub): warn when salamander settings cannot reach the client#6177n0ctal wants to merge 1 commit into
Conversation
|
Why the checks are red — none of it is from this PR.
Local gate on the branch: |
|
Follow-up on the two remaining red checks, with what I could verify from here.
I checked out
The same job is green on
Nothing in either check comes from this branch. |
3353fad to
3645212
Compare
A hysteria2 share link carries obfuscation as obfs=salamander plus obfs-password, and nothing else. Xray's finalmask accepts more than that — packetSize among them — and those extra settings change what the server expects on the wire. The emitted URI then looks complete but describes a server the client cannot reach: every standard client applies plain salamander, the server drops the packets, and the failure is silent on both ends. Log the unexpressible keys when building such a link, naming the inbound, so the cause is visible instead of appearing as a client-side problem.
3645212 to
11c46f5
Compare
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.