Halimun is a high-performance dynamic reverse proxy designed to protect microservices architectures.
821
Read this in other languages: Englishโ , Bahasa Indonesiaโ .
Halimun is a high-performance, ultra-low latency proxy tunnel system written in Rust. It encrypts requests end-to-end using AES-256-CBC encryption with HMAC-SHA256 integrity protection and replay attack prevention (via Nonces).
Utilizing Axum and Tokio, Halimun provides non-blocking asynchronous routing to seamlessly expose an encrypted public gateway while keeping internal microservices completely secluded within a private Docker network.
Halimun is designed to be extremely lightweight (~15MB RAM) via Docker Alpine.
1. Configuration Copy the environment template and generate encryption keys natively:
cp .env.example .env
# Generate keys using Halimun's isolated keygen
docker build -t halimun-proxy .
docker run --rm halimun-proxy ./halimun-proxy --keygen --format=env > .env
Copy your .env contents to config.yaml to configure target IPs and backend maps.
2. Start the Cluster
docker-compose up -d
Your production proxy is now securely listening on port 80 while hiding internal systems!
This section models how the proxy is placed within your infrastructure. Halimun stands as a gateway boundary line between the outside internet (via Nginx) and your isolated microservices.
The lifecycle of a single request handled by Halimun goes through these strict verification posts:
Key Concepts within the Halimun Proxy Ecosystem:
encrypted straight from the client's frontend device.halimun-proxy/
โโโ src/
โ โโโ crypto/ # AES-CBC, HMAC-SHA256, XOR, Custom Base32
โ โโโ token/ # Token payloads, validation, ReplayGuard
โ โโโ security/ # Rate Limiting & SSRF internal IP blocking
โ โโโ services/ # Dynamic Routing Registry, Health, Logging
โ โโโ proxy/ # Core Axum HTTP Handler
โ โโโ main.rs # Application Bootstrapper
โโโ dashboard/ # Glassmorphism HTML/JS Admin UI
โโโ nginx/ # Edge Gateway Configs (.htpasswd)
โโโ examples/ # Cross-Language client integration SDKs
โโโ Dockerfile # Multi-stage minimal compiler
โโโ config.yaml # Environment and route definitions
Halimun proxies requests through an encrypted tunnel using camouflage URL paths. Each request consists of:
URL Structure:
POST /proxy/1/SEGMENT1/SEGMENT2/SEGMENT3/SEGMENT4/SEGMENT5
Where one segment contains the genuine encrypted target parameters, while others are dummy segments used for pattern obfuscation.
Request Body (URL Encoded):
POST /proxy/1/XYZ...
Content-Type: application/x-www-form-urlencoded
x=ENCRYPTED_BODY_BASE32
POST /proxy/1/VQYXGZL.../KQXGYZTP.../JNZWQ4T.../AB4XGZLWF.../KQXG... HTTP/1.1
Host: your-server.com
Content-Type: application/x-www-form-urlencoded
x=JZSWY3DQEA5GQZJY4TSSEBQWFI7DKCJRFYYDELJYJ5HE2LMMZ2HU6DTPN5G...
Inside the x= payload is a decrypted structure representing:
{
"api_url": "http://backend_target:80/api/auth/login",
"api_header": {
"Authorization": "Bearer TOKEN|ID",
"Content-Type": "application/json"
},
"method": "POST",
"timestamp": 1715517600,
"expired": 300,
"offset": "+00:00",
"nonce": "550e8400-e29b-41d4-a716-446655440000",
"hmac": "8f14e45fceea167a5a36dedd4bea2543fd7144c883569d94a7350eca6d47161"
}
The actual body is attached securely to this object.
When successful, Halimun natively streams the response from the Target API exactly as provided.
Error Responses: Invalid Encryption / Manipulated (400)
{ "error": "Decryption failed: invalid token or key mismatch", "code": 400 }
HMAC Validation Failed / Modified Data (403)
{ "error": "Invalid HMAC", "code": 403 }
Replay Attack Detected (403)
{ "error": "Nonce replayed (Duplicated Request)", "code": 403 }
SSRF Loop Blocked (403)
{ "error": "Forbidden: Cannot proxy to internal addresses directly", "code": 403 }
127.0.0.1 or 192.168.x.100 r/s).Considerations:
64 hex characters (32 bytes).Halimun features an isolated, framework-free Glassmorphism Administrator UI at:
http://localhost/dashboard/ (Secured via Nginx basic auth: admin/admin123)
It acts as a control center where you can view:
If you have local rust (cargo) installed, run:
# Formats and validates
cargo fmt && cargo clippy -- -D warnings
# Runs HMAC, Encryption, and Decryption mathematics tests natively
cargo test
Run the raw library programmatically without needing config.yaml or Nginx:
cargo run --example standalone_proxy
For native Frontend and Backend code implementation patterns, review the full setups at examples/clients/ (Provides Python, Go, Node.js, and PHP implementations).
This project is open-sourced under the MIT License. See the LICENSEโ file or visit Muhammad-Ikhwan-Fathulloh/Halimun-Proxyโ for more details.
Content type
Image
Digest
sha256:aec78fae4โฆ
Size
7.6 MB
Last updated
4 months ago
docker pull ikhwan17/halimun-proxy