mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-25 12:04:44 +03:00
eccf2e71bd
A client's devices all carry the client's email, and the core removes a WireGuard user by email, one peer at a time. The hot diff therefore removed every peer of the email and added the survivors back, and a client that left for good counted as a user whose sessions had to be dropped. Measured on a running panel (Xray 26.11.9, kernel WireGuard clients): - disabling or deleting one device cut the client's other devices for about 15 s, the time a client waits before it handshakes again with a peer the server forgot; - disabling or deleting a connected WireGuard client restarted the whole core with the default restartXrayOnClientDisable, taking every inbound down. The diff is now per public key: a peer that stays is never touched, a changed peer is updated in place, and a removed one goes through RemoveWireguardPeer, which relabels that single peer and removes the label. A WireGuard session ends with its peer, so its removal no longer asks for the restart. After the change the other devices and other clients of the inbound keep their tunnels with no gap, and the core keeps its pid.