feat: Добавлены веб-интерфейс управления и скрипт для генерации клиентских конфигураций VLESS из URL.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -35,7 +36,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 2rem;
|
||||
background-image:
|
||||
background-image:
|
||||
radial-gradient(ellipse at top, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
|
||||
radial-gradient(ellipse at bottom right, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
|
||||
}
|
||||
@@ -51,7 +52,7 @@
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 24px;
|
||||
padding: 2.5rem;
|
||||
box-shadow:
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(0, 0, 0, 0.3),
|
||||
0 2px 4px -2px rgba(0, 0, 0, 0.2),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
||||
@@ -113,8 +114,15 @@
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.6; }
|
||||
|
||||
0%,
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
50% {
|
||||
opacity: 0.6;
|
||||
}
|
||||
}
|
||||
|
||||
.status-text {
|
||||
@@ -223,7 +231,9 @@
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
to { transform: rotate(360deg); }
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.message {
|
||||
@@ -242,6 +252,7 @@
|
||||
opacity: 0;
|
||||
transform: translateY(-8px);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
@@ -346,6 +357,7 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="card">
|
||||
@@ -365,17 +377,12 @@
|
||||
|
||||
<form id="proxyForm">
|
||||
<div class="form-group">
|
||||
<label for="urlInput">VLESS / Subscription URL</label>
|
||||
<label for="urlInput">VLESS Key</label>
|
||||
<div class="input-wrapper">
|
||||
<input
|
||||
type="text"
|
||||
id="urlInput"
|
||||
placeholder="vless://... или https://subscription.link"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
>
|
||||
<input type="text" id="urlInput" placeholder="vless://..." autocomplete="off"
|
||||
spellcheck="false">
|
||||
</div>
|
||||
<p class="hint">Вставьте VLESS ссылку или URL подписки</p>
|
||||
<p class="hint">Вставьте VLESS ссылку</p>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary" id="submitBtn">
|
||||
@@ -403,7 +410,7 @@
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
Proxy работает на порту <strong>8082</strong> •
|
||||
Proxy работает на порту <strong>8082</strong> •
|
||||
<a href="https://github.com/SagerNet/sing-box" target="_blank">sing-box</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -424,10 +431,10 @@
|
||||
try {
|
||||
const res = await fetch('/status');
|
||||
const data = await res.json();
|
||||
|
||||
|
||||
if (data.active) {
|
||||
statusIndicator.classList.add('active');
|
||||
statusValue.textContent = data.tag
|
||||
statusValue.textContent = data.tag
|
||||
? `${data.tag} (${data.server})`
|
||||
: 'Активен';
|
||||
} else {
|
||||
@@ -456,7 +463,7 @@
|
||||
|
||||
form.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
|
||||
const url = urlInput.value.trim();
|
||||
if (!url) {
|
||||
showMessage('error', 'Введите URL');
|
||||
@@ -498,7 +505,7 @@
|
||||
const hostname = window.location.hostname;
|
||||
const httpLink = document.getElementById('httpLink');
|
||||
const socksLink = document.getElementById('socksLink');
|
||||
|
||||
|
||||
httpLink.textContent = `http://${hostname}:8082`;
|
||||
socksLink.textContent = `socks5://${hostname}:8082`;
|
||||
|
||||
@@ -513,4 +520,5 @@
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
||||
@@ -115,8 +115,8 @@ class ProxyControlHandler(http.server.BaseHTTPRequestHandler):
|
||||
self.send_json({"success": False, "error": "URL не указан"}, 400)
|
||||
return
|
||||
|
||||
if not (url.startswith("vless://") or url.startswith("http://") or url.startswith("https://")):
|
||||
self.send_json({"success": False, "error": "Неверный формат URL. Ожидается vless:// или http(s):// ссылка"}, 400)
|
||||
if not url.startswith("vless://"):
|
||||
self.send_json({"success": False, "error": "Неверный формат. Поддерживаются только vless:// ссылки"}, 400)
|
||||
return
|
||||
|
||||
# Run gen-client-from-url.sh
|
||||
|
||||
Reference in New Issue
Block a user