mirror of
https://github.com/go-gost/x.git
synced 2026-10-19 16:16:32 +00:00
Disable Nagle on the underlying TCP socket for relay+ws, relay+wss, and relay+tls listeners/dialers. Small latency-sensitive datagrams (e.g. WireGuard UDP over a relay tunnel) were being coalesced by Nagle until a peer ACK returned, adding up to one RTT per datagram and inflating round-trip latency (go-gost/gost#858). wstunnel sets TCP_NODELAY on its tunnel socket by default and keeps latency flat; gost did not. Add ApplyNoDelay helper and WrapNoDelayListener (mirrors ApplyKeepalive), applied on the raw *net.TCPConn before the proxyproto/tls wrapper chain.