A complete corporate HTTP/HTTPS proxy developed in Rust, focused on security, control, and performance. This proxy is ideal for corporate environments that require authentication, content blocking, and traffic logging.
- 🔐 Authentication via
Proxy-Authorizationheader (Basic Auth) - 🌐 HTTPS support using the
CONNECTmethod - 🚫 Domain and keyword blocking (e.g., "porn", "torrent", etc.)
- 📄 External configuration via
proxy_config.json - 📦 Automatic fallback to default settings if JSON config is missing
- 🧾 Detailed request logging
- ⚡ Multithreaded and asynchronous with
tokio
.
.
├── Cargo.lock
├── Cargo.toml
├── LICENSE
├── proxy_config.json
├── proxy_logs.jsonl
├── src
│ └── main.rs
└── README.md
- Rust (version 1.70+ recommended)
- Cargo
Clone the repository and build the project:
git clone https://github.com/filipe-freitas-dev/https_proxy.git
cd https_proxy
cargo build --releaseYou can provide a proxy_config.json file with the following structure:
{
"proxy_port": 8080,
"username": "admin",
"password": "supersecret",
"blocked_domains": ["example.com", "test.org"],
"blocked_keywords": ["porn", "torrent", "hack"]
}If the file is not found, the proxy will use default settings:
{
"proxy_port": 8080,
"username": "admin",
"password": "password",
"blocked_domains": [],
"blocked_keywords": []
}With custom configuration:
./target/release/rust-corporate-proxyOr directly with default settings:
cargo run --releaseThe proxy logs all processed requests:
- Authenticated and blocked requests
- Keyword detection
- Blocked domain access attempts
- TLS/connection errors
Example log:
{"timestamp":"2025-05-28T17:03:04.304297450Z","client_ip":"127.0.0.1","user":"admin","method":"GET","url":"http://detectportal.firefox.com/success.txt?ipv6","status":403,"blocked":true,"block_reason":"Domínio bloqueado","response_size":0}
- Persistent log storage
- Web dashboard for monitoring
- Dynamic blocking list via API
- Rate limiting
This proxy was developed as a practical project for studying cybersecurity, networking, and systems programming in Rust. It aims to deliver a robust and extensible tool for monitoring and controlling HTTP/HTTPS traffic in enterprise environments.
Made with 💻, ☕ and curiosity by Your Name or GitHub
This project is licensed under the MIT License.