How hail-hydrant/zxc works
Core Components
• zxc Main Binary: The central executable that implements the proxy logic and coordinates session management.
• Communication Channels: Unix socket channels which connect the zxc binary with various user interface windows (Interceptor, History, Repeater, Addons) running inside tmux/Vim.
• User Interface:
– Interceptor Window: Displays intercepted HTTP/WebSocket messages and offers controls for forwarding, dropping, or modifying messages.
– History Window: Stores previous requests (HTTP history, full WebSocket history, etc.), operates in a read-only mode and manages logging.
– Repeater Window: Copies requests for repeating or re-sending them, including support for WebSocket repeater tasks.
– Addons Module: Integrates with third‐party tools (like ffuf and sqlmap). It shows a split view with the original request and terminal output of the addon program.
• Configuration Management: Global and local config files (TOML files, tmux configurations, and Vim plugin files) which are used to initialize and customize session behavior.
• Supporting Libraries/Modules: Multiple internal crates (like “buffer”, “mime”, “oneone”, “protocol_traits”, “zxc-derive”) implement HTTP parsing, state management, encryption, header and body handling, and various protocol-related processing.
• External Dependencies: OpenSSL for key generation/CA, build scripts (Makefile, mkscripts for CA and vim setups), and additional required binaries (ffuf, sqlmap, etc.).
Interactions & Data Flows
– Incoming HTTP/HTTPS/WebSocket requests from external clients hit the zxc proxy.
– Within zxc, the routing of these messages to different modules (e.g., parsing in “oneone” or “mime” modules).
– The Interceptor window (for real-time intercepted requests/responses).
– The History window (recording/logging the proxy’s transactions).
– The Repeater window (for editing and sending copied requests).
– The Addons component (for handing off requests to external command-line tools).
• That all modules communicate via a shared Unix socket channel which lines should be clearly marked as “Unix socket communication channels.”
Architectural Patterns and Technologies
• Modular Design & Separation of Concerns: Illustrate that the project is split into multiple Rust crates (each handling specific responsibilities such as parsing, communication, protocol handling, and configuration).
• Plugin-Based & Extensible UI: Outline how Vim (using zxc.vim) and tmux serve as the UI, with each window having dedicated keybindings and even separate configuration files (ftplugins).
• Client-Server Communication Pattern: The zxc binary effectively acts as a server (proxy) with front-end clients (the various Vim windows) connected over Unix sockets.
• Use of Configuration Files: Make sure to include components that represent global and local TOML-based configuration files, along with CA and tmux configuration files.
Final Checklist for the Principal Software Engineer
• Every component is clearly labeled (for example, “zxc Proxy Core”, “Interceptor UI”, “History Logger”, “Repeater”, “Addons”, and various internal libraries).
– Inbound connections flowing to the zxc binary.
• Interactions briefly (for example, “Unix socket communication”, “HTTP request parsing”, or “Configuration load”) to improve clarity.