diff --git a/Clash/Rule.yaml b/Clash/Rule.yaml index a088ecb..0458d45 100644 --- a/Clash/Rule.yaml +++ b/Clash/Rule.yaml @@ -128,27 +128,26 @@ script: port_list = [21, 22, 23, 53, 80, 123, 143, 194, 443, 465, 587, 853, 993, 995, 998, 2052, 2053, 2082, 2083, 2086, 2095, 2096, 5222, 5228, 5229, 5230, 8080, 8443, 8880, 8888, 8889] if port not in port_list: - return "DIRECT" ctx.log('[Script] not common port use direct') + return "DIRECT" if metadata["dst_ip"] == "": metadata["dst_ip"] = ctx.resolve_ip(metadata["host"]) - ruleset_list = [r for r in ruleset_action] - for rule_name in ruleset_list: - if ctx.rule_providers[rule_name].match(metadata): - return ruleset_action[rule_name] + for ruleset in ruleset_action: + if ctx.rule_providers[ruleset].match(metadata): + return ruleset_action[ruleset] if metadata["dst_ip"] == "": return "DIRECT" code = ctx.geoip(metadata["dst_ip"]) if code == "CN": - return "Domestic" ctx.log('[Script] Geoip CN') + return "Domestic" - return "Others" ctx.log('[Script] FINAL') + return "Others" rule-providers: Reject: