Delete app.py
Browse files
app.py
DELETED
|
@@ -1,58 +0,0 @@
|
|
| 1 |
-
import subprocess
|
| 2 |
-
import urllib.request
|
| 3 |
-
import json
|
| 4 |
-
import uuid
|
| 5 |
-
import time
|
| 6 |
-
|
| 7 |
-
# 1. ساخت UUID تصادفی
|
| 8 |
-
my_uuid = str(uuid.uuid4())
|
| 9 |
-
print(f"✅ UUID شما: {my_uuid}\n")
|
| 10 |
-
|
| 11 |
-
# 2. دانلود Xray و Cloudflared
|
| 12 |
-
print("⏳ در حال دانلود هستهها...")
|
| 13 |
-
urllib.request.urlretrieve("https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip", "xray.zip")
|
| 14 |
-
urllib.request.urlretrieve("https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64", "cloudflared")
|
| 15 |
-
|
| 16 |
-
subprocess.run(["unzip", "-o", "xray.zip"])
|
| 17 |
-
subprocess.run(["chmod", "+x", "xray", "cloudflared"])
|
| 18 |
-
|
| 19 |
-
# 3. ساخت کانفیگ Xray (VLESS + WebSocket)
|
| 20 |
-
config = {
|
| 21 |
-
"inbounds": [{
|
| 22 |
-
"port": 8080,
|
| 23 |
-
"listen": "127.0.0.1",
|
| 24 |
-
"protocol": "vless",
|
| 25 |
-
"settings": {
|
| 26 |
-
"clients": [{"id": my_uuid, "flow": ""}],
|
| 27 |
-
"decryption": "none"
|
| 28 |
-
},
|
| 29 |
-
"streamSettings": {
|
| 30 |
-
"network": "ws",
|
| 31 |
-
"wsSettings": {"path": "/"}
|
| 32 |
-
}
|
| 33 |
-
}],
|
| 34 |
-
"outbounds": [{"protocol": "freedom"}]
|
| 35 |
-
}
|
| 36 |
-
|
| 37 |
-
with open("config.json", "w") as f:
|
| 38 |
-
json.dump(config, f)
|
| 39 |
-
|
| 40 |
-
# 4. اجرای Xray در پسزمینه
|
| 41 |
-
print("🚀 در حال اجرای Xray...")
|
| 42 |
-
subprocess.Popen(["./xray", "run", "-config", "config.json"])
|
| 43 |
-
|
| 44 |
-
# 5. اجرای Cloudflare Tunnel
|
| 45 |
-
print("🌐 در حال ایجاد تانل امن کلودفلر...")
|
| 46 |
-
tunnel_process = subprocess.Popen(["./cloudflared", "tunnel", "--url", "http://localhost:8080"], stdout=subprocess.PIPE, text=True)
|
| 47 |
-
|
| 48 |
-
# 6. استخراج لینک نهایی
|
| 49 |
-
time.sleep(5)
|
| 50 |
-
for line in tunnel_process.stdout:
|
| 51 |
-
if "trycloudflare.com" in line:
|
| 52 |
-
domain = line.split("https://")[1].split(".trycloudflare.com")[0] + ".trycloudflare.com"
|
| 53 |
-
print("\n" + "="*50)
|
| 54 |
-
print("🎉 کانفیگ شما آماده است!")
|
| 55 |
-
print("="*50)
|
| 56 |
-
print(f"vless://{my_uuid}@{domain}:443?encryption=none&security=tls&sni={domain}&type=ws&path=/#Colab-Free-Pro")
|
| 57 |
-
print("="*50)
|
| 58 |
-
break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|