Nahan (Persian for Hidden/Concealed) is a secure, lightweight, and highly customizable reverse proxy that runs entirely on the edge. It transforms your Cloudflare Worker into a powerful, obfuscated gateway using VLESS or Trojan protocols, managed via a beautiful, self-contained Web UI.
- Why Nahan?
- Key Features
- Prerequisites
- Quick Install Options
- Step-by-Step Deployment Guide
- Dashboard Guide
- Advanced Configuration
- Useful Resources
- Applying Configuration Changes
- FAQ & Troubleshooting
- Contributing
- License
Nahan isn't just a proxy script — it's a complete management solution designed for stealth, speed, and ease of use.
- 🛡️ Hidden in Plain Sight: Unauthorized access attempts are proxied to legitimate sites (e.g.,
ubuntu.comordocker.com), making your gateway look like a regular website to network scanners. - ⚡ Zero Server Cost: Runs entirely on Cloudflare's free plan. No VPS, no server maintenance.
- 🎨 Modern Dashboard: A fully embedded, mobile-friendly dashboard with Dark/Light modes and dual-language support (English / فارسی).
- 🤖 Telegram Bot Integration: Manage your gateway, check usage, and receive login alerts directly via Telegram.
- 📡 Multi-User & Multi-IP: Generate dedicated subscription links for different users and automatically combine them with clean IP lists.
- 💾 D1 SQLite Storage: Configuration persists in Cloudflare D1 database, eliminating KV write limitations.
| Feature | Description |
|---|---|
| 🔐 Dual Protocol | Switch instantly between VLESS (Alpha), Trojan (Beta), or Both simultaneously |
| 📱 QR Code Generation | Modal-based QR codes for instant mobile client configuration |
| 👥 Multi-User Profiles | Create separate profiles with unique subscription links, per-user nodes, and per-user NAT64 |
| 🌍 Clean IP Multiplexer | Input a list of clean Cloudflare IPs — Nahan auto-generates configs for all of them |
| 🌐 NAT64 Support | Automatic IPv4-to-NAT64-mapped IPv6 conversion with multiple prefix support |
| ⚙️ Real-Time Metrics | View Origin IP, Edge Node location, and run browser-side latency diagnostics |
| 💾 D1 SQLite Storage | All configuration persists in Cloudflare D1 even after code updates |
| 🚨 Kill Switch | Immediately pause all proxy traffic with one click from the dashboard or Telegram |
| 📊 Bandwidth Management | Track per-user upload/download with TB/GB limits and pause/resume controls |
| 📋 Activity Logs | Full history of login attempts and configuration changes |
| 🔒 ECH Support | Toggle Encrypted Client Hello (ECH) parameters in generated client configs |
| 📦 Backup & Restore | Export/import your full configuration as a .json file |
| 🔄 Auto Update | Automatic deployment of new versions from GitHub with format and obfuscation options |
| 🎭 Configurable Fake Configs | Customizable fake subscription entries with {usage} and {expiry} template variables |
| 🖥️ Per-User Nodes | Define custom hostnames per subscriber for multi-region deployments |
| 🏷️ Rich Name Strategy | Config naming with {FLAG}, {COUNTRY}, {CITY}, {ISP}, {HOST}, {DATE}, {WORKER} tags |
| 🌐 Bilingual Subscription Page | Subscription info page with full Persian/Farsi and English support, RTL layout, and dark/light mode toggle |
| 🤖 Telegram Bot Management | Full gateway management via inline Telegram buttons — users, settings, logs, and advanced config |
| 🔗 Linked Panels (Other Nodes) | Connect multiple Nahan panels securely with API Keys for cross-panel management and update propagation |
- A Cloudflare account (free tier is sufficient) — sign up here
- Access to Workers & Pages and D1 SQLite Database in your Cloudflare Dashboard
- A modern web browser
- (Optional) A Telegram Bot Token and Chat ID for bot integration
For easier deployment you can use:
- Telegram Install Bot: @itsyebekhebot
- Web Installer: https://erpycode.github.io/nahan-installer/
Or follow the manual steps below.
- Log in to the Cloudflare Dashboard.
- Go to Storage and databases → D1 SQLite Database.
- Click Create database.
- Enter a name (e.g.
iot_db) and click Create.
- Go to Workers & Pages → Create application → Create Worker.
- Name it (e.g.
nahan-core) and click Deploy. - Click Edit code, delete the placeholder, and paste the full content of
_worker.js. - Click Save and Deploy.
- Open your Worker → Settings → Bindings → Add binding.
- Type: D1 database
- Variable name:
IOT_DB(must be exact) - Select the database you created → Save → Deploy.
Open:
https://<your-worker-domain>/sync/dash
Visiting
/or/syncwithout/dashshows a camouflage page (Ubuntu/Docker). This is intentional.
- Login with the default master key:
admin - Immediately go to System tab and:
- Change Master Key
- Change API Route to a secret path (bookmark the new URL!)
- Set or auto-generate Device UUID
- Click Update Config.
The dashboard includes these main sections:
| Tab | Purpose |
|---|---|
| Overview | User summary cards, traffic stats, and update banner |
| Endpoints | Connection URIs, QR codes, and subscription links |
| Metrics | Live usage, Origin IP, Edge Node (Colo), latency diagnostics |
| System | Core settings (protocol, UUID, API Route, Master Key, ports, Auto-Update, Panel API Keys, Backup) |
| Advanced | Clean IPs, Linked Panels, Multi-User, Telegram, Kill Switch, ECH, NAT64, etc. |
| Logs | Login attempts and configuration change history |
| Clients | Visual multi-user management |
| Help | Built-in help and FAQ |
In Advanced → Clean IPs, enter one IP (or IP#Name) per line. The subscription will contain a separate config for each IP.
Recommended tools for finding Clean IPs:
- GitHub: senpaiscanner
- Telegram: @itsZetaBot
Recommended bot: @nahanproxyipbot
Connect external Nahan panels using URL + API Key for cross-panel management and update propagation.
(Legacy slaveNodes / Cascade fields are automatically migrated to linkedPanels.)
Format (one per line):
<uuid>:Username
Access: https://<worker>/sync/sub?sub=Username
- Create a bot via @BotFather
- Get Chat ID from @userinfobot
- Enter Token + Chat ID in Advanced tab and save
Commands: /status, /pause (Kill Switch)
Toggle in Advanced (or send /pause via Telegram) to immediately stop all proxy traffic while keeping the worker alive.
| Purpose | Resource |
|---|---|
| Clean IP finder | senpaiscanner · @itsZetaBot |
| Relay IP | @nahanproxyipbot |
| Easy Install (Telegram) | @itsyebekhebot |
| Web Installer | erpycode.github.io/nahan-installer |
After changing anything in System or Advanced:
- Click Update Config at the bottom.
- Wait for “Syncing…” then the page reloads.
If you changed the API Route, the page redirects to the new path — bookmark it.
⚠️ IOT_DB namespace missing!
→ D1 binding is missing or the variable name is not exactly IOT_DB. Fix in Worker Settings → Bindings and redeploy.
Root URL shows Ubuntu/Docker
→ Expected behavior. Always use /sync/dash (or your custom API Route + /dash).
Forgot Master Key or API Route
→ Check values in the D1 Console (sys_config key).
Free plan limits
→ 100,000 requests/day. Monitor via Cloudflare Analytics integration in Advanced.
- Fork the repository
- Create a branch
- Make your changes
- Open a Pull Request
MIT License — see LICENSE
Made with ❤️ by the Open Source Community