The Problem Many enterprise tools (e.g., Proxifier) require a paid license to redirect arbitrary TCP/UDP traffic through HTTP or SOCKS5 proxies. Developers and security teams that need a free, cross‑platform alternative must build and maintain separate solutions for Windows, macOS and Linux, which adds operational overhead and introduces inconsistencies.


What This Does ProxyBridge implements a lightweight proxy‑redirection engine that works on Windows, macOS and Linux. The core logic lives in the C source files src/ProxyBridge.c / src/ProxyBridge.h (one copy per platform). Platform‑specific wrappers (Windows/src/pb_*.c, Linux/src/ProxyBridge.c, and macOS Swift UI files) invoke the same library functions, so rule handling, DNS interception and traffic forwarding are identical across OSes.

  • CLI binaries are built from Linux/cli/main.c, Windows/cli/main.c and MacOS/ProxyBridge/ProxyBridge.xcodeproj.
  • GUI binaries are built from Linux/gui/main.c and the macOS Swift UI (ContentView.swift, ProxyBridgeGUI.swift).
  • Build scripts (Linux/build.sh, MacOS/ProxyBridge/build.sh, Windows/compile.ps1) drive the respective compilers and package the executables.

The rule engine reads a JSON‑style configuration (found in the Windows/gui/profile/ folder) and populates internal data structures defined in src/ProxyBridge.h. Traffic is captured via platform hooks (pb_conntrack.c on Windows, pb_dns.c on Linux) and forwarded through the selected proxy using the pb_socks5.c and pb_http.c modules.


How It Is Wired

Entry pointFirst callCore libraryPlatform modulesEffect
Linux/cli/main.c (or Windows/cli/main.c)int main()InitializeProxyBridge()src/ProxyBridge.cWindows: pb_conntrack.c, pb_dns.c; Linux: pb_dns.c, pb_http.cParses CLI args, loads rule set, registers network hooks
Linux/gui/main.c / macOS Swift UIint main()InitializeProxyBridge()src/ProxyBridge.cSame as CLI plus GUI callbacks (gui_*.c on Linux, Swift view models)Starts background proxy engine, opens UI thread
src/ProxyBridge.cInitializeProxyBridge()LoadRules()src/ProxyBridge.cCalls pb_rules.c (Linux) / pb_rules.c (Windows)Populates in‑memory rule table
pb_rules.cApplyRule()pb_proxy.c / pb_socks5.cpb_proxy.c (generic proxy dispatcher)Calls pb_socks5.c for SOCKS5, pb_http.c for HTTPOpens socket to upstream proxy, sets up bidirectional forwarding
pb_conntrack.c (Windows) / pb_dns.c (Linux)Hook callbacks (OnPacket) → pb_proxy.cpb_proxy.cUses the rule table to decide routePerforms per‑process routing, blocks or allows traffic

The widest blast radius is src/ProxyBridge.c because it owns rule loading and the central dispatch to all pb_* modules. Changing its API requires updates in every entry point (CLI, GUI, Windows service). The call graph is a shallow tree: main → InitializeProxyBridge → LoadRules → pb_* with no cycles, simplifying future modifications.


How To Use It

# Clone the repo (use the exact URL)
git clone https://github.com/moses-y/ProxyBridge
cd ProxyBridge

# Linux CLI build
make -C Linux/cli          # uses Linux/cli/Makefile → builds proxybridge_cli

# Linux GUI build (requires GTK/Qt, not bundled)
make -C Linux/src         # builds shared library
make -C Linux/gui         # links GUI against the library

# Windows build (PowerShell)
.\Windows\compile.ps1     # invokes MSVC to produce proxybridge_cli.exe and GUI.exe

# macOS build (Xcode)
xcodebuild -project MacOS/ProxyBridge/ProxyBridge.xcodeproj -scheme ProxyBridge -configuration Release

Configuration files reside under Windows/gui/profile/ (JSON) and are read automatically at startup; on Linux/macOS the same format is expected in Linux/src/ (not yet committed, create proxybridge_rules.json). Run the CLI with ./proxybridge_cli -c proxybridge_rules.json -p socks5://127.0.0.1:1080.


Real‑World Use A security testing lab needs all containerized tools to send traffic through a central SOCKS5 proxy for logging. Deploy the Linux CLI on each host, point it at the proxy with -p socks5://proxy.example.com:1080, and supply a rule file that matches the container process names. The daemon intercepts both TCP and UDP packets, forwards them, and logs connections via the pb_proxy.c callbacks, giving the lab a single point of visibility without altering individual tool configurations.


Code Health & Issues

  • Low – Missing unit tests – only 1 test file detected, coverage appears minimal.
  • Low – Platform‑specific duplication – separate ProxyBridge.c copies for each OS increase maintenance load.
  • Low – No automated package publishing – CI builds binaries but no artifact upload step.
  • Low – Documentation gaps – README shows download badges but lacks concrete CLI flag list; the Linux rule file format is undocumented.

No static analysis warnings were reported by the existing CI (GitHub Actions, CodeQL). License file (MIT) and contribution guidelines are present.


The Bottom Line ProxyBridge delivers a functional, open‑source alternative to commercial proxy redirection tools, with a clear separation between a shared C core and thin platform wrappers. Build scripts are straightforward, but the duplicated core code and scarce testing mean that any functional change will require careful cross‑platform verification. Ideal for teams that need a free, controllable proxy bridge and are comfortable compiling native code.