How gvcoder09/nodpi works
Project type and purpose
• NoDPI is a cross-platform, command-line HTTP(S) proxy tool written in Python (standard library only).
• Purpose: intercept and fragment TLS ClientHello packets according to configurable methods to bypass Deep Packet Inspection (DPI).
File structure
• Top-level artifacts:
• Dockerfile – defines a container image for running the proxy.
• nodpi.spec – PyInstaller spec for building a standalone executable.
• big-blacklist.txt / blacklist.txt – default domain filters.
• src/main.py – single-point entry-point with all logic.
• CI/CD: .github/workflows/codeql.yml.
Extract key architectural insights from the README
• Workflow: CLI → load config/blacklist → launch proxy → intercept traffic → apply fragmentation logic → forward to target → log events.
• Two fragmentation algorithms: Random and SNI-based.
• Optional autoblacklist (dynamic detection of blocked domains).
• Supports Docker, native Python run, PyInstaller build, and autostart integration on Windows/Linux.
a. CLI / Argument Parser
b. Configuration & Blacklist Manager
c. Proxy Server (TCP listener)
d. Connection Handler
e. TLS ClientHello Fragmenter
f. Outgoing Connector (to target HTTPS server)
g. Logging Subsystem (access & error logs)
h. Deployment Artifacts (PyInstaller build, Docker container)
Relationships & data flows
• User issues nodpi command → CLI parses args → config & blacklist loaded → ProxyServer starts listening on HOST:PORT.
• Browser / system HTTP(S) proxy → connects to ProxyServer.
• ConnectionHandler reads ClientHello → passes through Fragmenter (Random or SNI) → hands off patched packet to OutgoingConnector → real server.
• Responses flow back unmodified.
• BlacklistManager consulted on each hostname; autoblacklist toggles interception.
• All events funnel into Logger.
Architectural patterns & design principles
• Modular separation (even if all in main.py, conceptually split):
• Input (CLI) vs Core Logic (network, fragmentation) vs Output (network, logs).
• Strategy pattern for fragmentation methods.
• Single responsibility for Blacklist and Logging.
• Cross-platform abstraction (pure Python, no native deps).
• Deployment pipelines: containerization and packaging via PyInstaller.
Technologies / frameworks
• Python 3.9+ standard library (socketserver, ssl, argparse, logging, etc.)
• PyInstaller (via nodpi.spec)
• Docker (via Dockerfile)
• OS integration (autostart through registry or ~/.config/autostart)