fix: add Trojan protocol support in create_3xui_client (password instead of uuid)

This commit is contained in:
SashegDev
2026-05-22 05:48:15 +00:00
parent dc92b75387
commit 9a893d5e6d
+12
View File
@@ -947,6 +947,18 @@ def create_3xui_client(username: str, sub_id: str, inbound: dict, traffic_gb: in
logger.info(f"Creating client: email={email}, total_bytes={total_bytes}, inbound={inbound_name}") logger.info(f"Creating client: email={email}, total_bytes={total_bytes}, inbound={inbound_name}")
from py3xui.client import Client from py3xui.client import Client
if inbound.get("protocol") == "trojan":
client = Client(
id="",
password=str(uuid.uuid4()),
email=email,
enable=True,
total_gb=total_bytes,
expiry_time=0,
limit_ip=0,
subId=sub_id
)
else:
client = Client( client = Client(
id=str(uuid.uuid4()), id=str(uuid.uuid4()),
email=email, email=email,