Skip to content

Commit e551139

Browse files
fix(subscription): trojan custom configs
1 parent 81bfe56 commit e551139

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/subscription/xray.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,19 +451,24 @@ def _build_outbound(
451451
else:
452452
path = self.get_grpc_gun(path)
453453

454+
user_object = "vnext" if protocol_type in ("vmess", "vless") else "servers"
455+
454456
outbound = {
455457
"protocol": protocol_type,
456458
"tag": "proxy",
457459
"settings": {
458-
"vnext" if protocol_type in ("vmess", "vless") else "servers": [
460+
user_object: [
459461
{
460462
"address": address,
461463
"port": self._select_port(inbound.port),
462-
"users": [user_settings],
463464
}
464465
]
465466
},
466467
}
468+
if protocol_type in ("vmess", "vless"):
469+
outbound["settings"][user_object][0].update({"users": [user_settings]})
470+
else:
471+
outbound["settings"][user_object][0].update(user_settings)
467472

468473
# Build stream settings
469474
network_setting = self._apply_transport(network, inbound, path)

0 commit comments

Comments
 (0)