mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #4760] [Bug]: Hysteria2 Inbound wrong import to outbound and wrong connect #3300
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#3300
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 @gomanuke on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4760
Describe the bug
I do appreciate for Your hard work. 3 2 5 became really good.
I just create hysteria 2 inbound on one x-ui and try to add that via copy client's config to another x-ui
How to reproduce the problem
Just add on one x-ui Hysteria 2 inbound with UDP mask (that's one of missed config option while importing)
Then add client and connect to that inbound
then make a copy URL from client information panel.
O another x-ui add Ounbound switch JSON tab paste and import.
Check Alpn (always h3 ignores another), check UDP Mask (lost). Manually correcting it doesn't help to make connection.
In fact i didn't find a way to solve that trivial task ((( I mean connect from x-ui 3 2 5 to x-ui 3 2 5 by hysteria 2
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
3.2.5
Xray-core version
26.6.1
How did you install 3x-ui?
install.sh script
Operating system
Debian 13
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 — direct access
Before submitting
@github-actions[bot] commented on GitHub (Jun 1, 2026):
Thank you for the detailed report!
This looks like a bug in how the Hysteria2 client URL is generated and/or parsed when importing as an outbound. Two specific problems are described:
h3— thealpnfield in the imported outbound always showsh3regardless of what was configured on the inbound.To help reproduce and investigate, could you please provide:
A related issue (#4376) was reported on v3.0.2 where QUIC params and TLS were not preserved on import — if the UDP mask and ALPN fields are similarly not being serialized into the share URL or not being parsed back from it, the root cause may be the same pattern.
@gomanuke commented on GitHub (Jun 1, 2026):
client share URL
hysteria2://78e7795a209c4c099f896a816fc8448f@news.domain.org:8443?alpn=h2%2Chttp%2F1.1&fm=%7B%22udp%22%3A%5B%7B%22settings%22%3A%7B%22password%22%3A%22ftwfgb9655hh2mgo%22%7D%2C%22type%22%3A%22salamander%22%7D%5D%7D&fp=chrome&obfs=salamander&obfs-password=655hh2mgo&security=tls&sni=news.domain.org#hy2-ej596ty350qs
raw JSON that appears in the outbound
{
"protocol": "hysteria",
"settings": {
"address": "news.domain.org",
"port": 8443,
"version": 2
},
"tag": "hy2-ej596ty350qs",
"streamSettings": {
"network": "hysteria",
"security": "tls",
"hysteriaSettings": {
"version": 2,
"auth": "78e7795a209c4c099f896a816fc8448f",
"udpIdleTimeout": 60
},
"tlsSettings": {
"serverName": "news.domain.org",
"alpn": [
"h3"
],
"fingerprint": "",
"echConfigList": "",
"verifyPeerCertByName": "",
"pinnedPeerCertSha256": ""
}
}
}
inbound JSON
{
"listen": "",
"port": 8443,
"protocol": "hysteria",
"tag": "in-8443-udp",
"settings": {
"clients": [
{
"auth": "78e7795a209c4c099f896a816fc8448f",
"email": "ej596ty350qs",
"limitIp": 0,
"totalGB": 0,
"expiryTime": 0,
"enable": true,
"tgId": 0,
"subId": "jqqy9ky1p2z8wk0a",
"comment": "",
"reset": 0,
"created_at": 1780308845548,
"updated_at": 1780310142000
}
],
"version": 2
},
"sniffing": {
"enabled": false
},
"streamSettings": {
"network": "hysteria",
"hysteriaSettings": {
"version": 2,
"udpIdleTimeout": 60
},
"security": "tls",
"tlsSettings": {
"serverName": "news.domain.org",
"minVersion": "1.2",
"maxVersion": "1.3",
"cipherSuites": "",
"rejectUnknownSni": false,
"disableSystemRoot": false,
"enableSessionResumption": false,
"certificates": [
{
"certificateFile": "/etc/letsencrypt/live/news.domain.org/fullchain.pem",
"keyFile": "/etc/letsencrypt/live/news.domain.org/privkey.pem",
"oneTimeLoading": false,
"usage": "encipherment",
"buildChain": false,
"useFile": true
}
],
"alpn": [
"h2",
"http/1.1"
],
"echServerKeys": "",
"settings": {
"fingerprint": "chrome",
"echConfigList": "",
"pinnedPeerCertSha256": []
}
},
"finalmask": {
"udp": [
{
"type": "salamander",
"settings": {
"password": "ftwfgb9655hh2mgo"
}
}
]
}
}
}
@MHSanaei commented on GitHub (Jun 1, 2026):
Fixed in commits
803e0109and6ae1b386.Root cause: the outbound link importer (
parseHysteria2Link) hardcodedalpn: ["h3"]and never readfp,ech, or thefm(finalmask) param — so importing a Hysteria2 client URL as an outbound dropped the configured ALPN (always showedh3), the fingerprint, and the salamander UDP mask. That's why ALPN was wrong and the UDP mask was lost.Fixes:
alpn(falling back toh3only when the link omits it),fp,ech, and the correctpcspinned-cert key, and restores the UDP mask fromfm. Verified the import→save round-trip preservesfinalmask/alpninto the saved outbound, so it reaches xray. Added regression tests using the reported link.This will be in the next release.
@MHSanaei commented on GitHub (Jun 1, 2026):
@hoshiizumiya
you forgot udp mask in the inbound
@hoshiizumiya commented on GitHub (Jun 2, 2026):
OK, after renew my certification, it fixed by add h3 to ALPN. The default configer does not include it.
@hoshiizumiya commented on GitHub (Jun 2, 2026):
The pinnedPeerCertSha256 configer doesn't support to get from the fullchain.pem is bit of pity. And the update may also be a problem. Because the client and panel can't auto get the new certification?
@gomanuke commented on GitHub (Jun 2, 2026):
Guys, i still can't create Hysteria2 Inbound (3.2.6) that can be connected by Outbound (3.2.6)
Vless works perfect (just click-default-get-connected )
x-ui Outbound (3.2.6) also connects to pure Hysteria2 server (2.9.2) without any problems.
But not to Hysteria2 inbound (3.2.6)...
Also hiddify (happ) can't connect to x-ui Hysteria2 inbound
Tried different servers and clients...
Would You help?
@gomanuke commented on GitHub (Jun 2, 2026):
Hysteria2 Inbound Security-ALPN MUST be empty OR contains h3
And it doesn't matter what Outbounds ALPN contains...
Looks as bug?
@hoshiizumiya commented on GitHub (Jun 2, 2026):
The h3 means udp, which is used for hysteria2, so it's a must. But 3x-ui doesn't add it as a default
@gomanuke commented on GitHub (Jun 3, 2026):
Please would You care about dummies like me reopening America again ))) and take it into account. I mean default attributes that is vital for connections....
Appreciate for Your hard work.