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#5596
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/4086
Author: @pwnnex
Created: 4/22/2026
Status: ✅ Merged
Merged: 4/22/2026
Merged by: @pwnnex
Base:
main← Head:fix/hysteria2-protocol-aliases📝 Commits (2)
eb4791ahysteria: also accept "hysteria2" protocol string17f67efsub: dont panic on bad externalProxy entry in genHysteriaLink📊 Changes
7 files changed (+60 additions, -21 deletions)
View changed files
📝
database/model/model.go(+13 -1)➕
database/model/model_test.go(+22 -0)📝
sub/subClashService.go(+4 -7)📝
sub/subJsonService.go(+1 -1)📝
sub/subService.go(+15 -7)📝
web/service/inbound.go(+4 -4)📝
xray/api.go(+1 -1)📄 Description
Closes #4081.
The panel UI stores both Hysteria v1 and v2 as
protocol = "hysteria"withsettings.versiontelling them apart, so everywhere we compare protocol tomodel.Hysteriaworks for both variants on UI-created inbounds.For inbounds that came in from somewhere else (imports, manual inserts, migrations from other panels) the stored protocol string can be literally
"hysteria2". Every switch/filter we have misses that:getInboundsBySubIdSQL filtersprotocol in (...)without hysteria2getLinkswitch has onlycase "hysteria"genHysteriaLinkreturns""on anything butmodel.HysteriabuildProxyin clash dispatches onmodel.HysteriaonlysubJsonServiceswitch sameinbound.govalidation and client-key lookups,xray/api.goAddUser sameResult: no link in subscription, no entry in the clash yaml, no error logged. The reporter describes it exactly.
Fix
Add
Hysteria2constant +IsHysteria(p Protocol) boolhelper indatabase/model/model.go, use it (or a two-valuedcase) in the places listed above. No migration, no change to how the UI stores things. Existing"hysteria"inbounds hit the exact same code paths they did before.Second commit is unrelated to the issue but touches the same function:
int(ep["port"].(float64))in the externalProxy fanout (from #4073) was a bare type assertion, which panics the subscription handler if any entry is missing port or has the wrong JSON type. Added an ok-check to skip malformed entries.Test plan
go build ./...+go vet ./...cleango test ./database/model/—TestIsHysteriapasses (6 cases includinghysteria,hysteria2, empty, wrong-case, other protocols)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.