Skip to content

Hysteria & XHTTP/3 clients: udpHop supports dialerProxy#6320

Merged
RPRX merged 6 commits into
XTLS:mainfrom
hossinasaadi:patch-hy2
Jun 16, 2026
Merged

Hysteria & XHTTP/3 clients: udpHop supports dialerProxy#6320
RPRX merged 6 commits into
XTLS:mainfrom
hossinasaadi:patch-hy2

Conversation

@hossinasaadi

Copy link
Copy Markdown
Contributor

No description provided.

@Fangliding

Copy link
Copy Markdown
Member

有任何通向这个panic的实质路径吗?

@hossinasaadi

Copy link
Copy Markdown
Contributor Author

有任何通向这个panic的实质路径吗?

This panic occasionally occurs on the client side and has been observed in real-world user crash reports. Since it can destabilize the client and lead to crashes, it’s not merely a theoretical issue.

@Fangliding

Copy link
Copy Markdown
Member

panic抛出的栈呢

@hossinasaadi

Copy link
Copy Markdown
Contributor Author

panic抛出的栈呢

this will triggered when Hysteria is used with dialerProxy pointing to a SOCKS outbound. The stack trace points to dial() during the outbound dial path.

panic: *cnc.Connection

goroutine 144 [running]:
github.com/xtls/xray-core/transport/internet/hysteria.(*client).dial(0x10b42ef50, {0x107cde5f0, 0x10b6cc7e0})
	github.com/xtls/xray-core/transport/internet/hysteria/dialer.go:150 +0xfa0
github.com/xtls/xray-core/transport/internet/hysteria.(*client).tcp(0x10b42ef50, {0x107cde5f0?, 0x10b6cc7e0?})
	github.com/xtls/xray-core/transport/internet/hysteria/dialer.go:260 +0xbc
github.com/xtls/xray-core/transport/internet/hysteria.Dial({0x107cde5f0, 0x10b6cc7e0}, {{0x107cde7f8?, 0x10b67e2d8?}, 0x1?, 0x0?}, 0x10b430770)
	github.com/xtls/xray-core/transport/internet/hysteria/dialer.go:365 +0x3c4
github.com/xtls/xray-core/transport/internet.Dial({0x107cde5f0, 0x10b6cc7e0}, {{0x107cde7f8?, 0x10b67e2d8?}, 0xe2d8?, 0x1?}, 0x105a98b04?)
	github.com/xtls/xray-core/transport/internet/dialer.go:63 +0x140
github.com/xtls/xray-core/app/proxyman/outbound.(*Handler).Dial(0x104a7bc20, {0x107cde5f0, 0x10b6cc7e0}, {{0x107cde7f8, 0x10b67e2d8}, 0x1bb, 0x2})
	github.com/xtls/xray-core/app/proxyman/outbound/handler.go:316 +0x72c
github.com/xtls/xray-core/proxy/hysteria.(*Client).Process(0x104b64690, {0x107cde5f0, 0x104b26f60}, 0x122204720, {0x107cdba30, 0x104a7bc20})
	github.com/xtls/xray-core/proxy/hysteria/client.go:58 +0x158
github.com/xtls/xray-core/app/proxyman/outbound.(*Handler).Dispatch(0x104a7bc20, {0x107cde5f0, 0x104b26f60}, 0x122204720)
	github.com/xtls/xray-core/app/proxyman/outbound/handler.go:242 +0x844
github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).routedDispatch(0x122201a40, {0x107cde5f0, 0x104b26f60}, 0x122204720, {{0x107cde868, 0x1049d8130}, 0x1bb, 0x2})
	github.com/xtls/xray-core/app/dispatcher/default.go:504 +0x8b0
created by github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).Dispatch in goroutine 143
	github.com/xtls/xray-core/app/dispatcher/default.go:288 +0x464

@LjhAUMEM

Copy link
Copy Markdown
Collaborator

当初没给 udphop 配链式是故意的,你要是想配就只加那一部分,panic 部分不要改动,因为不止这一处

@LjhAUMEM

Copy link
Copy Markdown
Collaborator

唉,真要配链式结构又要调整,@hossinasaadi 我将直接push到你的branch,没问题吧?

@hossinasaadi

Copy link
Copy Markdown
Contributor Author

唉,真要配链式结构又要调整,@hossinasaadi 我将直接push到你的branch,没问题吧?

Thanks for checking. Sure, no problem. Feel free to push

@hossinasaadi

Copy link
Copy Markdown
Contributor Author

@LjhAUMEM I’ve fixed the chaining issue, although I’m not entirely sure whether it could affect other parts of the codebase. It works correctly in my testing, so it might be helpful.
hossinasaadi@0cf1b86

@LjhAUMEM

LjhAUMEM commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

@LjhAUMEM I’ve fixed the chaining issue, although I’m not entirely sure whether it could affect other parts of the codebase. It works correctly in my testing, so it might be helpful. hossinasaadi@0cf1b86

链式没问题啊,你修啥,还有一些不必要的 rename 一些变量...

当初没适配链式是因为使用场景有限,以及 sysconn 的问题,你今天提了加就加吧,等我这边提交

@hossinasaadi

Copy link
Copy Markdown
Contributor Author

链式没问题啊,你修啥,还有一些不必要的 rename 一些变量...

当初没适配链式是因为使用场景有限,你今天提了加就加吧,等我这边提交

Thanks, I’ve reverted the unnecessary renamings.

I fixed the Hysteria → SOCKS5 chaining issue when using either dialerProxy or proxySettings. This was the scenario that was triggering the panic I encountered.

@LjhAUMEM LjhAUMEM left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LjhAUMEM

Copy link
Copy Markdown
Collaborator

@RPRX 与这个 pr 无关,udpHop 可以加 address sockopt 两个字段来移到 mask,但还不确定要不要这么做

@RPRX RPRX changed the title Hysteria: prevent crash on cnc.Connection Hysteria client: Prevent panic on cnc.Connection Jun 16, 2026
@RPRX RPRX merged commit 153468d into XTLS:main Jun 16, 2026
40 checks passed
@LjhAUMEM

Copy link
Copy Markdown
Collaborator

标题怎么还是crash,感觉可以是个feat,毕竟给udphop支持dialerproxy的我们应该是第一家

RPRX pushed a commit that referenced this pull request Jun 17, 2026
Fixes #6320 (comment)

---------

Co-authored-by: LjhAUMEM <llnu14702@gmail.com>
@RPRX

RPRX commented Jun 17, 2026

Copy link
Copy Markdown
Member

@LjhAUMEM 那正好我再改下标题

@RPRX RPRX changed the title Hysteria client: Prevent panic on cnc.Connection Hysteria, XHTTP/3 client: udpHop supports dialerProxy Jun 17, 2026
@RPRX RPRX changed the title Hysteria, XHTTP/3 client: udpHop supports dialerProxy Hysteria & XHTTP/3 clients: udpHop supports dialerProxy Jun 17, 2026
RPRX pushed a commit that referenced this pull request Jun 17, 2026
#6320 (comment)

Fixes #6320 (comment)

---------

Co-authored-by: LjhAUMEM <llnu14702@gmail.com>
Maolaohei pushed a commit to Maolaohei/Bray-Core that referenced this pull request Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants