Template
Add Hysteria 2 protocol with admin domain SSL via Let's Encrypt.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+4
-3
@@ -24,7 +24,7 @@ _bot_task: Optional[asyncio.Task] = None
|
||||
_callback_refs = {}
|
||||
_pending_inputs = {}
|
||||
|
||||
CLIENT_PROTOCOLS = {"awg", "awg2", "awg_legacy", "xray", "telemt", "wireguard"}
|
||||
CLIENT_PROTOCOLS = {"awg", "awg2", "awg_legacy", "xray", "telemt", "hysteria", "wireguard"}
|
||||
SERVICE_PROTOCOLS = {"dns", "adguard", "socks5", "nginx"}
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ def _protocol_display_name(protocol: str) -> str:
|
||||
"awg_legacy": "AmneziaWG Legacy",
|
||||
"xray": "Xray",
|
||||
"telemt": "Telemt",
|
||||
"hysteria": "Hysteria 2",
|
||||
"dns": "AmneziaDNS",
|
||||
"wireguard": "WireGuard",
|
||||
"socks5": "SOCKS5",
|
||||
@@ -549,7 +550,7 @@ async def _send_config_by_client(api: TelegramAPI, chat_id: int, server: dict, p
|
||||
server_name = server.get("name") or server.get("host", "Unknown")
|
||||
await api.send_message(chat_id, f"✅ <b>{_e(conn_name)}</b>\n🌐 Server: <b>{_e(server_name)}</b>\n🔌 Protocol: <b>{_e(proto.upper())}</b>")
|
||||
|
||||
is_link_proto = _proto_base(proto) in ("xray", "telemt")
|
||||
is_link_proto = _proto_base(proto) in ("xray", "telemt", "hysteria")
|
||||
if is_link_proto:
|
||||
await api.send_message(chat_id, f"🔗 <b>Connection link</b> (tap to copy):\n<code>{_e(config)}</code>")
|
||||
else:
|
||||
@@ -906,7 +907,7 @@ async def _admin_create_client(api: TelegramAPI, chat_id: int, message_id: int,
|
||||
|
||||
async def _send_config_text(api: TelegramAPI, chat_id: int, server: dict, proto: str, conn_name: str, config: str, generate_vpn_link_fn: Callable):
|
||||
await api.send_message(chat_id, f"✅ <b>{_e(conn_name)}</b>\n🌐 Server: <b>{_e(server.get('name') or server.get('host'))}</b>\n🔌 Protocol: <b>{_e(proto.upper())}</b>")
|
||||
if _proto_base(proto) in ("xray", "telemt"):
|
||||
if _proto_base(proto) in ("xray", "telemt", "hysteria"):
|
||||
await api.send_message(chat_id, f"🔗 <b>Connection link</b>:\n<code>{_e(config)}</code>")
|
||||
else:
|
||||
await api.send_message(chat_id, f"<b>📄 Configuration:</b>\n<pre>{_e(config)}</pre>")
|
||||
|
||||
Reference in New Issue
Block a user