mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-04 04:05:04 +03:00
fix(xray): hot-apply Hysteria client changes without replacing the inbound (#6606)
* fix(xray): hot-apply Hysteria client changes without replacing the inbound diffInboundUsers only allowed per-user AlterInbound ops for vless, vmess and trojan. For a hysteria inbound every client add/remove/update became DelInbound + AddInbound: the UDP listener was recreated and all QUIC sessions of that inbound were lost. quic-go sends no stateless reset, so every connected client stalled until its idle timeout (30s by default) after each unrelated client mutation. XrayAPI.AddUser already builds a hysteria account and Xray-core's hysteria server implements AddUser/RemoveUser, so adding the protocol to userDiffableProtocols is sufficient. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * test(xray): say which branch each drop-guard protocol takes With hysteria in userDiffableProtocols its dropped client reaches the guard through the per-user diff, so the test named for protocols the diff cannot handle no longer described its hysteria case. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: MHSanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
@@ -16,9 +16,9 @@ func hotConfigWithClients(clients string) *Config {
|
||||
return cfg
|
||||
}
|
||||
|
||||
// diffInboundUsers refuses shadowsocks and hysteria, so their dropped clients
|
||||
// reach the guard through the inbound instead of through a per-user op.
|
||||
func TestHotDiffDropsUsersOnProtocolsItCannotDiff(t *testing.T) {
|
||||
// Shadowsocks reaches the drop guard through the inbound's settings.clients compare,
|
||||
// hysteria through its per-user diff; either way a dropped client must be reported.
|
||||
func TestHotDiffDropsUsersOnShadowsocksAndHysteria(t *testing.T) {
|
||||
for _, protocol := range []string{"shadowsocks", "hysteria"} {
|
||||
t.Run(protocol, func(t *testing.T) {
|
||||
withClients := func(clients string) *Config {
|
||||
|
||||
Reference in New Issue
Block a user