NaïveProxy Documentation

repository·master·Indexed 27 days ago

https://github.com/klzgrad/naiveproxy

A proxy client and server implementation designed to mimic Chrome's network signatures. Includes guides for setting up a server using a naïve fork of Caddy forwardproxy, configuring the SOCKS5 client, and detailed specifications for its padding protocol (Proxy payload, H2 RST_STREAM, and H2 HEADERS frame padding). The repository also contains internal base libraries for memory allocation (partition_alloc), Android C++/Java APIs, and a collection of stdlib-like containers.

Tokens
196.6K
Snippets
304
Records
1.1K
Agent score
93%

What's inside NaïveProxy

  1. Overview of base/numerics library

    master

    The base/numerics library is a dependency-free, header-only C++ template library designed for safe and performant numeric operations and conversions. It provides well-defined semantics for handling arithmetic errors, boundary conditions, and type conversions.

    Key header files:

    • checked_math.h: Contains CheckedNumeric for detecting errors like overflow or truncation.
    • clamped_math.h: Contains ClampedNumeric for fast, non-sticky saturating arithmetic.
    • safe_conversions.h: Contains StrictNumeric and custom casting templates for safe type conversion.
    • safe_math.h: A convenience header that includes all the above.
  2. Overview of net/spdy HTTP/2 implementation

    master
    The net/spdy component provides the HTTP/2 implementation for Chromium. It manages session management and flow control, utilizing the QUICHE library for the serialization and decoding of data. This implementation adheres to the HTTP/2 specification (RFC 9114) and the QPACK header compression algorithm (RFC 7541).
  3. Overview of the base/containers library

    master
    The base/containers library provides a collection of stdlib-like container implementations designed for general applicability across the NaïveProxy codebase. These containers are intended to be used when a data structure is needed globally rather than being specialized for a single component.
  4. Overview of JNI Zero

    master
    JNI Zero is a middleware for the Java Native Interface (JNI) designed to reduce boilerplate, improve type safety, and enhance optimization. While it works on any JVM, its primary focus is Android development. It achieves these goals by using regular expressions to parse .java files and generating the necessary glue code for communication between Java and native code.
  5. Overview of the Net Task Scheduler

    master
    The Net Task Scheduler is a component within Chromium's network stack designed to improve user-perceived performance metrics (such as FCP and LCP). It achieves this by introducing a base::sequence_manager::SequenceManager that manages multiple prioritized task queues, ensuring high-priority network tasks (e.g., navigation-critical tasks) execute with precedence over lower-priority tasks.
  6. Overview of BoringSSL pki library

    master

    BoringSSL pki is an experimental library containing the core logic for Chrome's certificate verifier, used for Web PKI certificate path building and verification.

    Warning: This library is currently experimental. It is intended for internal use by Chrome via private APIs. There is no stable public API at this time, and any usage is at your own risk as the API may change without notice.

  7. Overview of the SQL disk cache backend

    master
    The SQL disk cache backend is an experimental implementation of the disk_cache::Backend interface. It uses SQLite to store cache entries, offering a more robust and performant alternative to default backends (like the block file backend on Windows or simple cache backends on other OSes), particularly when handling a large number of small entries. The implementation uses sharding to improve concurrency, where each shard manages its own independent SQLite database file.
  8. Understand the Unified Allocator Shim architecture

    master

    The unified allocator shim is a centralized system used to override malloc, free, operator new, and operator delete to enforce security checks and enable heap profiling. It operates in three stages:

    1. malloc symbols definition: Overrides standard C/C++ symbols (e.g., malloc, free, operator new) and routes them into the shim. Implementation varies by platform:
      • Windows: Overrides UCRT weak symbols via allocator_shim_override_ucrt_symbols_win.h.
      • Linux/CrOS: Defines exported global symbols in allocator_shim_override_libc_symbols.h and allocator_shim_override_cpp_symbols.h to allow interposition of third-party libraries.
      • Android: Uses the --Wl,-wrap,malloc linker flag. This rewrites references to __wrap_malloc (defined in allocator_shim_override_linker_wrapped_symbols.h) and provides access to the original libc symbols via __real_malloc.
    2. Shim layer implementation: Located in allocator_shim.cc. It manages a singly linked list of dispatchers that can intercept/override calls and performs security checks (e.g., suicide on malloc-failure via std::new_handler).
    3. Final allocator routing: The end of the dispatcher chain routes calls to the actual underlying allocator (e.g., glibc, Android bionic, WinHeap, or PartitionAlloc) using headers in allocator_shim_default_dispatch_to_*.