1. The 15-second idle timeout killed SSH and WebSockets
Early versions of LocalProxyServer used a 15-second poll() wait while relaying bidirectional streams. Whenever neither peer sent bytes for 15 seconds, the relay treated that timeout as a finished socket and closed the tunnel.
Normal web page loads hid this bug completely. The moment you left an SSH session idle, connected a WebSocket, or paused a download, the connection dropped cleanly with no error log.
Fixing it meant separating an idle poll wait from socket EOF and only tearing down a flow when an actual read/write closed, reset, or exceeded health bounds.
2. Silent IP_BOUND_IF failures and proxy cleanup
macOS defaults all traffic onto one primary interface unless each outbound socket is explicitly pinned via IP_BOUND_IF. In early builds, failures on that setsockopt call were swallowed silently, meaning Netwich could quietly funnel every stream onto a single adapter while showing multiple links as active.
A related state bug lived in SystemProxyManager: enabling SOCKS5 proxying turned on localhost forwarding across services and 'restored' them on exit by turning proxies off unconditionally. Anyone using a corporate SOCKS proxy lost their configuration.
The fix was two-part: fail loudly when interface pinning errors out so the weighted scheduler avoids broken paths, and snapshot each service's (server, port, enabled) tuple before changing anything, restoring that snapshot on exit or crash recovery.
3. Localhost browser bridge security and filename traversal
Netwich includes Chrome and Firefox companion extensions talking to a loopback HTTP bridge on 127.0.0.1:19288. Originally that bridge reflected any Origin header in Access-Control-Allow-Origin. Any malicious web page could query active transfers or cancel downloads.
Restricting allowed origins strictly to extension URL schemes and sanitizing incoming filenames (stripping path traversal components and NUL bytes in DownloadItem) closed both local attack surfaces, verified in unit tests.
4. What Netwich explicitly does not claim
A single TCP connection never runs faster than a single link, and a remote server that throttles per-connection speed will not saturate combined interfaces through more connections alone.
Netwich speeds up multi-flow workloads and chunked range downloads across independent connections, without routing traffic through any external relay server.