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