banner
oldcatY

oldcatY

中轻度LoveLive厨,主推莲团,二推水+虹团(缪团是神,星团……)
twitter
github
bilibili
steam

[Scientific Internet Access] Use the Parsers feature of Clash for Windows to achieve subscription conversion for all airports.

Disclaimer#

  • Reproduced from Github with slight modifications.
  • This configuration is only applicable to Clash for Windows software that has replaced the Clash Meta core!

Configuration#

Using the parsers feature, any subscription link imported will be converted into its own rules

parsers: # array  
  # - reg: ^.*$ Match all subscriptions, or  - url: https://example.com/profile.yaml Specify subscription  
  - reg: ^.*$ 
    # Remove the provider's groups and rules  
    code: |
      module.exports.parse = (raw, { yaml }) => {  
        const rawObj = yaml.parse(raw)  
        const groups = []  
        const rules = []  
        return yaml.stringify({ ...rawObj, 'proxy-groups': groups, rules })  
      }   
    yaml: # Create your own configuration  
      prepend-proxy-groups: # Create groups
        - name: 🚀 Node Selection 
          type: select
        - name: ⏬ Traffic Consumer
          type: select
          
  # Group example  
       # - name: Group Name  
         # type: select       # Manual selection     
               # url-test     # Automatically select the node with the lowest latency  
               # fallback     # Automatically switch to the next node when the node fails  
               # load-balance # Balance the use of nodes within the group  
         # url: http://www.gstatic.com/generate_204 # Test address required for non-select type groups  
         # interval: 300 # Automatic test interval, in seconds, required for non-select type groups  
         # tolerance: 50 # Allowed deviation, nodes with a latency difference less than this value will not switch, not necessary  
         # proxies:    
           # - Node name or other group nesting  
            
      commands: # Add the node names in the subscription to the specified group, can use regex filtering  
        # Some examples of regex filtering nodes that may be used to make the groups more detailed  
        # []proxyNames|a                         # Contains a  
        # []proxyNames|^(.*)(a|b)+(.*)$          # Contains a or b  
        # []proxyNames|^((?=.*a)(?=.*b).*$        # Contains a and b  
        # []proxyNames|^((?!b).)*a((?!b).)*$     # Contains a and does not contain b  
        # []proxyNames|^((?!b|c).)*a((?!b|c).)*$ # Contains a and does not contain b or c  
        - proxy-groups.🚀 Node Selection.proxies=[]proxyNames
        - proxy-groups.⏬ Traffic Consumer.proxies=[]proxyNames
      # Add rules  
      prepend-rules: # Rules are traversed from top to bottom, if the above rules have already been hit, they will not be processed further 
        - "AND,(AND,(DST-PORT,443),(NETWORK,UDP)),(NOT,((GEOIP,CN))),REJECT"
        # Block Sogou & 360 & Bilibili short links
        - GEOSITE,sogou,REJECT
        - GEOSITE,qihoo360,REJECT
        # Traffic Consumer & Speedtest
        - DOMAIN-SUFFIX,db.laomoe.com,⏬ Traffic Consumer
        - GEOSITE,speedtest,⏬ Traffic Consumer
        # Geosite
        - GEOSITE,category-scholar-!cn,🚀 Node Selection
        - GEOSITE,category-ads-all,REJECT
        - GEOSITE,youtube,🚀 Node Selection
        - GEOSITE,google,🚀 Node Selection
        - GEOSITE,bilibili@!cn,🚀 Node Selection
        - GEOSITE,cn,DIRECT
        - GEOSITE,private,DIRECT
        - GEOSITE,steam@cn,DIRECT
        - GEOSITE,category-games@cn,DIRECT
        - GEOSITE,epicgames,DIRECT
        - GEOSITE,geolocation-!cn,🚀 Node Selection
        - DOMAIN-SUFFIX,odysseyplus.site,🚀 Node Selection
        - DOMAIN-SUFFIX,pilipiliultra.top,🚀 Node Selection
        - DOMAIN-SUFFIX,jmsooo.com,🚀 Node Selection
        - DOMAIN-SUFFIX,misakaf.org,🚀 Node Selection
        - GEOIP,private,DIRECT,no-resolve
        - GEOIP,telegram,🚀 Node Selection
        - GEOIP,CN,DIRECT
        - DOMAIN-SUFFIX,cn,DIRECT
        - MATCH,🚀 Node Selection

Attached mixin rules#

mixin: # object
  mode: rule                            # Rule mode: rule (rules) / global (global proxy) / direct (global direct connection) / script (script)
  ipv6: true                            # Enable IPv6 switch, disable blocking all IPv6 links and blocking DNS requests for AAAA records
  log-level: info                       # Set log output level (5 levels: silent / error / warning / info / debug)
  mixed-port: 20810                     # Mixed port, HTTP and SOCKS5 use the same port
  unified-delay: true                   # Unified delay, change the delay calculation method, remove handshake and other additional delays
  tcp-concurrent: true                  # [Meta exclusive] Concurrent TCP connections for all IPs, will use the fastest handshake TCP
  keep-alive-interval: 15               # TCP keep alive interval

  geodata-mode: true                    # [Meta exclusive] Use geoip.dat database (default: false, use mmdb database)
  geox-url:                             # Custom geodata url, requires proxy to download geoip and geosite
    geoip: "https://gcore.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geoip.dat"
    geosite: "https://gcore.jsdelivr.net/gh/MetaCubeX/meta-rules-dat@release/geosite.dat"
    mmdb: "https://gcore.jsdelivr.net/gh/Hackl0us/GeoIP2-CN@release/Country.mmdb"

  find-process-mode: strict             # Match all processes (always/strict/off)
  global-client-fingerprint: chrome     # Global TLS fingerprint, lower priority than client-fingerprint in proxy
                                        # Options: "chrome","firefox","safari","ios","random","none".

  profile:
    store-selected: true                # Store select selection records
    store-fake-ip: true                 # Persist fake-ip

  sniffer:                              # Sniff domain optional configuration
    enable: true
    parse-pure-ip: true                 # Whether to use the sniffing result as the actual access, default true
    sniff:
      TLS:                              # Default sniffing 443 for TLS
        ports: [443, 8443]
      HTTP:
        ports: [80, 8080-8880]
        override-destination: true
    force-domain: []                    # Force sniffing for this domain

  dns:
    enable: true                        # Close to use system DNS
    prefer-h3: true                     # Whether to enable DOH's http/3
    ipv6: true                          # IPV6 resolution switch; if false, the ipv6 result will be empty
    enhanced-mode: fake-ip              # Mode: redir-host or fake-ip
    listen: 0.0.0.0:1053                # DNS listening address
    use-hosts: true                     # Whether to query system hosts
    fake-ip-range: 198.18.0.1/16        # IP range setting under fakeip, the default IP of the tun card also uses this value
    fake-ip-filter: ['+.lan', '+.msftncsi.com', 'msftconnecttest.com', '+.msftconnecttest.com', '*.msftncsi.com', '*.msftconnecttest.com']
                                        # Fake-ip filter, domains in the list will return the real IP
    default-nameserver: [223.5.5.5, 119.29.29.29]
                                        # DNS server used to resolve non-IP dns, only supports pure IP, (Meta can encrypt it)
    nameserver: [tcp://208.67.222.222#Proxy, tcp://8.8.8.8#Proxy]
                                        # Default DNS server, supports udp/tcp/dot/doh/doq
    proxy-server-nameserver: [https://223.5.5.5/dns-query, https://1.12.12.12/dns-query]
                                        # Proxy DNS server, supports udp/tcp/dot/doh/doq
    nameserver-policy:
      "geosite:cn,private,geolocation-!cn@cn,bytedance,steam@cn,epicgames,microsoft@cn,apple@cn": [223.5.5.5#DIRECT, 119.29.29.29#DIRECT]
      "geosite:steam": [tcp://1.1.1.1#Proxy]
                                        # Specify the resolution server for domain queries, can use geosite, prioritized over nameserver/fallback queries
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.