Add multi-client support, WireGuard-only mode, and dynamic IP re-resolution#5
Add multi-client support, WireGuard-only mode, and dynamic IP re-resolution#5RogerHartmann wants to merge 2 commits into
Conversation
…lution - Multi-client support (--max-clients 1-10): each client gets its own dedicated send socket with a unique source port, enabling simultaneous sessions tracked by endpoint address. Inactive clients are cleaned up after CLIENT_TIMEOUT_SECONDS (30s). - WireGuard-only mode (--wireguard-only): new clients are rejected unless their first packet is a valid WireGuard handshake initiation (type=1, reserved=0, exactly 148 bytes). - Dynamic connect address re-resolution (--connect-resolve-interval N): periodically re-resolves --connect-host every N seconds (default 60, 0=disabled). Logs and updates the connect address if the IP changes, useful for servers with dynamic or failover DNS.
|
hello @danpodeanu |
- Add --wireguard-timeout <seconds>: drop clients that sent a WireGuard handshake init or transport data packet but received no server reply within N seconds. Useful since WireGuard servers silently ignore packets from unknown peers, leaving the proxy holding a dead session slot. - Add is_wireguard_transport_data(): recognise WireGuard type 4 (transport data) packets. Required for roaming support: when a client switches networks mid-session it sends a type 4 packet from the new IP/port before re-initiating a handshake. - Add is_wireguard_packet(): accepts type 1 (handshake init) or type 4 (transport data); used by --wireguard-only so roaming clients are not rejected. - --wireguard-timeout applies to both type 1 and type 4 new-client packets, covering both fresh connections and roaming sessions where the server may no longer recognise the peer. - Bump version to 2.3.1.
|
I did some more updates: Add WireGuard no-reply timeout and roaming (type 4) supportThis PR adds two related WireGuard improvements: --wireguard-timeout Roaming support (type 4 transport data) Version bumped to 2.3.1. |
Add multi-client support, WireGuard-only mode, and dynamic IP re-resolution
Multi-client support (--max-clients 1-10): each client gets its own dedicated send socket with a unique source port, enabling simultaneous sessions tracked by endpoint address. Inactive clients are cleaned up after CLIENT_TIMEOUT_SECONDS (30s).
WireGuard-only mode (--wireguard-only): new clients are rejected unless their first packet is a valid WireGuard handshake initiation (type=1, reserved=0, exactly 148 bytes).
Dynamic connect address re-resolution (--connect-resolve-interval N): periodically re-resolves --connect-host every N seconds (default 60, 0=disabled). Logs and updates the connect address if the IP changes, useful for servers with dynamic or failover DNS.