From 5b18c97f2813111d322e08d3b710b7263088a9c1 Mon Sep 17 00:00:00 2001 From: Anton Fedorov Date: Fri, 11 Oct 2024 23:29:30 -0700 Subject: [PATCH] fix(Subscription): correctly build list of proxy remarks for clash config (#1357) * fix(Subscription): correctly build list of proxy remarks for clash config * fix(Subscription): correctly build list of proxy remarks for clash meta config --- app/subscription/clash.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/subscription/clash.py b/app/subscription/clash.py index 0579cbbe9..dd95bcfa1 100644 --- a/app/subscription/clash.py +++ b/app/subscription/clash.py @@ -148,6 +148,7 @@ def tcp_config(self, path="", host=""): def make_node(self, name: str, + remark: str, type: str, server: str, port: int, @@ -176,8 +177,6 @@ def make_node(self, else: is_httpupgrade = False - remark = self._remark_validation(name) - self.proxy_remarks.append(remark) node = { 'name': remark, 'type': type, @@ -255,8 +254,11 @@ def add(self, remark: str, address: str, inbound: dict, settings: dict): if inbound['network'] in ("kcp", "splithttp"): return + proxy_remark = self._remark_validation(remark) + node = self.make_node( name=remark, + remark=proxy_remark, type=inbound['protocol'], server=address, port=inbound['port'], @@ -289,6 +291,7 @@ def add(self, remark: str, address: str, inbound: dict, settings: dict): return self.data['proxies'].append(node) + self.proxy_remarks.append(proxy_remark) class ClashMetaConfiguration(ClashConfiguration): @@ -340,8 +343,11 @@ def add(self, remark: str, address: str, inbound: dict, settings: dict): if inbound['network'] in ("kcp", "splithttp") or (inbound['network'] == "quic" and inbound["header_type"] != "none"): return + proxy_remark = self._remark_validation(remark) + node = self.make_node( name=remark, + remark=proxy_remark, type=inbound['protocol'], server=address, port=inbound['port'], @@ -383,3 +389,4 @@ def add(self, remark: str, address: str, inbound: dict, settings: dict): return self.data['proxies'].append(node) + self.proxy_remarks.append(proxy_remark)