3x-ui/internal/amneziawgnet
Aleksey Fedorov 2fab6c3d50
perf(amneziawg): reuse relay buffers and bound the bridge connect time (#7043)
Every TCP connection through a built-in AmneziaWG inbound or outbound
allocated two fresh 32 KiB copy buffers, because io.Copy on a *net.TCPConn
goes through ReadFrom/WriteTo and ignores a caller's buffer. Under a stream
of short connections that is a lot of garbage. The relays now copy with
buffers from a sync.Pool; one side of each pair is always a userspace
netstack connection, so no kernel splice path is given up.

The connect to the local Xray bridge and its SOCKS5 handshake had no time
limit, so a bridge that accepted and never answered pinned the relay's
goroutines and descriptors forever. Both are now bounded at 10 s, and the
deadline is cleared once the handshake succeeds so the relayed connection
keeps its half-close behaviour.
2026-11-13 19:43:03 +01:00
..
bench_test.go fix(amneziawgnet): stop tests binding fixed ports in the ephemeral range 2026-11-01 15:14:49 +01:00
client_device.go fix(amneziawg): bound what a handshake allocates and the tunnel MTU 2026-10-31 14:50:18 +01:00
client_device_test.go feat(amneziawg): add AmneziaWG as an outbound protocol (#6320) 2026-09-10 14:50:48 +02:00
device.go fix(amneziawg): bound what a handshake allocates and the tunnel MTU 2026-10-31 14:50:18 +01:00
device_test.go fix(amneziawgnet): stop tests binding fixed ports in the ephemeral range 2026-11-01 15:14:49 +01:00
diagnostics.go feat(amneziawg): add native AmneziaWG protocol support (#6105) 2026-08-24 02:41:15 +02:00
diagnostics_test.go fix(amneziawgnet): stop tests binding fixed ports in the ephemeral range 2026-11-01 15:14:49 +01:00
dns.go fix(amneziawg): bound the egress relay's pending tunnel DNS lookups 2026-11-01 00:19:34 +01:00
dns_family_test.go fix(amneziawg): stop AAAA fallback on v4-only tunnels and expose I2–I5 (#6611) 2026-09-26 22:01:04 +02:00
egress.go perf(amneziawg): reuse relay buffers and bound the bridge connect time (#7043) 2026-11-13 19:43:03 +01:00
egress_domain_test.go fix(amneziawgnet): stop tests binding fixed ports in the ephemeral range 2026-11-01 15:14:49 +01:00
egress_port_test.go fix(amneziawg): bound the egress relay's UDP sessions as a whole 2026-10-31 15:20:50 +01:00
forwarder.go fix(amneziawg): give each peer a share of the forwarder and UDP relay 2026-11-01 00:16:04 +01:00
forwarder_test.go fix(amneziawg): give each peer a share of the forwarder and UDP relay 2026-11-01 00:16:04 +01:00
identity.go fix(amneziawg): attribute an equal-prefix source to the peer the device picks 2026-11-01 10:02:11 +01:00
identity_test.go fix(amneziawg): attribute an equal-prefix source to the peer the device picks 2026-11-01 10:02:11 +01:00
main_test.go chore(amneziawgnet): bind test sockets to loopback 2026-10-03 00:00:36 +02:00
manager.go fix(amneziawg): only delete IPv6 aliases this panel added itself 2026-11-01 13:32:21 +01:00
manager_test.go fix(amneziawgnet): stop tests binding fixed ports in the ephemeral range 2026-11-01 15:14:49 +01:00
netstack.go fix(amneziawg): stop the TUN handoff from parking a peer's receiver 2026-11-01 00:17:33 +01:00
netstack_test.go fix(amneziawg): stop the TUN handoff from parking a peer's receiver 2026-11-01 00:17:33 +01:00
outbound_manager.go fix(amneziawg): fall back to a free egress port when 64900 is refused 2026-09-27 16:09:54 +02:00
outbound_manager_test.go fix(amneziawg): fall back to a free egress port when 64900 is refused 2026-09-27 16:09:54 +02:00
pinned_bind.go chore(amneziawgnet): bind test sockets to loopback 2026-10-03 00:00:36 +02:00
pinned_bind_test.go chore(amneziawgnet): bind test sockets to loopback 2026-10-03 00:00:36 +02:00
portfwd.go fix(amneziawg): cap port-forward relays and UDP sessions 2026-10-31 15:18:43 +01:00
portfwd_test.go fix(amneziawgnet): stop tests binding fixed ports in the ephemeral range 2026-11-01 15:14:49 +01:00
portfwd_udp.go fix(amneziawg): cap port-forward relays and UDP sessions 2026-10-31 15:18:43 +01:00
race_off_test.go perf(amneziawg): reuse relay buffers and bound the bridge connect time (#7043) 2026-11-13 19:43:03 +01:00
race_on_test.go perf(amneziawg): reuse relay buffers and bound the bridge connect time (#7043) 2026-11-13 19:43:03 +01:00
relay.go perf(amneziawg): reuse relay buffers and bound the bridge connect time (#7043) 2026-11-13 19:43:03 +01:00
relay_e2e_test.go fix(amneziawgnet): stop tests binding fixed ports in the ephemeral range 2026-11-01 15:14:49 +01:00
relay_halfclose_test.go perf(amneziawg): reuse relay buffers and bound the bridge connect time (#7043) 2026-11-13 19:43:03 +01:00
relay_pool_test.go perf(amneziawg): reuse relay buffers and bound the bridge connect time (#7043) 2026-11-13 19:43:03 +01:00
relay_test.go fix(amneziawg): give each peer a share of the forwarder and UDP relay 2026-11-01 00:16:04 +01:00
resolving_bind.go fix(amneziawg): let the wrapped bind build peer endpoints 2026-09-27 16:14:45 +02:00
resolving_bind_test.go fix(amneziawg): let the wrapped bind build peer endpoints 2026-09-27 16:14:45 +02:00
socks_bridge.go fix(amneziawg): fall back to a free egress port when 64900 is refused 2026-09-27 16:09:54 +02:00
socks_bridge_test.go feat(amneziawg): add AmneziaWG as an outbound protocol (#6320) 2026-09-10 14:50:48 +02:00
socks_config.go fix(amneziawg): wrap the relay port window instead of refusing ids past it (#6539) 2026-09-15 10:07:14 +03:00
socks_config_test.go fix(amneziawg): wrap the relay port window instead of refusing ids past it (#6539) 2026-09-15 10:07:14 +03:00
udp.go fix(amneziawg): respect tunnel MTU when writing UDP replies (#6780) 2026-10-12 03:11:09 +02:00
udp_mtu_concurrent_test.go fix(amneziawg): respect tunnel MTU when writing UDP replies (#6780) 2026-10-12 03:11:09 +02:00
udp_mtu_test.go fix(amneziawg): respect tunnel MTU when writing UDP replies (#6780) 2026-10-12 03:11:09 +02:00
udp_mtu_v6_test.go fix(amneziawg): respect tunnel MTU when writing UDP replies (#6780) 2026-10-12 03:11:09 +02:00
udp_test.go fix(amneziawgnet): stop tests binding fixed ports in the ephemeral range 2026-11-01 15:14:49 +01:00
v6alias.go fix(amneziawg): only delete IPv6 aliases this panel added itself 2026-11-01 13:32:21 +01:00
v6alias_test.go fix(amneziawgnet): stop tests binding fixed ports in the ephemeral range 2026-11-01 15:14:49 +01:00