Dreamacro/clash

[Feature] Add DOMAIN-SET support to Clash Premium's `rule-providers`

SukkaW opened this issue · 5 comments

Verify steps

Description

Surge's DOMAIN-SET is designed for a large number of domain names list file, supports fast search for thousands of records. Each line in the file is a domain name if a line begins with . matches all sub-domains (matches the behavior of DOMAIN-SUFFIX) and the domain name itself (matches DOMAIN).

Possible Solution

rule-providers:
  cncidr:
    type: http
    behavior: domainset # domainset here
    url: "https://example.com/domainset.txt" # It is a plain text file
    path: ./ruleset/domainset.txt
    interval: 86400
luwah commented

现在的rule-provider有什么问题吗?behavior选择domain可以解决你描述的问题吗?

现在的rule-provider有什么问题吗?behavior选择domain可以解决你描述的问题吗?

Maintaining three different rulesets is bullshit. And a YAML file with 55359 lines is also stupid enough (not mentioning how inefficient it is).

Both domain and ipcidr are made for large amounts of data, except for classical. Both have high time efficiency. (although the domain has higher space complexity)

The only possible difference is that yaml cannot currently stream read

YAML parser need allocate huge amount of memory to parse a large yaml list (maybe 100MB memory for a 3MB rule-providers file). For some iOS device using clash core, the memory limit is 50MB. But we can parse a plain text file line by line to reduce memory peak.

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days