From 5870c97704dd5790767abb32cf076cc2de86006f Mon Sep 17 00:00:00 2001 From: Dorae <86833913+Toperlock@users.noreply.github.com> Date: Mon, 30 Oct 2023 16:10:58 +0800 Subject: [PATCH] add trojan multiplex --- parsers/trojan.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/parsers/trojan.py b/parsers/trojan.py index eb1e288cc..8685addea 100644 --- a/parsers/trojan.py +++ b/parsers/trojan.py @@ -53,4 +53,16 @@ def parse(data): 'type':'grpc', 'service_name':netquery.get('serviceName', '') } + if netquery.get('protocol'): + node['multiplex'] = { + 'enabled': True, + 'protocol': netquery['protocol'], + 'max_streams': int(netquery.get('max_streams', '0')) + } + if netquery.get('max_connections'): + node['multiplex']['max_connections'] = int(netquery['max_connections']) + if netquery.get('min_streams'): + node['multiplex']['min_streams'] = int(netquery['min_streams']) + if netquery.get('padding') == 'True': + node['multiplex']['padding'] = True return node