fix: add Trojan protocol support in create_3xui_client (password instead of uuid)
This commit is contained in:
@@ -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}")
|
||||
|
||||
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(
|
||||
id=str(uuid.uuid4()),
|
||||
email=email,
|
||||
|
||||
Reference in New Issue
Block a user