$ show klzgrad/naiveproxy
NaΓ―veProxy is a censorship circumvention proxy that repurposes Chromium's network stack to mimic genuine Chrome HTTPS traffic at the TLS, HTTP/2, and QUIC protocol levels. The repository is a heavily trimmed Chromium source tree with custom patches for traffic padding, SOCKS5 client support, and a padding layer between proxy endpoints. It produces a statically linked `naive` binary (client and server) and an Android APK plugin (SagerNet). The architecture is a monolithic executable that bundles Chromium's networking libraries (BoringSSL, HTTP/2, QUIC) with a thin custom layer for configuration parsing and protocol padding. Key entry points are the `naive` binary (via command-line and config.json) and the Android plugin service. External dependencies include the Chromium source base (fetched at build time), BoringSSL, and system libs. The custom components (padding framer, config parser) are small, well-tested, and can be extracted for reuse in other proxy or traffic analysis projects.
The LLM identified 4 files worth highlighting for reuse:
Defines the NaΓ―veProxy configuration model (`NaiveConfig`, `NaiveListenConfig`, `PerProxyConfig`) including listen addresses, proxy chains, authentication stores, QUIC forcing, resolver range restrictions, and logging level. Parsed from `config.json` and command-line arguments. Self-contained with no internal Chromium imports other than standard types. Could be extracted for any project needing a structured proxy configuration.
Implements the NaΓ―veProxy padding protocol for early connection traffic. It frames data with padding to resist length-based traffic analysis. The framer is a simple state machine that can be reused independently, demonstrating a clean pattern for adding padding to any byte-stream protocol.
Android content provider that extracts and serves the native `libnaive.so` binary for the SagerNet plugin framework. This is a reusable pattern for packaging a native executable inside an Android app and exposing it via a content provider URI, following standard plugin contracts.
Shell script to download prebuilt Android NDK sysroots for cross-compilation. It caches and extracts sysroots deterministically. This pattern is reusable for any C++ project that needs to cross-compile for Android without a full NDK installation.