Skip to content

Commit

Permalink
fix(Subscription): correctly build list of proxy remarks for clash co…
Browse files Browse the repository at this point in the history
…nfig (#1357)

* fix(Subscription): correctly build list of proxy remarks for clash config

* fix(Subscription): correctly build list of proxy remarks for clash meta config
  • Loading branch information
fapspirit authored Oct 12, 2024
1 parent 95fb069 commit 5b18c97
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/subscription/clash.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def tcp_config(self, path="", host=""):

def make_node(self,
name: str,
remark: str,
type: str,
server: str,
port: int,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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)

0 comments on commit 5b18c97

Please sign in to comment.