mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6822] [Bug]: Missing Hysteria2 Gecko obfs parameters in Clash/Mihomo subs #4543
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#4543
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?
Originally created by @atolismesh on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6822
Describe the bug
When I use subscription links in Clash/Mihomo clients, panel's Hysteria2 inbounds with Gecko obf never works.
As I can see, panel generates YAML and url subs without required obf parameters like obf-min-packet-size, obfs-max-packet-size etc.
How to reproduce the problem
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.10.0
Xray-core version
26.10.10
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 24.04
Which parts of the panel are affected?
No response
Browser (only if it is a UI bug)
No response
Is the panel behind a reverse proxy or CDN?
No response
Before submitting
@github-actions[bot] commented on GitHub (Oct 14, 2026):
You're right about the Clash/Mihomo YAML, and it is still broken on the default branch. The URL (
hysteria2://) subscription, though, already carries the Gecko parameters in v3.10.0, so that half of the report doesn't match the current code. Please paste the raw link (details at the end).Clash/Mihomo YAML: confirmed.
buildHysteriaProxyininternal/sub/clash_service.go:543-559reads thefinalmask.udp[salamander]mask but copies out only the password:settings["packetSize"]is never read. This is the field the inbound form stores Gecko mode in (FinalMaskForm.tsx:1176:mode = ... packetSize ... ? 'gecko' : 'salamander'). A Gecko inbound therefore gets exported to Clash as plain Salamander with no packet-size range. The client's obfuscation then doesn't match the server's, so the connection fails, which is what you're seeing.URL subscription: already emits Gecko.
genHysteriaLinkininternal/sub/service.go:1478-1484turnspacketSizeintoobfs=gecko&minPacketSize=…&maxPacketSize=…. That code came in with540caa4e("fix(hysteria): standard geco share links and persistent uTLS None (#6325)"), which is part of v3.8.0 and v3.10.0.TestGenHysteriaLinkEmitsGeckoParamsForPacketSize(internal/sub/hysteria_geco_uri_test.go:14) pins this behaviour. These are the v2rayN-style field names, not theobfs-min-packet-sizestyle you mention. If your Mihomo client doesn't readminPacketSize/maxPacketSizefrom a URI, that's a naming mismatch between clients rather than a missing parameter. I can't confirm Mihomo's URI or YAML field names for Gecko from this repository.To settle the URL side, please post:
hysteria2://link from your subscription, with the host, password and obfs password redacted but every query parameter name kept.Verdict: Confirmed bug (Clash/Mihomo YAML only)
Severity: Medium
Confidence: High
Root cause:
internal/sub/clash_service.go:549-556,SubClashService.buildHysteriaProxy, emits onlyobfs: salamander+obfs-passwordand dropsfinalmask.udp[salamander].settings.packetSize, so a Gecko inbound is exported as plain Salamander.Same class: None found. The Go URI generator (
internal/sub/service.go:1480) and the frontend link generator (frontend/src/lib/xray/inbound-link.ts:842-844) both handlepacketSize.Already fixed: Still present on the default branch (Clash). The URI side was fixed in
540caa4eand shipped in v3.8.0.Duplicate of: Related: #4924 (the original Gecko feature request)
Evidence:
clash_service.go:549if mask == nil || mask["type"] != "salamander"followed by the password-only block quoted above;service.go:1479-1483packetSize, _ := settings["packetSize"].(string)…params["obfs"] = "gecko"; testTestGenHysteriaLinkEmitsGeckoParamsForPacketSize.Not determined: Which YAML keys Mihomo expects for Gecko, and whether it supports Gecko at all (check Mihomo's hysteria2 proxy docs). Also why your URL link reportedly lacks the parameters (the raw link above would settle it).
Suggested fix: In
buildHysteriaProxy, reuseparseHysteriaPacketSize/splitHysteriaPacketSize(internal/sub/service.go:1595) onsettings["packetSize"], and emit Mihomo's Gecko obfs keys when the range is valid, the same waygenHysteriaLinkdoes. If Mihomo has no Gecko support, the Clash export should at least warn or skip rather than ship a Salamander entry that can never connect.This reply was generated automatically; a maintainer may follow up.
@atolismesh commented on GitHub (Oct 14, 2026):
But, according to https://github.com/MetaCubeX/mihomo/blob/Alpha/common/convert/converter.go, Mihomo do not recognize minPacketSize, maxPacketSize, obfs=gecko URI parameters.
@atolismesh commented on GitHub (Oct 15, 2026):
@ridersaying
Thanks! Now works as expected