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#5590
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/4073
Author: @pwnnex
Created: 4/21/2026
Status: ✅ Merged
Merged: 4/22/2026
Merged by: @MHSanaei
Base:
main← Head:fix/hysteria-external-proxy-and-clash📝 Commits (3)
3213d62Fix Hysteria External Proxy + include Hysteria in Clash subscription (#4053)e20a8c7gofmt: align map keys in buildHysteriaProxy863f767Merge branch 'main' into fix/hysteria-external-proxy-and-clash📊 Changes
2 files changed (+135 additions, -3 deletions)
View changed files
📝
sub/subClashService.go(+86 -0)📝
sub/subService.go(+49 -3)📄 Description
Closes #4053.
Two related gaps on the Hysteria side of the subscription layer.
1.
genHysteriaLinkignoredexternalProxysub/subService.go → genHysteriaLinkbuilt its link aswith no reference to the inbound's
externalProxyarray. Every other generator (genVmessLink,genVlessLink,genTrojanLink,genShadowsocksLink) iterates that array and emits one link per entry, substitutingdest/port/remark. Hysteria was the outlier, so admins who pointed a Hysteria inbound at an alternate endpoint (typical scenario: a CDN hostname that forwards UDP to the node) still got a subscription with the original server address. The issue reporter ran into exactly this.Fix: mirror the pattern. When
externalProxyis non-empty, fan out — one link per entry — substitutingdest/portand using the entry's remark as a suffix. If the array is absent or empty, keep the previous behaviour (use the request host +inbound.Port).While I was in there, I also propagated the salamander obfs password (
finalmask.udp[salamander].settings.password) asobfs=salamander&obfs-password=…. The panel-side link generator (web/assets/js/model/inbound.js → genHysteriaLink) already emits these query params, so the subscription output was just lagging.2. Hysteria missing from Clash subscription
sub/subClashService.go → buildProxyhad a protocol switch with cases for VMESS / VLESS / Trojan / Shadowsocks and adefault: return nil. Hysteria inbounds fell into the default branch and silently vanished from the YAML — the user saw every other protocol in their Clash config except the Hysteria ones.Fix: route Hysteria through a dedicated
buildHysteriaProxyhelper before the existingapplyTransport/applySecurityhelpers run. Those helpers model xraystreamSettings.network/streamSettings.security, which Hysteria doesn't use — Hysteria carries its own UDP transport and TLS handshake. The helper readsinbound.StreamSettingsdirectly instead of going throughstreamData/tlsData, because those prune fields (allowInsecure, the salamanderfinalmask.udpblock) that the mihomo Hysteria proxy needs preserved.Output shape matches mihomo's docs:
The existing
getProxiesfanout overexternalProxyis untouched and plugs in automatically, so once Hysteria is recognised bybuildProxyit also picks up External Proxy entries in the Clash output.Diff size
sub/subService.go:genHysteriaLinkrewritten (+49 −3)sub/subClashService.go: +86 (early Hysteria dispatch +buildHysteriaProxy)Test plan
go build ./...+go vet ./sub/...cleaninbound.Port(unchanged from before)hysteria2://…link per entry, each pointing at its owndest:portwith the configured remark suffixobfs=salamander&obfs-password=…in every emitted linktype: hysteria2(orhysteriafor v1) proxies for every Hysteria inbound, withpassword/auth-str/sni/alpn/skip-cert-verify/obfs/obfs-passwordpopulated from the inboundgetProxiesfanout, now thatbuildProxystops dropping Hysteria)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.