A high-performance proxy server with user-based authentication and traffic statistics.
Proxy Centauri (aka Procent) is a proxy server that provides a single entry point for routing traffic through multiple proxy providers with per-user configuration and detailed statistics aggregation.
Warning
This project is currently under active development. APIs and features may change.
- 🔐 User-based authentication - Basic auth with credentials database
- 📊 Detailed statistics - Per-user ingress/egress traffic monitoring
- ⚡ High performance - Built with Tokio async runtime
- 🧪 Well tested - Comprehensive integration test suite
- 🔧 Configurable - Environment-based configuration
- Rust 1.75 or higher
- Cargo
git clone https://github.com/yourusername/proxy-centauri.git
cd proxy-centauri
cargo build --releaseCreate a .env file in the project root:
PROXY_PORT=9090
PROXY_HOST=127.0.0.1cargo run --releaseThe proxy server will start on 127.0.0.1:9090 (or your configured address).
Configure your client to use the proxy:
# Using curl
curl -x http://procent:o953zY7lnkYMEl5D@127.0.0.1:9090 https://example.com
# Using environment variables
export HTTP_PROXY=http://procent:o953zY7lnkYMEl5D@127.0.0.1:9090
export HTTPS_PROXY=http://procent:o953zY7lnkYMEl5D@127.0.0.1:9090- Username:
procent - Password:
o953zY7lnkYMEl5D
Or:
- Username:
admin - Password:
12345
Note
Credentials are currently hardcoded in lib/auth.rs. In production, use a proper authentication backend.
proxy_centauri/
├── bin/
│ └── main.rs # Application entry point
└── lib/
├── lib.rs # Library root
├── server.rs # Server orchestration
├── handler.rs # Connection handling logic
├── tunnel.rs # TCP tunneling
├── auth.rs # Authentication & database
├── config.rs # Configuration management
├── statistics.rs # Traffic statistics
├── http_utils/ # HTTP utilities
│ ├── request.rs # Request helpers
│ └── response.rs # Response types
└── tests/ # Integration tests
Run the test suite:
# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test
cargo test test_proxy_auth_required- ✅ Proxy authentication required (407)
- ✅ Unauthorized access (401)
- ✅ Method not allowed (405)
- ✅ Successful CONNECT tunnel (200)
- ✅ Malformed request handling
- ✅ Server cleanup on drop
The proxy tracks per-user traffic statistics:
User `procent` stats:
ingress: 1056 bytes
egress: 5618 bytes
Statistics are logged every 10 seconds during runtime.
# Debug build
cargo build
# Release build
cargo build --release
# Check without building
cargo checkcargo clippy --all-targets --all-featurescargo fmt --allContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Dynamic user management API
- Persistent statistics storage
- HTTP/2 support
- Rate limiting per user
- Docker containerization
- Prometheus metrics export
- Configuration hot-reload
- Multiple backend proxy support
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ and Rust