How corridor/configurable-http-proxy works
Project type and purpose
• This is an open-source, drop-in replacement for the NodeJS configurable-http-proxy (CHP), written in pure Python.
• It acts as a standalone HTTP/WebSocket reverse proxy with an embedded REST API for dynamic route configuration and pluggable storage backends.
File structure
• Top level:
• configurable_http_proxy/: main Python package
• configurable_http_proxy_test/: unit tests
• .github/, CI/CD workflows
• pyproject.toml, requirements.txt: build and dependency definitions
• Inside the package:
• cli.py: CLI entrypoint and argument parsing
• configproxy.py: core server orchestration (starting listener, wiring components)
• handlers.py: HTTP/WebSocket request handlers and API endpoint definitions
• store.py & dbstore.py: in-memory versus SQLAlchemy-backed storage implementations
• trie.py: routing data structure for fast prefix lookups
• templates/: HTML templates for error pages
• Patterns & configs:
• Single-process, modular layering (CLI → core → handlers → storage)
• Supports multiple storage backends via a strategy pattern (pluggable)
• .github/workflows/: automated tests, builds, and deploy steps
README for additional insights
• Confirms support for HTTP & WebSocket proxying, REST API for route management, token-based auth, custom headers, timeouts, error page customization.
• Highlights optional SQL storage for HA scenarios.
Detail without overcomplicating
• Break the system into the seven components listed above.
• Special behaviors (e.g., “trie-based lookup for routing”, “strategy pattern for storage”).