A lightweight, Rust-based reverse proxy server with built-in CAPTCHA verification to protect your web applications from automated access.
- Reverse Proxy Functionality: Forwards requests to your backend services
- CAPTCHA Protection: Simple math-based CAPTCHA challenge to verify human users
- Session Management: Uses cookies to remember verified users
- Customizable Configuration: Easy to configure backend URL and server settings
- Rust and Cargo (latest stable version recommended)
- Clone the repository:
git clone https://github.com/shri-acha/rev-orp.git
cd rev-orp
- Build the project:
cargo build --release
Run the server with default settings:
cargo run --release
By default, the server runs on 127.0.0.1:8080
and proxies to 127.0.0.1:4000
.
The server can be configured using environment variables:
HOST
: The host address to bind the server to (default:127.0.0.1
)PORT
: The port to listen on (default:8080
)
Example:
HOST=0.0.0.0 PORT=3000 cargo run --release
- When a user visits any protected route, they are redirected to a verification page
- The user solves a simple math CAPTCHA (addition problem)
- Upon successful verification, a cookie is set, and the user can access the protected content
- The verification cookie expires after one hour
src/main.rs
- Entry point and server configurationsrc/proxy_server/mod.rs
- Proxy server setup and configurationsrc/proxy_server/handlers/mod.rs
- Request handlers for proxy, verification page, and verification logicsrc/proxy_server/static_page/verify_page.html
- CAPTCHA verification page template
The backend URL can be configured by modifying the ProxyConfig
struct in src/proxy_server/mod.rs
.
- The CAPTCHA challenge is a simple math problem, which provides basic protection
- The session cookie is set with HTTP-only flag for security
- The cookie will be set with secure flag when running over HTTPS
Contributions are welcome! Please feel free to submit a Pull Request.