|
1 |
| -Rilot |
| 1 | +# Rilot |
2 | 2 |
|
3 |
| -🚀 Rilot is a fast, lightweight, Rust-based reverse proxy with optional dynamic WebAssembly (WASM) overrides.Built for multi frontends and backend microservices — designed for speed, flexibility, and simplicity. |
| 3 | +⚡ Fast, lightweight, and pluggable reverse proxy with WebAssembly (WASM) overrides. |
| 4 | +Built with ❤️ in Rust for microservices, frontend multi-zone architectures, and blazing edge performance. |
4 | 5 |
|
5 | 6 | ---
|
6 | 7 |
|
7 | 8 | ## ✨ Features
|
8 | 9 |
|
9 |
| -- ⚡ High-performance proxy built with [Hyper](https://hyper.rs/) and [Tokio](https://tokio.rs/) |
10 |
| -- 🔥 Dynamic path-based routing (exact or contain match rules) |
11 |
| -- 🔧 Optional WebAssembly (WASM) override per app route (inject custom header logic, app URL switching) |
12 |
| -- 🛡️ Minimal memory footprint |
| 10 | +- 🚀 Hot-reload WebAssembly overrides (no restart needed) |
| 11 | +- 🛡️ Minimal memory proxy with Hyper + Tokio |
| 12 | +- 🔥 Per-path dynamic routing (`contain` / `exact` match) |
| 13 | +- 🔄 Seamless header manipulation without backend code changes |
13 | 14 | - 📝 Fully customizable with simple `config.json`
|
14 |
| -- 📦 Docker-ready(coming soon) |
15 |
| -- 🔒 Licensed under MIT (no liability, use at your own risk) |
| 15 | +- ⚡ Ultra-fast cold start and live updates |
| 16 | +- 🛠️ Built-in Docker support(coming soon) |
| 17 | +- 🔒 MIT Licensed (no liability, use at your own risk) |
| 18 | + |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## 🛠️ How it Works |
| 23 | + |
| 24 | +Rilot acts as a **frontdoor proxy**, |
| 25 | +Routing based on URL paths, |
| 26 | +Injecting WebAssembly (WASM) modules dynamically to modify behavior without server restart. |
| 27 | + |
| 28 | +```plaintext |
| 29 | +[User Request] |
| 30 | + ↓ |
| 31 | +[Rilot Proxy] ──(optional WASM logic)──> [App] |
| 32 | +``` |
| 33 | + |
| 34 | +✅ Simple. |
| 35 | +✅ Flexible. |
| 36 | +✅ Powerful. |
16 | 37 |
|
17 | 38 | ---
|
18 | 39 |
|
19 | 40 | ## 📦 Installation
|
20 | 41 |
|
21 |
| -git clone https://github.com/yourusername/rilot.git |
| 42 | +### Using NPX (coming soon) |
| 43 | + |
| 44 | +```bash |
| 45 | +npx rilot |
| 46 | +``` |
| 47 | + |
| 48 | +or install globally (coming soon): |
| 49 | + |
| 50 | +```bash |
| 51 | +npm install -g rilot |
| 52 | +``` |
| 53 | + |
| 54 | +### Manual (Cargo) |
| 55 | + |
| 56 | +```bash |
| 57 | +git clone https://github.com/maninderpreetsingh/rilot.git |
22 | 58 | cd rilot
|
23 | 59 | cargo build --release
|
| 60 | +``` |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## 🚀 Quick Start Example |
| 65 | + |
| 66 | +1. Create a folder `my_app/` |
| 67 | + |
| 68 | +```plaintext |
| 69 | +my_app/ |
| 70 | + ├── config.json |
| 71 | + ├── Dockerfile (optional) -> if you want to deploy docker container |
| 72 | + └── runtime/override_sample.wasm (optional) -> build wasm with (AssemblyScript / Rust / ) |
| 73 | +``` |
| 74 | + |
| 75 | +2. Example `config.json`: |
| 76 | + |
| 77 | +```json |
| 78 | +{ |
| 79 | + "proxies": [ |
| 80 | + { |
| 81 | + "app_name": "App 1", |
| 82 | + "app_uri": "http://127.0.0.1:5502", |
| 83 | + "override_file": "/path/to/override.wasm", |
| 84 | + "rule": { |
| 85 | + "path": "/", |
| 86 | + "type": "exact" |
| 87 | + } |
| 88 | + }, |
| 89 | + { |
| 90 | + "app_name": "App 2", |
| 91 | + "app_uri": "http://127.0.0.1:5501/", |
| 92 | + "rule": { |
| 93 | + "path": "/app2", |
| 94 | + "type": "contain" |
| 95 | + } |
| 96 | + } |
| 97 | + ] |
| 98 | +} |
| 99 | +``` |
| 100 | + |
| 101 | +3. Run Rilot: |
| 102 | + |
| 103 | +```bash |
| 104 | +cargo run ./my_app/config.json |
| 105 | +``` |
| 106 | + |
| 107 | +✅ Your proxy server will start at `http://127.0.0.1:8080`! |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## ⚙️ Configuration Explained |
| 112 | + |
| 113 | +- `app_name`: Friendly name for your service |
| 114 | +- `app_uri`: Target backend URL |
| 115 | +- `override_file`: Optional WebAssembly module to override headers / routing |
| 116 | +- `rule.path`: URL path to match |
| 117 | +- `rule.type`: `"exact"` or `"contain"` |
| 118 | + |
| 119 | +✅ No complicated config — simple and powerful. |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +## 🔥 Live Hot-Reload of Overrides |
24 | 124 |
|
| 125 | +Every request dynamically loads the `.wasm` file! |
| 126 | +✅ No server restart needed |
| 127 | +✅ Modify your override logic live |
| 128 | +✅ Instant effect on next request |
25 | 129 |
|
26 | 130 | ---
|
27 | 131 |
|
|
0 commit comments