mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-21 16:54:29 +00:00
The relay session context was derived from the inbound connection of the source address that created the session. After a client changes its source address (NAT rebinding), the UDP worker of the old address is cleaned up after ~2 minutes of inactivity and cancels that context, which tears down the dispatched outbound flow; the next packet then creates a brand-new session and outbound flow (new local port on the server, reset replay window). Sessions are routed by client session ID (SIP022 3.2.4), so detach the session context from the originating connection's cancellation and let the session's own inactivity timer govern its lifetime.