A high-performance, configuration-driven reverse proxy tool built in Python that enables developers to easily route HTTP requests from custom domain names to different backend services running on localhost ports.
- Simple Configuration: Single JSON/YAML configuration file
- Host-based Routing: Route requests based on HTTP Host header
- Fast Performance: Built with FastAPI and async I/O
- Easy Setup: Minimal configuration for local development
- Health Monitoring: Built-in health check and monitoring endpoints
- CORS Support: Automatic CORS handling for development
- Rich CLI: Beautiful command-line interface with Rich
# Clone the repository
git clone <repository-url>
cd rapid-dev-proxy
# Install dependencies
uv sync
# Install the package in development mode
uv pip install -e .pip install rapid-dev-proxyTo build a standalone executable:
# Install PyInstaller
uv add pyinstaller
# Build using PowerShell (Windows)
.\build.ps1
# Build using batch file (Windows)
.\build.bat
# Build using Python script
python build.py
# Or build directly with PyInstaller
uv run python -m PyInstaller rapid_dev_proxy.specThe executable will be created in the dist/ directory as rapid-dev-proxy.exe.
Note: The executable is approximately 18MB and includes all dependencies, making it completely standalone.
Once built, you can use the executable directly:
# Show help
.\dist\rapid-dev-proxy.exe --help
# Create sample configuration
.\dist\rapid-dev-proxy.exe init
# Start the proxy
.\dist\rapid-dev-proxy.exe start -c config.json
# Validate configuration
.\dist\rapid-dev-proxy.exe validate -c config.jsonThe executable works exactly like the Python version but doesn't require Python or any dependencies to be installed.
-
Create a sample configuration:
rapid-dev-proxy init
-
Edit the configuration file (
config.json):{ "proxy": { "host": "127.0.0.1", "port": 8080 }, "routes": { "api.local": { "target": "http://127.0.0.1:3000", "metadata": { "description": "API Server" } }, "app.local": { "target": "http://127.0.0.1:8080", "metadata": { "description": "Frontend App" } } }, "default": { "target": "http://127.0.0.1:3000" } } -
Start the proxy server:
rapid-dev-proxy start
-
Add to your hosts file (optional):
127.0.0.1 api.local 127.0.0.1 app.local -
Access your services:
- API: http://api.local:8080
- App: http://app.local:8080
The proxy uses a JSON or YAML configuration file with the following structure:
{
"proxy": {
"host": "127.0.0.1",
"port": 8080,
"timeout": 30.0,
"max_connections": 100
},
"routes": {
"domain.local": {
"target": "http://127.0.0.1:3000",
"metadata": {
"description": "Service Description"
}
}
},
"default": {
"target": "http://127.0.0.1:3000",
"error_pages": {
"404": "Not Found",
"502": "Bad Gateway"
}
},
"logging": {
"level": "INFO",
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
"destination": "console"
},
"security": {
"cors_enabled": true,
"rate_limit_enabled": false,
"auth_headers": {}
}
}| Section | Option | Type | Default | Description |
|---|---|---|---|---|
proxy |
host |
string | 127.0.0.1 |
Host to bind to |
proxy |
port |
integer | 8080 |
Port to bind to |
proxy |
timeout |
float | 30.0 |
Request timeout in seconds |
proxy |
max_connections |
integer | 100 |
Maximum concurrent connections |
routes |
domain |
object | - | Domain to route mapping |
default |
target |
string | - | Default target URL |
logging |
level |
string | INFO |
Log level |
security |
cors_enabled |
boolean | true |
Enable CORS headers |
| Command | Description | Example |
|---|---|---|
start |
Start the proxy server | rapid-dev-proxy start |
validate |
Validate configuration | rapid-dev-proxy validate |
init |
Create sample config | rapid-dev-proxy init |
routes |
List configured routes | rapid-dev-proxy routes |
version |
Show version info | rapid-dev-proxy version |
| Option | Description | Default |
|---|---|---|
--config, -c |
Configuration file path | config.json |
--host, -h |
Override bind host | From config |
--port, -p |
Override bind port | From config |
--reload |
Enable auto-reload | false |
--debug |
Enable debug mode | false |
The proxy server provides several built-in endpoints:
GET /health- Health check and statisticsGET /routes- List all configured routes{path}- Proxy all other requests to backend services
rapid-dev-proxy/
├── rapid_dev_proxy/
│ ├── __init__.py
│ ├── config.py # Configuration models
│ ├── config_manager.py # Configuration management
│ ├── proxy_server.py # Main proxy server
│ └── cli.py # Command line interface
├── pyproject.toml
├── README.md
└── config.json
# Install in development mode
uv pip install -e .
# Run with auto-reload
rapid-dev-proxy start --reload --debug
# Run tests
uv run pytest# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=rapid_dev_proxy
# Run specific test file
uv run pytest tests/test_proxy_server.py- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.