$ show emanuele-em/proxelar
Proxelar is a high-performance, scriptable local traffic workbench for HTTP, HTTPS, and WebSocket debugging. It functions as a man-in-the-middle (MITM) proxy that can capture, inspect, intercept, modify, replay, and export traffic across multiple protocols (HTTP/1.1, HTTP/2, HTTP/3, WebSocket, SOCKS5, DNS, UDP, and WireGuard). The system is built as a Rust workspace with four crates: `proxelar-cli` (binary with TUI, terminal, and web GUI interfaces), `proxyapi` (core proxy engine with TLS interception, Lua scripting, addon system, route rules, and session export/import), `proxelar-proto` (transport-neutral HTTP core with sans-I/O parsers for HTTP/1 and HTTP/2), and `proxyapi_models` (shared data types for headers, sessions, and captured exchanges). It supports forward and reverse proxy modes, declarative JSON routing rules, Lua addons with SHA-256 verification, and exports to HAR, curl, and raw formats. The architecture is modular with clean dependency direction, extensive integration tests, performance benchmarks, and property-based testing. It is a production-quality developer tool comparable to mitmproxy or Charles Proxy, with a focus on performance, correctness, and extensibility.
The LLM identified 3 files worth highlighting for reuse:
Defines `HeaderBlock` and `HeaderField` – an ordered, case-preserving, duplicate-allowing, byte-safe header container with JSON serialization that supports non-UTF-8 values via base64 fallback. This is a core data structure used across all protocols and is reusable in any Rust network project needing strict header fidelity.
Implements a sans-I/O HTTP/1.x request/response parser that operates on caller-owned byte buffers. It enforces RFC 9110/9112 compliance (header limits, obs-fold rejection, transfer-coding validation) and produces structured `ParsedHead`/`ParseError` results. The incremental design decouples parsing from I/O, making it reusable across any async runtime or even no_std contexts with minimal adaptation.
Implements Lua addon validation and installation: reads a `proxelar-addon.json` manifest, verifies SHA-256 hashes for all files, checks for path traversal attempts, and atomically installs the addon into a secured directory. This pattern is a standalone, secure package verification mechanism that can be extracted for use in other tools needing integrity-checked plugin installation.