mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-07 10:47:15 +00:00
d163e6ac2d
relay.go relays a recovered tunnel connection into Xray's own stock SOCKS5 inbound, authenticating as the peer's email -- the mechanism that gives embedded AmneziaWG traffic real Xray stats/routing/sniffing with no Xray-core fork. TCP goes through golang.org/x/net/proxy; UDP needed a hand-rolled SOCKS5 UDP ASSOCIATE client since neither that package nor xray-core's own internal socks client expose one. Verified end-to-end against a real xray-core process (gated behind XRAY_E2E_BINARY, matching internal/xray's own e2e test convention): a real TCP and UDP round trip through the whole chain, plus real per-peer stats counters in Xray's own log. Xray-config auto-injection (a real SOCKS5 inbound wired into the generated panel config) is deliberately not part of this commit -- it would require deciding which AmneziaWG inbounds run on the kernel-module path vs. this one, and that's an explicit later decision, not something to back into here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>