How anaer/sub works
Project type and purpose
• This repository holds Clash configuration files (clash.yaml and proxies.yaml) and serves as a proxy subscription/configuration manager.
• Its primary purpose is to collect and maintain proxy node lists (proxies.yaml), define routing rules (clash.yaml), and provide these configs to a Clash-compatible client.
File structure
• README.MD: Documentation and usage instructions.
• clash.yaml: Main Clash configuration (rules, proxy-group definitions, scheduled tasks).
• proxies.yaml: List of proxy node definitions (addresses, ports, credentials).
README for additional insights
• It mentions a timed task that updates clash.yaml (“节点定时任务跑”).
• It provides usage warnings and links to related tools (Quantumult X, mihomo).
• No code modules or services—this is purely configuration + scheduling.
Main system components
a. Configuration Store
– proxies.yaml (proxy node definitions)
– clash.yaml (routing rules + references to proxies.yaml)
b. Scheduler / Updater
– Cron job or CI task that periodically runs to refresh node lists
– May invoke a script or external subscription-fetch mechanism
c. External Subscription Sources
– Remote URLs or APIs from which proxy lists are pulled
d. Clash Client (runtime)
– Loads clash.yaml & proxies.yaml at startup or on reload
– Implements routing logic and connects to proxy servers
e. Proxy Servers (the actual nodes)
– The endpoints (from proxies.yaml) to which Clash forwards user traffic
f. End-User Device
– Device running Clash (desktop, mobile) generating network requests
Relationships and data flows
1. Scheduler → External Subscription Sources
• Fetch updated proxy lists on a schedule
2. Subscription Fetcher → proxies.yaml
• Writes/overwrites updated node definitions
3. Scheduler/Script → clash.yaml
• May merge new proxies into the config, update rule-group references
4. Clash Client → (reads) clash.yaml & proxies.yaml
• Loads routing rules and node lists
5. End-User Apps → Clash Client
• All DNS/HTTP/TCP requests are received by Clash
6. Clash Client → Proxy Servers
• Based on rules, forwards traffic to selected proxies
Architectural patterns and key principles
• Single Source of Truth for proxies (proxies.yaml)
• Separation of concerns:
– Scheduler/Updater (data acquisition)
– Configuration (YAML files)
– Runtime proxy engine (Clash)
• Cron-based refresh ensures configs stay up to date without manual intervention
• Declarative config approach—no custom code modules