mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-05 09:57:14 +00:00
124665c5ef
Manager.ensureLocked now attaches AttachTCPForwarder/AttachUDPHandler to every Device it builds, relaying into that instance's own loopback SOCKS5 inbound automatically -- no caller needs to know relay.go exists at all. Peer identity is re-looked-up via Manager.Lookup on every connection rather than captured once at attach time, so a reconfigure-in-place (peers added/ removed without a full rebuild) doesn't leave the forwarder working off a stale peer index. Added TestManagerEnsureAutomaticallyWiresRelay: drives this through the real Manager.Ensure entry point (not manual wiring like the existing relay_e2e_test.go) against a real xray-core process, confirming the automatic attachment and the port/password Manager derives internally actually agree with what a real SOCKS5 inbound expects. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>