Skip to content

Commit

Permalink
Merge pull request #44 from Toperlock/master
Browse files Browse the repository at this point in the history
fix mux
  • Loading branch information
Toperlock authored Jan 12, 2024
2 parents 93e598b + c6cdf6c commit 42bd75c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions parsers/ss.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ def parse(data):
smux_dict = {k: v[0] for k, v in smux_dict.items() if v[0]}
node['multiplex'] = {
'enabled': True,
'protocol': smux_dict['protocol'],
'max_streams': int(smux_dict.get('max-streams', '0'))
'protocol': smux_dict['protocol']
}
if smux_dict.get('max-connections'):
if smux_dict.get('max-streams'):
node['multiplex']['max_streams'] = int(smux_dict['max-streams'])
else:
node['multiplex']['max_connections'] = int(smux_dict['max-connections'])
if smux_dict.get('min-streams'):
node['multiplex']['min_streams'] = int(smux_dict['min-streams'])
if smux_dict.get('padding') == 'True':
node['multiplex']['padding'] = True
Expand Down Expand Up @@ -149,4 +149,4 @@ def parse(data):
if flag:
return node,node_tls
else:
return node
return node
14 changes: 7 additions & 7 deletions parsers/trojan.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ def parse(data):
if netquery.get('protocol'):
node['multiplex'] = {
'enabled': True,
'protocol': netquery['protocol'],
'max_streams': int(netquery.get('max_streams', '0'))
'protocol': netquery['protocol']
}
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('max-streams'):
node['multiplex']['max_streams'] = int(netquery['max-streams'])
else:
node['multiplex']['max_connections'] = int(netquery['max-connections'])
node['multiplex']['min_streams'] = int(netquery['min-streams'])
if netquery.get('padding') == 'True':
node['multiplex']['padding'] = True
return node
return node
14 changes: 7 additions & 7 deletions parsers/vless.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ def parse(data):
if netquery.get('protocol'):
node['multiplex'] = {
'enabled': True,
'protocol': netquery['protocol'],
'max_streams': int(netquery.get('max_streams', '0'))
'protocol': netquery['protocol']
}
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('max-streams'):
node['multiplex']['max_streams'] = int(netquery['max-streams'])
else:
node['multiplex']['max_connections'] = int(netquery['max-connections'])
node['multiplex']['min_streams'] = int(netquery['min-streams'])
if netquery.get('padding') == 'True':
node['multiplex']['padding'] = True
return node
return node
10 changes: 5 additions & 5 deletions parsers/vmess.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ def parse(data):
if item.get('protocol'):
node['multiplex'] = {
'enabled': True,
'protocol': item['protocol'],
'max_streams': int(item.get('max_streams', '0'))
'protocol': item['protocol']
}
if item.get('max_connections'):
if item.get('max_streams'):
node['multiplex']['max_streams'] = int(item['max_streams'])
else:
node['multiplex']['max_connections'] = int(item['max_connections'])
if item.get('min_streams'):
node['multiplex']['min_streams'] = int(item['min_streams'])
if item.get('padding') == True:
node['multiplex']['padding'] = True
return node
return node

0 comments on commit 42bd75c

Please sign in to comment.