Opera8 commited on
Commit
3b615f3
·
verified ·
1 Parent(s): 509444e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +50 -0
app.py ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import subprocess
3
+
4
+ # کانفیگ مخفی شده داخل متغیر پایتون
5
+ xray_config = """
6
+ {
7
+ "log": {
8
+ "access": "none",
9
+ "error": "none",
10
+ "loglevel": "none"
11
+ },
12
+ "inbounds": [
13
+ {
14
+ "port": 7860,
15
+ "protocol": "vless",
16
+ "settings": {
17
+ "clients": [
18
+ {
19
+ "id": "11111111-2222-3333-4444-555555555555",
20
+ "level": 0,
21
+ "email": "python_user@hf"
22
+ }
23
+ ],
24
+ "decryption": "none"
25
+ },
26
+ "streamSettings": {
27
+ "network": "ws",
28
+ "wsSettings": {
29
+ "path": "/"
30
+ }
31
+ }
32
+ }
33
+ ],
34
+ "outbounds": [
35
+ {
36
+ "protocol": "freedom"
37
+ }
38
+ ]
39
+ }
40
+ """
41
+
42
+ # نوشتن کانفیگ در یک فایل موقت
43
+ with open("config.json", "w") as f:
44
+ f.write(xray_config)
45
+
46
+ print("Starting Python AI Engine... (Fake)")
47
+ print("System loaded successfully.")
48
+
49
+ # اجرای Xray با استفاده از کانفیگ ساخته شده
50
+ subprocess.run(["./xray", "-c", "config.json"])