Mastering Clash: A Comprehensive Guide to Subscription Setup, Proxy Groups, and Rule Management
2/20/2026 · 3 min
1. Subscription Setup: Streamlining Proxy Access
Clash automates proxy node retrieval via subscription links, simplifying initial configuration. Users can define proxies or leverage proxy-providers to fetch node lists from remote URLs.
1.1 Basic Subscription Configuration
- Subscription URL: Specify the
urlparameter inproxy-providers, e.g.,url: https://example.com/sub. - Update Interval: Set
intervalfor automatic refresh (in seconds); 86400 (24 hours) is recommended. - Health Check: Enable
health-checkto periodically test node availability, ensuring proxy quality.
1.2 Managing Multiple Subscriptions
Clash supports loading multiple subscription sources simultaneously. Use the path field to define local cache files, avoiding redundant downloads. Example:
proxy-providers:
provider1:
type: http
url: "https://sub1.example.com"
interval: 86400
path: ./provider1.yaml
health-check:
enable: true
url: http://www.gstatic.com/generate_204
interval: 300
2. Proxy Groups: Intelligent Routing and Load Balancing
Proxy groups are the core of Clash, defining how nodes are selected for traffic. Common types include:
2.1 Key Proxy Group Types
- url-test: Automatically selects the node with the lowest latency, ideal for speed-sensitive tasks.
- fallback: Uses nodes by priority; switches to backup nodes when the primary fails.
- load-balance: Distributes traffic across multiple nodes to improve overall throughput.
- select: Allows manual node selection, offering maximum flexibility.
2.2 Proxy Group Configuration Example
proxy-groups:
- name: "Auto"
type: url-test
proxies:
- "HK-01"
- "JP-01"
- "US-01"
url: "http://www.gstatic.com/generate_204"
interval: 300
3. Rule Management: Granular Traffic Control
Rules determine how traffic is matched to proxies or direct connections. Clash supports multiple rule types, evaluated in order.
3.1 Rule Types and Priority
- DOMAIN-SUFFIX: Matches domain suffixes, e.g.,
DOMAIN-SUFFIX,google.com,Proxy. - DOMAIN-KEYWORD: Matches domain keywords, e.g.,
DOMAIN-KEYWORD,ad,REJECT. - GEOIP: Matches based on IP geolocation, e.g.,
GEOIP,CN,DIRECT. - MATCH: Catch-all rule for unmatched traffic.
3.2 Rule Optimization Tips
- Place frequently used direct rules (e.g., domestic sites) at the top to reduce proxy evaluation overhead.
- Use
RULE-SETto reference external rule files for easier maintenance. - Limit total rules to under 200 to avoid performance degradation.
4. Performance Optimization and Debugging
4.1 Memory and CPU Optimization
- Enable
sniff-tls-sniunderexperimentalto improve TLS identification efficiency. - Adjust
keep-alive-intervalto reduce connection re-establishment overhead.
4.2 Logging and Debugging
- Set
log-level: infoto view connection logs and troubleshoot rule matching. - Enable
external-controllerto access the RESTful API for real-time monitoring via a dashboard.
By properly configuring subscriptions, proxy groups, and rules, Clash can significantly enhance your network experience.