macOS networking app

Netwich

A native macOS app that bonds Wi-Fi, Ethernet and phone tethering into one local SOCKS5 connection with failover.

Completed and releasedSwift 6SwiftUImacOS 14+SOCKS5IP_BOUND_IF
Netwich 0.1.0 overview window showing live throughput, attached network interfaces, and speed controls.
Netwich 0.1.0: live overview window showing attached interfaces, scheduler weighting, and local proxy status.

Most Macs have more than one internet path available: Wi-Fi, wired Ethernet, or USB mobile tethering. macOS routes all flows down one default interface and leaves the rest idle. Netwich uses all healthy interfaces without touching remote servers.

It runs a local SOCKS5 proxy at 127.0.0.1:1080 and binds individual outgoing sockets onto physical interfaces via Apple's IP_BOUND_IF socket option. Active interfaces are scored continuously using EWMA RTT and throughput measurements, feeding a weighted least-connections scheduler.

There is no cloud VPN, subscription, or telemetry: Netwich is a native SwiftUI app for macOS 14+ (Swift 6 toolchain with concurrency-safe scheduling) shipped with mergecli and signed/packaged extension bridges.

How it works

Socket Binding
Local SOCKS5 relay (127.0.0.1:1080) binding outgoing TCP sockets per interface using Darwin IP_BOUND_IF.
Scheduler
Weighted least-connections flow placement weighted by measured link health and active flow count, verified by concurrency stress tests.
Download Engine
Splits byte-range transfers concurrently across active links with disk-size validation and path sanitization.
Footprint
Native SwiftUI interface for macOS 14+ idling at 0.3% to 0.4% CPU after tuning timer tolerances.

Engineering Case Study

Decisions, tradeoffs, and what broke.

Verified from source code and shipped iterations, including current constraints.

Problem & Role

macOS default routing concentrates every socket on one default network adapter, leaving a fast USB 5G tether or wired connection unused when Wi-Fi stutters.

Designed and built the MergeKit networking engine, SwiftUI workstation app, local SOCKS5 relay, mergecli tool, Chromium/Firefox extension bridge, and DMG release pipeline.

Architecture

  • MergeKit Core: Darwin interface discovery (en0, en5, etc.), EWMA RTT/throughput probing, weighted least-connections scheduler, and parallel ranged downloader.
  • LocalProxyServer + BrowserBridge: 127.0.0.1:1080 SOCKS5 proxy paired with a loopback 127.0.0.1:19288 bridge for browser extension downloads.
  • mergecli & Tests: CLI inspection tool plus unit tests covering weight distribution, cooldown/revival, and 4,000 concurrent acquire/release cycles without leaked flows.

Technical Decisions

  • Local IP_BOUND_IF SOCKS5 proxy over cloud VPN bonding: avoids latency hops, remote servers, and recurring relay costs at the expense of requiring SOCKS-aware apps or system proxy config.
  • Swift 6 toolchain compiled in Swift 5 language mode on lock-guarded networking hot paths so strict actor isolation does not stall per-packet socket pumping.
  • Versioned snapshot recovery in SystemProxyManager: records each network service's pre-existing proxy state before toggling, so existing corporate proxy configurations are restored on quit or crash.

What Broke

  • A 15-second poll() idle timeout in early proxy pumping closed quiet SSH sessions and WebSockets until idle timeouts and EOF teardown were separated.
  • Ignored IP_BOUND_IF errors previously caused silent fallback onto a single adapter while UI badges claimed aggregation.
  • Wildcard CORS in the local browser bridge and unsanitized remote Content-Disposition filenames created security holes, both fixed cleanly with extension-only origin checks and DownloadItem filename sanitization.

Outcome & What Next

Completed and publicly released (v0.1.0 DMG on GitHub) with 31 automated unit tests across engine, scheduler, and security suites and ~0.3% to 0.4% measured idle CPU.

  • Broader hardware multi-link throughput benchmarking across physical Wi-Fi + USB tethering setups with Developer ID NEAppProxyProvider entitlement testing.

Documented openly in Netwich's testing guide: a single TCP connection never exceeds one interface's bandwidth, and throughput speedups only apply across multi-flow workloads or chunked range downloads.