feat: Реализована веб-панель управления и интеграция Sing-box для настройки VPN.

This commit is contained in:
2025-12-29 11:22:28 +03:00
parent 4144560a44
commit af72540aa8
6 changed files with 33 additions and 23 deletions

View File

@@ -17,7 +17,8 @@ import time
from urllib.parse import parse_qs, unquote
from pathlib import Path
PORT = 3456
PORT = int(os.environ.get("PORT", 3456))
PROXY_PORT = int(os.environ.get("PROXY_PORT", 8080))
APP_NAME = "VPN-Proxy-Control by Dokril"
APP_DIR = Path(__file__).parent
BASE_DIR = APP_DIR.parent
@@ -86,7 +87,7 @@ def measure_tcp_latency(host: str, port: int, timeout: float = 2.0) -> int:
def measure_proxy_performance(enable_speed_test: bool = False) -> dict:
"""Measure proxy latency, speed and public IP via local proxy"""
proxy_url = "http://127.0.0.1:8082"
proxy_url = f"http://127.0.0.1:{PROXY_PORT}"
proxies = {"http": proxy_url, "https": proxy_url}
# 1. Measure Latency (Ping)
@@ -264,7 +265,7 @@ def generate_vless_config(vless_params: dict) -> dict:
"sniff": True,
"users": [],
"listen": "0.0.0.0",
"listen_port": 8082,
"listen_port": PROXY_PORT,
"set_system_proxy": False
}
],
@@ -633,7 +634,7 @@ class ProxyControlHandler(http.server.BaseHTTPRequestHandler):
"sniff": True,
"users": [],
"listen": "0.0.0.0",
"listen_port": 8082,
"listen_port": PROXY_PORT,
"set_system_proxy": False
}
]