From 872d16bc9dca128241c9aedc7dd04348dfabb3dc Mon Sep 17 00:00:00 2001 From: Toperlock <861705708@qq.com> Date: Wed, 3 Jul 2024 21:26:39 +0800 Subject: [PATCH] add `udp-over-tcp` --- parsers/clash2base64.py | 2 ++ parsers/ss.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/parsers/clash2base64.py b/parsers/clash2base64.py index e878d6d3b..3d6fc817d 100644 --- a/parsers/clash2base64.py +++ b/parsers/clash2base64.py @@ -110,6 +110,8 @@ def clash2v2ray(share_link): ss_info["max_streams"] = share_link['smux'].get('max-streams','') ss_info["padding"] = share_link['smux'].get('padding','') link += "&protocol={protocol}&max-connections={max_connections}&min-streams={min_streams}&max-streams={max_streams}&padding={padding}#{name}".format(**ss_info) + elif share_link.get("udp-over-tcp") == True: + link += "&uot=1#{name}".format(**ss_info) else: link += f"#{ss_info['name']}" return link diff --git a/parsers/ss.py b/parsers/ss.py index a51371ae4..2632857f0 100644 --- a/parsers/ss.py +++ b/parsers/ss.py @@ -13,6 +13,11 @@ def parse(data): 'password':None } flag = 0 + if param.find('uot') > -1: + node["udp_over_tcp"] = { + 'enabled': True, + 'version': 2 + } if param.find('#') > -1: if param[param.find('#') + 1:] != '': remark = urllib.parse.unquote(param[param.find('#') + 1:])