feat: update to v1.1 — add Xray pipeline, deploy, worker proxy, connection manager
This commit is contained in:
476
README.md
476
README.md
@@ -2,13 +2,14 @@
|
||||
|
||||
# ⚡ cfray
|
||||
|
||||
### Cloudflare Config Scanner & Clean IP Finder
|
||||
### Cloudflare Proxy Toolkit
|
||||
|
||||
**Test VLESS/VMess proxy configs for latency & speed + Scan all ~1.5M Cloudflare IPs to find clean, reachable edges**
|
||||
**Scan configs + Find clean IPs + Deploy Xray servers + Pipeline test with DPI bypass + Worker proxy**
|
||||
|
||||
[](https://python.org)
|
||||
[](#)
|
||||
[](LICENSE)
|
||||
[](#)
|
||||
|
||||
[English](#-english) • [فارسی](#-فارسی)
|
||||
|
||||
@@ -20,7 +21,14 @@
|
||||
|
||||
### 📖 What is cfray?
|
||||
|
||||
cfray is a single-file Python tool that finds the **fastest Cloudflare edge IPs** for your VLESS/VMess proxy configs. It tests latency (ping) and download speed across hundreds of IPs, ranks them by score, and exports the best configs — ready to use. It also includes a **Clean IP Finder** that scans all ~1.5M Cloudflare IPv4 addresses (from 14 published subnets) to discover reachable edge IPs. Mega mode tests each IP on 2 ports for ~3M total probes.
|
||||
cfray is a single-file Python proxy toolkit for VLESS/VMess configs behind Cloudflare. What started as an IP scanner is now a full suite:
|
||||
|
||||
- **Config Scanner** — test hundreds of IPs for latency + download speed, rank by score, export the best configs
|
||||
- **Clean IP Finder** — scan all ~1.5M Cloudflare IPv4 addresses to find reachable edge IPs (Mega mode: ~3M probes on 2 ports)
|
||||
- **Xray Pipeline Test** — 3-stage pipeline that scans IPs, swaps them into your config, and expands with fragment presets + SNI variations to bypass DPI/firewall blocks
|
||||
- **Deploy Xray Server** — deploy a full xray-core server on any Linux VPS with systemd, TLS certs, REALITY keys, and multi-config support
|
||||
- **Worker Proxy** — generate a Cloudflare Worker script for a fresh `workers.dev` SNI on any VLESS WebSocket config
|
||||
- **Connection Manager** — manage inbounds, users, URIs, and uninstall on deployed servers
|
||||
|
||||
**Zero dependencies.** Just Python 3.8+ and one file.
|
||||
|
||||
@@ -271,11 +279,229 @@ cfray is smart about Cloudflare's speed test limits:
|
||||
|
||||
---
|
||||
|
||||
### 🆕 What's New in v1.1
|
||||
|
||||
v1.1 adds **server deployment**, **pipeline testing**, **worker proxy**, and a **connection manager** — turning cfray from a scanner into a full proxy toolkit.
|
||||
|
||||
---
|
||||
|
||||
### ⚡ Xray Pipeline Test `[X]`
|
||||
|
||||
A smart 3-stage pipeline that takes a single VLESS/VMess config and finds the best way to connect through it — including DPI bypass via TLS fragmentation.
|
||||
|
||||
**How it works:**
|
||||
|
||||
```
|
||||
Stage 1: 🔍 IP Scan
|
||||
Scans Cloudflare IP ranges to find clean, reachable IPs.
|
||||
Tests thousands of IPs in parallel via TLS handshake.
|
||||
|
||||
Stage 2: 🧪 Base Test
|
||||
Swaps each clean IP into your config and tests if it actually
|
||||
passes traffic. Uses a direct VLESS tunnel to verify real
|
||||
connectivity — not just a handshake. Filters down to IPs
|
||||
that work with your specific config.
|
||||
|
||||
Stage 3: 🔧 Fragment Expansion
|
||||
Takes the working IPs and expands them with DPI bypass fragment
|
||||
presets + SNI variations:
|
||||
- light: 100-200 byte fragments, 10-20ms interval
|
||||
- medium: 50-200 byte fragments, 10-40ms interval
|
||||
- heavy: 10-300 byte fragments, 5-50ms interval
|
||||
Finds the best combination of IP + fragment + SNI.
|
||||
```
|
||||
|
||||
**Use case:** You have a config that doesn't connect (blocked by DPI/firewall). Instead of manually trying different IPs and fragment settings, the pipeline automatically finds working combinations.
|
||||
|
||||
**xray-core** is required — cfray downloads it automatically on first use or you can install manually:
|
||||
|
||||
```bash
|
||||
# Auto-install xray-core
|
||||
python3 scanner.py --xray-install
|
||||
|
||||
# Interactive pipeline
|
||||
python3 scanner.py # Press X
|
||||
|
||||
# CLI — test a specific config
|
||||
python3 scanner.py --xray 'vless://uuid@domain:443?type=ws&security=tls#myconfig'
|
||||
|
||||
# CLI — only heavy fragments, keep top 5
|
||||
python3 scanner.py --xray 'vless://...' --xray-frag heavy --xray-keep 5
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🚀 Deploy Xray Server `[D]`
|
||||
|
||||
Deploy a fully configured Xray proxy server on any Linux VPS in under 2 minutes. The wizard walks you through every step — protocol, transport, security, port — and generates ready-to-use client URIs.
|
||||
|
||||
**What it sets up:**
|
||||
- Downloads and installs **xray-core** binary
|
||||
- Generates server config with your chosen protocol/transport/security
|
||||
- Creates **systemd service** for auto-start on boot
|
||||
- Obtains **TLS certificates** via certbot (for TLS security)
|
||||
- Generates **x25519 keypair** (for REALITY security)
|
||||
- Outputs client VLESS/VMess URIs you can import directly into your app
|
||||
|
||||
**Supported options:**
|
||||
|
||||
| Category | Options |
|
||||
|------------|----------------------------------------------|
|
||||
| Protocol | VLESS, VMess |
|
||||
| Transport | TCP, WebSocket, gRPC, HTTP/2, XHTTP |
|
||||
| Security | REALITY, TLS, None |
|
||||
| Ports | Any port (default 443) |
|
||||
|
||||
> **Note:** REALITY mode only supports TCP, gRPC, and HTTP/2 transports. WebSocket and XHTTP are available with TLS or None security.
|
||||
|
||||
**REALITY** is the recommended security mode — it doesn't need a domain or TLS certificates. It uses x25519 key exchange with a "camouflage" SNI (like `yahoo.com` or `google.com`) to make traffic look like normal HTTPS.
|
||||
|
||||
**XHTTP** (also called SplitHTTP) is a CDN-compatible transport that works well behind Cloudflare and other CDN providers. It splits HTTP requests in a way that bypasses many DPI systems.
|
||||
|
||||
**Multi-config deploy:** You can deploy multiple protocol configurations in a single session. For example, deploy TCP+REALITY on port 443 *and* WS+TLS on port 444 on the same server. Each config gets its own UUID and port. REALITY keys and TLS certificates are generated once and reused across configs.
|
||||
|
||||
```bash
|
||||
# Interactive wizard (recommended)
|
||||
python3 scanner.py # Press D
|
||||
|
||||
# CLI — deploy TCP+REALITY
|
||||
python3 scanner.py --deploy --deploy-transport tcp --deploy-security reality
|
||||
|
||||
# CLI — deploy WS+TLS with custom domain
|
||||
python3 scanner.py --deploy --deploy-transport ws --deploy-security tls --deploy-sni yourdomain.com
|
||||
|
||||
# CLI — custom port and protocol
|
||||
python3 scanner.py --deploy --deploy-protocol vmess --deploy-transport grpc --deploy-port 8443
|
||||
```
|
||||
|
||||
**After deploy,** you get an interactive menu:
|
||||
- **[V] View URIs** — display all generated client configs again (they don't disappear)
|
||||
- **[M] Connection Manager** — jump straight to managing the server
|
||||
- **[Q] Back** — return to main menu
|
||||
|
||||
---
|
||||
|
||||
### ☁️ Worker Proxy `[O]`
|
||||
|
||||
Get a fresh **Cloudflare Workers** SNI for any VLESS config. cfray generates a Worker script that proxies WebSocket traffic to your backend server — you deploy it to your Cloudflare account and get a clean, unblocked `workers.dev` SNI.
|
||||
|
||||
**How it works:**
|
||||
1. You provide a working VLESS config (WebSocket transport required)
|
||||
2. cfray generates a JavaScript Worker script that relays WebSocket connections to your backend
|
||||
3. cfray shows the script + step-by-step instructions to deploy it on `dash.cloudflare.com`
|
||||
4. You paste the resulting Worker URL back into cfray
|
||||
5. cfray outputs a new config with the fresh `*.workers.dev` domain as SNI
|
||||
|
||||
**Use case:** Your config works but the SNI/domain is blocked in your region. Instead of finding a new domain, you create a Workers proxy that gives you a clean `workers.dev` SNI. Since Cloudflare Workers domains are widely used for legitimate purposes, they're rarely blocked.
|
||||
|
||||
**Requirements:**
|
||||
- A Cloudflare account (free tier works)
|
||||
- Your original config must use **WebSocket** transport (Workers only proxy WS traffic)
|
||||
|
||||
```bash
|
||||
# Interactive
|
||||
python3 scanner.py # Press O
|
||||
|
||||
# The wizard will ask for:
|
||||
# 1. Your VLESS config URI
|
||||
# 2. Generates script + shows manual deploy instructions
|
||||
# 3. Your Worker URL (after you deploy it on dash.cloudflare.com)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🔧 Connection Manager `[C]`
|
||||
|
||||
Manage an existing Xray server's configuration directly — add/remove inbounds, manage users, view client URIs, and uninstall. Works with any xray-core server deployed by cfray.
|
||||
|
||||
**What you can do:**
|
||||
|
||||
| Key | Action |
|
||||
|-----|--------|
|
||||
| `A` | **Add inbound** — create a new protocol/transport/port |
|
||||
| `V` | **View** — view inbound JSON details |
|
||||
| `U` | **Add user** — add a new UUID to an existing inbound |
|
||||
| `X` | **Remove inbound** — delete an existing inbound |
|
||||
| `S` | **Show URIs** — display all client URIs for every user |
|
||||
| `R` | **Restart xray** — restart the xray service |
|
||||
| `L` | **Logs** — view xray service logs |
|
||||
| `D` | **Uninstall** — completely remove xray, configs, systemd |
|
||||
| `B` | **Back** — return to main menu |
|
||||
|
||||
**Show URIs** generates VLESS/VMess client URIs from the server's config file for every inbound and every user. This is useful when you've deployed multiple configs and need to share the URIs with users, or when you've lost the original URIs from deploy time.
|
||||
|
||||
**Uninstall** completely removes everything cfray installed: stops the xray service, removes the binary, deletes config files, removes the systemd service, and cleans up the `~/.cfray/` directory. Requires typing "uninstall" to confirm (safety check).
|
||||
|
||||
```bash
|
||||
# Interactive
|
||||
python3 scanner.py # Press C
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🔧 Updated CLI Options
|
||||
|
||||
New flags added in v1.1:
|
||||
|
||||
| Option | Description | Default |
|
||||
|---------------------|----------------------------------------------|---------------|
|
||||
| `--xray URI` | Test a VLESS/VMess URI through xray pipeline | — |
|
||||
| `--xray-frag` | Fragment preset: `none`/`light`/`medium`/`heavy`/`all` | `all` |
|
||||
| `--xray-bin PATH` | Path to xray binary (auto-detect if not set) | auto |
|
||||
| `--xray-install` | Download and install xray-core to `~/.cfray/bin/` | off |
|
||||
| `--xray-keep N` | Export top N pipeline results | 10 |
|
||||
| `--deploy` | Deploy Xray server on this Linux VPS | — |
|
||||
| `--deploy-port` | Server listen port | 443 |
|
||||
| `--deploy-protocol` | `vless` / `vmess` | `vless` |
|
||||
| `--deploy-transport`| `tcp` / `ws` / `grpc` / `h2` | `tcp` |
|
||||
| `--deploy-security` | `reality` / `tls` / `none` | `reality` |
|
||||
| `--deploy-sni` | SNI domain for TLS/REALITY | — |
|
||||
| `--deploy-cert` | Path to TLS certificate | — |
|
||||
| `--deploy-key` | Path to TLS private key | — |
|
||||
| `--deploy-ip` | Override auto-detected server IP | auto |
|
||||
| `--uninstall` | Remove everything cfray installed | off |
|
||||
|
||||
---
|
||||
|
||||
### 💡 More Examples (v1.1)
|
||||
|
||||
```bash
|
||||
# Install xray-core (needed for Pipeline Test)
|
||||
python3 scanner.py --xray-install
|
||||
|
||||
# Pipeline test — find working IP + fragment combo for a blocked config
|
||||
python3 scanner.py --xray 'vless://uuid@blocked-domain:443?type=ws&security=tls#config'
|
||||
|
||||
# Pipeline test — only try heavy fragments, export top 3
|
||||
python3 scanner.py --xray 'vless://...' --xray-frag heavy --xray-keep 3
|
||||
|
||||
# Deploy — quick TCP+REALITY server (recommended for beginners)
|
||||
python3 scanner.py --deploy
|
||||
|
||||
# Deploy — WS+TLS for CDN routing
|
||||
python3 scanner.py --deploy --deploy-transport ws --deploy-security tls --deploy-sni example.com
|
||||
|
||||
# Deploy — VMess over gRPC
|
||||
python3 scanner.py --deploy --deploy-protocol vmess --deploy-transport grpc
|
||||
|
||||
# Uninstall everything cfray deployed
|
||||
python3 scanner.py --uninstall
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🇮🇷 فارسی
|
||||
|
||||
### 📖 cfray چیه؟
|
||||
|
||||
cfray یه ابزار پایتونه که **سریعترین آیپیهای کلادفلر** رو برای کانفیگهای VLESS/VMess پیدا میکنه. پینگ و سرعت دانلود رو تست میکنه، بهترینها رو امتیاز میده و خروجی آماده استفاده میده. همچنین شامل **جستجوگر آیپی تمیز** هست که تمام ~۱.۵ میلیون آیپی IPv4 کلادفلر (از ۱۴ زیرشبکه) رو اسکن میکنه. حالت Mega هر آیپی رو روی ۲ پورت تست میکنه (~۳ میلیون پروب).
|
||||
cfray یه ابزار کامل پایتونی برای کانفیگهای VLESS/VMess پشت کلادفلره. یه فایل تکی که همه چیز رو داره:
|
||||
|
||||
- **اسکنر کانفیگ** — تست صدها آیپی برای پینگ + سرعت دانلود، رتبهبندی و خروجی بهترین کانفیگها
|
||||
- **جستجوگر آیپی تمیز** — اسکن تمام ~۱.۵ میلیون آیپی IPv4 کلادفلر (حالت Mega: ~۳ میلیون پروب روی ۲ پورت)
|
||||
- **تست پایپلاین Xray** — پایپلاین ۳ مرحلهای: اسکن آیپی، جایگزینی توی کانفیگ، گسترش با فرگمنت و SNI برای دور زدن DPI/فایروال
|
||||
- **دیپلوی سرور Xray** — نصب سرور xray-core روی هر VPS لینوکسی با systemd، گواهی TLS، کلید REALITY و پشتیبانی چند کانفیگ
|
||||
- **پروکسی ورکر** — تولید اسکریپت Worker کلادفلر برای SNI تازه `workers.dev` روی هر کانفیگ VLESS WebSocket
|
||||
- **مدیریت اتصالات** — مدیریت inboundها، کاربران، URIها و حذف نصب سرورهای دیپلوی شده
|
||||
|
||||
**بدون نیاز به نصب چیز اضافه.** فقط Python 3.8+ و یه فایل.
|
||||
|
||||
@@ -358,11 +584,11 @@ python3 scanner.py --template 'vless://uuid@x:443?type=ws&...' -i addresses.txt
|
||||
**حالتهای اسکن:**
|
||||
|
||||
| حالت | تعداد آیپی | پورتها | زمان تقریبی | توضیحات |
|
||||
|-----------|---------------|-------------|--------------|-------------------------------------------|
|
||||
| Quick | ~۴,۰۰۰ | 443 | ~۳۰ ثانیه | ۱ آیپی تصادفی از هر بلاک /24 |
|
||||
| Normal | ~۱۲,۰۰۰ | 443 | ~۲ دقیقه | ۳ آیپی از هر بلاک + تایید CF (پیشنهادی) |
|
||||
| Full | ~۱,۵۰۰,۰۰۰ | 443 | ۲۰+ دقیقه | همه آیپیها + تایید CF |
|
||||
| Mega | ~۳,۰۰۰,۰۰۰ | 443 + 8443 | ۳۰-۶۰ دقیقه | همه آیپیها روی ۲ پورت برای حداکثر پوشش |
|
||||
|------|------------|---------|------------|---------|
|
||||
| Quick | ~4,000 | 443 | ~30 ثانیه | 1 آیپی تصادفی از هر بلاک /24 |
|
||||
| Normal | ~12,000 | 443 | ~2 دقیقه | 3 آیپی از هر بلاک + تایید CF (پیشنهادی) |
|
||||
| Full | ~1,500,000 | 443 | 20+ دقیقه | همه آیپیها + تایید CF |
|
||||
| Mega | ~3,000,000 | 443+8443 | 30-60 دقیقه | همه آیپیها روی 2 پورت |
|
||||
|
||||
کلادفلر [۱۴ زیرشبکه IPv4](https://www.cloudflare.com/ips-v4/) منتشر کرده که مجموعاً **~۱,۵۱۱,۸۰۸ آیپی یکتا** هستن. حالتهای Full و Mega همه رو اسکن میکنن. **حالت Mega** هر آیپی رو روی پورت 443 و 8443 (پورت جایگزین HTTPS کلادفلر) تست میکنه و تعداد پروبها رو به **~۳ میلیون** میرسونه (۱.۵ میلیون آیپی × ۲ پورت). وقتی بعضی آیپیها روی یه پورت مسدود هستن ولی روی پورت دیگه کار میکنن، این حالت خیلی مفیده.
|
||||
|
||||
@@ -406,10 +632,10 @@ python3 scanner.py --find-clean --no-tui --clean-mode mega
|
||||
### ⚙️ حالتهای اسکن
|
||||
|
||||
| حالت | مراحل | حجم تقریبی | زمان تقریبی | مناسب برای |
|
||||
|---------------------|----------------------|------------|--------------|---------------------|
|
||||
| ⚡ سریع (Quick) | 1MB → 5MB | ~200 MB | ~2-3 دقیقه | بررسی سریع |
|
||||
| 🔄 معمولی (Normal) | 1MB → 5MB → 20MB | ~850 MB | ~5-10 دقیقه | متعادل (پیشنهادی) |
|
||||
| 🔬 دقیق (Thorough) | 5MB → 25MB → 50MB | ~5-10 GB | ~20-45 دقیقه | حداکثر دقت |
|
||||
|------|-------|-----------|------------|-----------|
|
||||
| Quick سریع | 1MB → 5MB | ~200 MB | ~2-3 دقیقه | بررسی سریع |
|
||||
| Normal معمولی | 1MB → 5MB → 20MB | ~850 MB | ~5-10 دقیقه | متعادل (پیشنهادی) |
|
||||
| Thorough دقیق | 5MB → 25MB → 50MB | ~5-10 GB | ~20-45 دقیقه | حداکثر دقت |
|
||||
|
||||
---
|
||||
|
||||
@@ -418,17 +644,17 @@ python3 scanner.py --find-clean --no-tui --clean-mode mega
|
||||
بعد از اتمام اسکن، یه داشبورد تعاملی دارید:
|
||||
|
||||
| کلید | عملکرد |
|
||||
|-------|--------------------------------------------------|
|
||||
| `S` | 🔄 تغییر مرتبسازی: امتیاز → پینگ → سرعت |
|
||||
| `C` | 📋 نمایش کانفیگهای VLESS/VMess یه آیپی |
|
||||
| `D` | 🌐 نمایش دامنههای یه آیپی |
|
||||
| `E` | 💾 خروجی گرفتن (CSV + بهترین N تا) |
|
||||
| `A` | 📦 خروجی همه کانفیگها (مرتب شده) |
|
||||
| `J/K` | ⬆️⬇️ بالا/پایین |
|
||||
| `N/P` | 📄 صفحه بعد/قبل |
|
||||
| `B` | ◀️ برگشت به منو (اسکن جدید) |
|
||||
| `H` | ❓ راهنما |
|
||||
| `Q` | 🚪 خروج |
|
||||
|------|--------|
|
||||
| `S` | تغییر مرتبسازی: امتیاز → پینگ → سرعت |
|
||||
| `C` | نمایش کانفیگهای VLESS/VMess یه آیپی |
|
||||
| `D` | نمایش دامنههای یه آیپی |
|
||||
| `E` | خروجی گرفتن (CSV + بهترین N تا) |
|
||||
| `A` | خروجی همه کانفیگها (مرتب شده) |
|
||||
| `J/K` | بالا/پایین |
|
||||
| `N/P` | صفحه بعد/قبل |
|
||||
| `B` | برگشت به منو (اسکن جدید) |
|
||||
| `H` | راهنما |
|
||||
| `Q` | خروج |
|
||||
|
||||
---
|
||||
|
||||
@@ -437,9 +663,9 @@ python3 scanner.py --find-clean --no-tui --clean-mode mega
|
||||
نتایج توی پوشه `results/` ذخیره میشن:
|
||||
|
||||
| فایل | محتوا |
|
||||
|----------------------|-----------------------------------------|
|
||||
|------|-------|
|
||||
| `*_results.csv` | فایل CSV با تمام اطلاعات |
|
||||
| `*_top50.txt` | ۵۰ تا بهترین کانفیگ (آماده استفاده) |
|
||||
| `*_top50.txt` | 50 تا بهترین کانفیگ (آماده استفاده) |
|
||||
| `*_full_sorted.txt` | همه کانفیگها مرتب شده |
|
||||
| `clean_ips.txt` | آیپیهای تمیز کلادفلر از IP Finder |
|
||||
|
||||
@@ -455,6 +681,204 @@ cfray هوشمندانه با محدودیتهای سرعتسنجی کلا
|
||||
|
||||
---
|
||||
|
||||
### 🆕 چه چیزهایی در v1.1 اضافه شده
|
||||
|
||||
v1.1 قابلیتهای **دیپلوی سرور**، **تست پایپلاین**، **پروکسی ورکر** و **مدیریت اتصالات** رو اضافه کرده — cfray رو از یه اسکنر به یه ابزار کامل پروکسی تبدیل کرده.
|
||||
|
||||
---
|
||||
|
||||
### ⚡ تست پایپلاین Xray `[X]`
|
||||
|
||||
یه پایپلاین هوشمند ۳ مرحلهای که یه کانفیگ VLESS/VMess میگیره و بهترین راه اتصال رو پیدا میکنه — شامل دور زدن DPI با فرگمنت TLS.
|
||||
|
||||
**چطوری کار میکنه:**
|
||||
|
||||
```
|
||||
مرحله ۱: 🔍 اسکن آیپی
|
||||
رنجهای آیپی کلادفلر رو اسکن میکنه تا آیپیهای تمیز و قابل
|
||||
دسترس پیدا کنه. هزاران آیپی رو همزمان با TLS handshake تست میکنه.
|
||||
|
||||
مرحله ۲: 🧪 تست پایه
|
||||
هر آیپی تمیز رو توی کانفیگتون جایگزین میکنه و تست میکنه که آیا
|
||||
واقعاً ترافیک رد میکنه یا نه. از تانل مستقیم VLESS برای تایید
|
||||
اتصال واقعی استفاده میکنه — نه فقط handshake. آیپیهایی که با
|
||||
کانفیگ خاص شما کار میکنن فیلتر میشن.
|
||||
|
||||
مرحله ۳: 🔧 گسترش فرگمنت
|
||||
آیپیهای کارکننده رو با پریستهای فرگمنت DPI bypass و تغییرات
|
||||
SNI گسترش میده:
|
||||
- light: فرگمنت 100-200 بایت، فاصله 10-20 میلیثانیه
|
||||
- medium: فرگمنت 50-200 بایت، فاصله 10-40 میلیثانیه
|
||||
- heavy: فرگمنت 10-300 بایت، فاصله 5-50 میلیثانیه
|
||||
بهترین ترکیب آیپی + فرگمنت + SNI رو پیدا میکنه.
|
||||
```
|
||||
|
||||
**کاربرد:** کانفیگی دارید که وصل نمیشه (مسدود شده توسط DPI/فایروال). به جای اینکه دستی آیپی و تنظیمات فرگمنت مختلف رو امتحان کنید، پایپلاین خودکار ترکیبهای کارکننده رو پیدا میکنه.
|
||||
|
||||
**xray-core** لازمه — cfray اولین بار خودش دانلود میکنه یا میتونید دستی نصب کنید:
|
||||
|
||||
```bash
|
||||
# نصب خودکار xray-core
|
||||
python3 scanner.py --xray-install
|
||||
|
||||
# پایپلاین تعاملی
|
||||
python3 scanner.py # X رو بزنید
|
||||
|
||||
# خط فرمان — تست یه کانفیگ خاص
|
||||
python3 scanner.py --xray 'vless://uuid@domain:443?type=ws&security=tls#myconfig'
|
||||
|
||||
# خط فرمان — فقط فرگمنت سنگین، ۵ تا برتر
|
||||
python3 scanner.py --xray 'vless://...' --xray-frag heavy --xray-keep 5
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🚀 دیپلوی سرور Xray `[D]`
|
||||
|
||||
یه سرور پروکسی Xray کاملاً پیکربندیشده رو روی هر VPS لینوکسی در کمتر از ۲ دقیقه نصب کنید. ویزارد شما رو قدم به قدم راهنمایی میکنه — پروتکل، ترنسپورت، امنیت، پورت — و URI کلاینت آماده استفاده تحویل میده.
|
||||
|
||||
**چه چیزهایی نصب میکنه:**
|
||||
- دانلود و نصب **xray-core**
|
||||
- تولید کانفیگ سرور با پروتکل/ترنسپورت/امنیت دلخواه شما
|
||||
- ساخت **سرویس systemd** برای اجرای خودکار
|
||||
- دریافت **گواهی TLS** با certbot (برای امنیت TLS)
|
||||
- تولید **کلید x25519** (برای امنیت REALITY)
|
||||
- خروجی URI کلاینت VLESS/VMess که مستقیم وارد اپ میکنید
|
||||
|
||||
**گزینههای پشتیبانی شده:**
|
||||
|
||||
| دسته | گزینهها |
|
||||
|------|---------|
|
||||
| پروتکل | VLESS, VMess |
|
||||
| ترنسپورت | TCP, WebSocket, gRPC, HTTP/2, XHTTP |
|
||||
| امنیت | REALITY, TLS, None |
|
||||
| پورت | هر پورتی (پیشفرض 443) |
|
||||
|
||||
> **توجه:** حالت REALITY فقط از TCP، gRPC و HTTP/2 پشتیبانی میکنه. WebSocket و XHTTP با امنیت TLS یا None در دسترس هستن.
|
||||
|
||||
**REALITY** حالت امنیتی پیشنهادی هست — نیازی به دامنه یا گواهی TLS نداره. از تبادل کلید x25519 با SNI استتاری (مثل `yahoo.com` یا `google.com`) استفاده میکنه تا ترافیک شبیه HTTPS عادی به نظر بیاد.
|
||||
|
||||
**XHTTP** (SplitHTTP) یه ترنسپورت سازگار با CDN هست که پشت کلادفلر و CDNهای دیگه خوب کار میکنه. درخواستهای HTTP رو طوری تقسیم میکنه که از بسیاری از سیستمهای DPI رد بشه.
|
||||
|
||||
**دیپلوی چند کانفیگ:** میتونید چندین کانفیگ با پروتکلهای مختلف رو توی یه نشست نصب کنید. مثلاً TCP+REALITY روی پورت 443 *و* WS+TLS روی پورت 444 روی همون سرور. هر کانفیگ UUID و پورت خودش رو داره. کلیدهای REALITY و گواهی TLS یکبار تولید و بعد مجدداً استفاده میشن.
|
||||
|
||||
```bash
|
||||
# ویزارد تعاملی (پیشنهادی)
|
||||
python3 scanner.py # D رو بزنید
|
||||
|
||||
# خط فرمان — TCP+REALITY
|
||||
python3 scanner.py --deploy --deploy-transport tcp --deploy-security reality
|
||||
|
||||
# خط فرمان — WS+TLS با دامنه
|
||||
python3 scanner.py --deploy --deploy-transport ws --deploy-security tls --deploy-sni yourdomain.com
|
||||
```
|
||||
|
||||
**بعد از دیپلوی** یه منوی تعاملی دارید:
|
||||
- **[V] مشاهده URI** — نمایش دوباره همه کانفیگهای تولید شده (دیگه ناپدید نمیشن)
|
||||
- **[M] مدیریت اتصالات** — مستقیم به Connection Manager برید
|
||||
- **[Q] برگشت** — برگشت به منوی اصلی
|
||||
|
||||
---
|
||||
|
||||
### ☁️ پروکسی ورکر `[O]`
|
||||
|
||||
یه **SNI تازه از Cloudflare Workers** برای هر کانفیگ VLESS بسازید. cfray یه اسکریپت Worker تولید میکنه که ترافیک WebSocket رو به سرور شما پروکسی میکنه — شما خودتون روی حساب کلادفلرتون دیپلوی میکنید و یه SNI تمیز `workers.dev` میگیرید.
|
||||
|
||||
**چطوری کار میکنه:**
|
||||
1. یه کانفیگ VLESS کارکننده میدید (ترنسپورت WebSocket لازمه)
|
||||
2. cfray یه اسکریپت JavaScript Worker تولید میکنه که اتصالات WebSocket رو به سرور شما رله میکنه
|
||||
3. cfray اسکریپت + راهنمای قدم به قدم دیپلوی روی `dash.cloudflare.com` رو نشون میده
|
||||
4. آدرس Worker خودتون رو توی cfray وارد میکنید
|
||||
5. cfray یه کانفیگ جدید با دامنه تازه `*.workers.dev` به عنوان SNI خروجی میده
|
||||
|
||||
**کاربرد:** کانفیگتون کار میکنه ولی SNI/دامنه توی منطقهتون مسدود شده. به جای پیدا کردن دامنه جدید، یه پروکسی Workers میسازید که SNI تمیز `workers.dev` بهتون میده. چون دامنههای Workers کلادفلر برای کارهای قانونی زیادی استفاده میشن، به ندرت مسدود میشن.
|
||||
|
||||
**نیازمندیها:**
|
||||
- حساب کلادفلر (تیر رایگان کافیه)
|
||||
- کانفیگ اصلی باید ترنسپورت **WebSocket** داشته باشه
|
||||
|
||||
```bash
|
||||
# تعاملی
|
||||
python3 scanner.py # O رو بزنید
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🔧 مدیریت اتصالات (Connection Manager) `[C]`
|
||||
|
||||
کانفیگ سرور Xray موجود رو مستقیم مدیریت کنید — اضافه/حذف inbound، مدیریت کاربران، مشاهده URI کلاینتها و حذف نصب.
|
||||
|
||||
**کلیدهای مدیریت:**
|
||||
|
||||
| کلید | عملکرد |
|
||||
|------|--------|
|
||||
| `A` | **اضافه کردن inbound** — پروتکل/ترنسپورت/پورت جدید بسازید |
|
||||
| `V` | **مشاهده** — جزئیات JSON اینباند رو ببینید |
|
||||
| `U` | **اضافه کردن کاربر** — UUID جدید به یه inbound اضافه کنید |
|
||||
| `X` | **حذف inbound** — یه inbound موجود رو پاک کنید |
|
||||
| `S` | **نمایش URI** — همه URIهای کلاینت برای همه کاربران |
|
||||
| `R` | **ریستارت xray** — سرویس xray رو ریستارت کنید |
|
||||
| `L` | **لاگها** — لاگهای سرویس xray رو ببینید |
|
||||
| `D` | **حذف نصب** — xray، کانفیگ، systemd رو کامل پاک کنید |
|
||||
| `B` | **برگشت** — برگشت به منوی اصلی |
|
||||
|
||||
**نمایش URI** از فایل کانفیگ سرور، URIهای VLESS/VMess کلاینت رو برای هر inbound و هر کاربر تولید میکنه. وقتی چندین کانفیگ دیپلوی کردید و باید URIها رو با کاربران به اشتراک بذارید، یا وقتی URIهای اصلی از زمان دیپلوی گم شدن، خیلی مفیده.
|
||||
|
||||
**حذف نصب** هر چیزی که cfray نصب کرده رو کامل حذف میکنه: سرویس xray رو متوقف میکنه، باینری رو حذف میکنه، فایلهای کانفیگ رو پاک میکنه، سرویس systemd رو حذف میکنه و پوشه `~/.cfray/` رو تمیز میکنه. برای ایمنی باید عبارت "uninstall" رو تایپ کنید.
|
||||
|
||||
```bash
|
||||
# تعاملی
|
||||
python3 scanner.py # C رو بزنید
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### 🔧 فلگهای جدید CLI در v1.1
|
||||
|
||||
| فلگ | توضیحات | پیشفرض |
|
||||
|-----|---------|--------|
|
||||
| `--xray URI` | تست URI از طریق پایپلاین xray | — |
|
||||
| `--xray-frag` | پریست فرگمنت: `none`/`light`/`medium`/`heavy`/`all` | `all` |
|
||||
| `--xray-bin PATH` | مسیر باینری xray | خودکار |
|
||||
| `--xray-install` | دانلود و نصب xray-core در `~/.cfray/bin/` | خاموش |
|
||||
| `--xray-keep N` | تعداد نتایج برتر پایپلاین | 10 |
|
||||
| `--deploy` | دیپلوی سرور Xray روی VPS لینوکسی | — |
|
||||
| `--deploy-port` | پورت سرور | 443 |
|
||||
| `--deploy-protocol` | `vless` / `vmess` | `vless` |
|
||||
| `--deploy-transport` | `tcp` / `ws` / `grpc` / `h2` | `tcp` |
|
||||
| `--deploy-security` | `reality` / `tls` / `none` | `reality` |
|
||||
| `--deploy-sni` | دامنه SNI برای TLS/REALITY | — |
|
||||
| `--deploy-cert` | مسیر گواهی TLS | — |
|
||||
| `--deploy-key` | مسیر کلید خصوصی TLS | — |
|
||||
| `--deploy-ip` | جایگزین آیپی شناسایی خودکار سرور | خودکار |
|
||||
| `--uninstall` | حذف کامل همه چیزهایی که cfray نصب کرده | خاموش |
|
||||
|
||||
---
|
||||
|
||||
### 💡 مثالهای بیشتر (v1.1)
|
||||
|
||||
```bash
|
||||
# نصب xray-core (برای تست پایپلاین لازمه)
|
||||
python3 scanner.py --xray-install
|
||||
|
||||
# تست پایپلاین — پیدا کردن ترکیب آیپی + فرگمنت برای کانفیگ مسدود شده
|
||||
python3 scanner.py --xray 'vless://uuid@domain:443?type=ws&security=tls#config'
|
||||
|
||||
# فقط فرگمنت سنگین، ۳ تا برتر
|
||||
python3 scanner.py --xray 'vless://...' --xray-frag heavy --xray-keep 3
|
||||
|
||||
# دیپلوی سریع TCP+REALITY (پیشنهادی برای تازهکارها)
|
||||
python3 scanner.py --deploy
|
||||
|
||||
# دیپلوی WS+TLS برای مسیریابی CDN
|
||||
python3 scanner.py --deploy --deploy-transport ws --deploy-security tls --deploy-sni example.com
|
||||
|
||||
# حذف نصب کامل
|
||||
python3 scanner.py --uninstall
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
### ⭐ Made by Sam — SamNet Technologies
|
||||
|
||||
5949
scanner.py
5949
scanner.py
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user