Skip to content

ClashConnectRules/Self-Configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฎ Self-Configuration

Personal Proxy Tool Configuration Collection

ไธชไบบไปฃ็†ๅทฅๅ…ท้…็ฝฎๆ–‡ไปถ้›†ๅˆ

Clash Surge License

Features โ€ข Clash โ€ข Surge โ€ข Providers โ€ข Sources

๐Ÿ‡จ๐Ÿ‡ณ ็ฎ€ไฝ“ไธญๆ–‡ | ๐Ÿ‡บ๐Ÿ‡ธ English


โœจ Features

  • ๐Ÿš€ High Performance - Optimized configurations for maximum speed
  • ๐ŸŽฏ Smart Routing - Intelligent traffic splitting and regional selection
  • ๐Ÿ›ก๏ธ Privacy Protection - Built-in ad blocking and tracker prevention
  • ๐ŸŒ Global Streaming - Netflix, Disney+, YouTube, TikTok unlock support
  • ๐Ÿค– AI Services - Dedicated routing for ChatGPT, Claude, Gemini
  • ๐Ÿ“ฑ Cross-Platform - Support for Clash, Surge, Stash, and more
  • โšก Auto Failover - Automatic URL testing for optimal node selection
  • ๐Ÿ”„ Easy Updates - Integrated subscription management

๐Ÿ“ File Structure

Self-Configuration/
โ”œโ”€โ”€ Clash.yaml      # Clash / Clash Meta configuration
โ”œโ”€โ”€ Surge.conf      # Surge configuration
โ”œโ”€โ”€ README.md       # English documentation
โ””โ”€โ”€ README_CN.md    # ไธญๆ–‡ๆ–‡ๆกฃ

๐Ÿ”ท Clash Configuration

Compatible Clients: Clash ยท Clash for Windows ยท Clash Meta ยท Stash ยท FlClash

โš™๏ธ Basic Settings

Setting Value Description
Mixed Port 7890 Shared HTTP/SOCKS5 port
Controller 9090 Web dashboard port
Mode Rule Rule-based routing mode
Allow LAN true Allow LAN connections
IPv6 true IPv6 support enabled
Enhanced Mode Fake-IP Enhanced performance mode

๐ŸŒ DNS Configuration

Type Server Provider
DoT tls://223.5.5.5:853 Alibaba DNS
DoT tls://223.6.6.6:853 Alibaba DNS
DoH https://doh.pub/dns-query DNSPod
DoH https://dns.alidns.com/dns-query Alibaba DNS

๐ŸŽฏ Proxy Groups

๐Ÿš€ Main Selection Groups

Group Type Description
่Š‚็‚น้€‰ๆ‹ฉ select Main entry point for policy selection
ๆ‰‹ๅŠจๅˆ‡ๆข select Manual node selection
่‡ชๅŠจ้€‰ๆ‹ฉ url-test Auto-select lowest latency node

๐ŸŒ Regional Groups

Group Filter Pattern Region
๐Ÿ‡ญ๐Ÿ‡ฐ Hong Kong ๆธฏ|HK|Hong Kong Hong Kong SAR
๐Ÿ‡ฏ๐Ÿ‡ต Japan ๆ—ฅ|JP|Japan Japan
๐Ÿ‡บ๐Ÿ‡ธ United States ็พŽ|US|United States USA
๐Ÿ‡ธ๐Ÿ‡ฌ Singapore ๆ–ฐ|SG|Singapore Singapore
๐Ÿ‡น๐Ÿ‡ผ Taiwan ๅฐ|TW|Taiwan Taiwan
๐Ÿ‡ฐ๐Ÿ‡ท Korea ้Ÿฉ|KR|Korea South Korea
๐Ÿ‡ฌ๐Ÿ‡ง United Kingdom ่‹ฑ|UK|United Kingdom UK
๐Ÿ‡ฉ๐Ÿ‡ช Germany ๅพท|DE|Germany Germany
๐Ÿ‡ซ๐Ÿ‡ท France ๆณ•|FR|France France
๐ŸŒ Other Regions Exclude above Other regions

๐Ÿ“ฆ Service-Specific Groups

Group Default Purpose
๐Ÿค– AIๆœๅŠก Proxy ChatGPT, Claude, Gemini
๐Ÿ“น YouTube Proxy YouTube videos
๐Ÿ” ่ฐทๆญŒๆœๅŠก Proxy Google Search, Maps
๐Ÿ“ง Google FCM Proxy Push notifications
โœˆ๏ธ Telegram Proxy Messaging service
๐ŸŽ AppleๆœๅŠก DIRECT Apple services
โ“‚๏ธ ๅพฎ่ฝฏๆœๅŠก DIRECT Microsoft services
๐ŸŒ ๅ›ฝๅค–ๅช’ไฝ“ Proxy Netflix, Disney+, etc.
๐ŸŽฏ ๅ›ฝๅ†…ๆต้‡ DIRECT Mainland China sites
๐Ÿซง WeChat DIRECT WeChat messaging
๐Ÿšซ ๅนฟๅ‘Šๆ‹ฆๆˆช REJECT Ad blocking

๐Ÿ“‹ Rule Priority

 1. ๐Ÿšซ Ad Blocking      โ†’ REJECT
 2. โšก Special Rules    โ†’ DIRECT
 3. ๐Ÿค– AI Services      โ†’ Proxy
 4. ๐ŸŽฌ Streaming        โ†’ Proxy
 5. ๐Ÿ“บ CN Media         โ†’ DIRECT
 6. ๐Ÿ’ฌ Messaging        โ†’ Proxy
 7. ๐Ÿ”ง Tech Services    โ†’ Auto
 8. ๐Ÿ’ฐ Cryptocurrency   โ†’ Proxy
 9. ๐ŸŽฎ Gaming           โ†’ Auto
10. ๐Ÿ‡จ๐Ÿ‡ณ CN Rules        โ†’ DIRECT
11. ๐ŸŒ GeoIP CN         โ†’ DIRECT
12. ๐ŸŒ Final Rule       โ†’ Proxy

๐Ÿš€ Quick Start

1. Import Configuration

Download Clash.yaml and import it to your client.

2. Update Subscription URL

Replace the subscription URL in the configuration:

proxy-providers:
  all-proxies:
    type: http
    url: "https://your-subscription-url"
    interval: 3600
    path: ./providers/all-proxies.yaml
    health-check:
      enable: true
      interval: 600
      url: http://www.gstatic.com/generate_204

3. Enable and Select Nodes

Enable the configuration and select your preferred nodes.


๐Ÿ”— Multiple Proxy Providers

When you have multiple subscription sources, you can integrate them as follows:

1. Configure Multiple Providers

proxy-providers:
  provider-1:
    type: http
    url: "https://subscription-1.com"
    interval: 3600
    path: ./providers/provider-1.yaml
    health-check:
      enable: true
      interval: 600
      url: http://www.gstatic.com/generate_204

  provider-2:
    type: http
    url: "https://subscription-2.com"
    interval: 3600
    path: ./providers/provider-2.yaml
    health-check:
      enable: true
      interval: 600
      url: http://www.gstatic.com/generate_204

2. Integration Methods

Method A: Proxy Groups

proxy-groups:
  # Auto-select fastest node from all providers
  - name: "Auto"
    type: url-test
    use:
      - provider-1
      - provider-2
    url: http://www.gstatic.com/generate_204
    interval: 300

  # Manual selection from all providers
  - name: "Manual"
    type: select
    use:
      - provider-1
      - provider-2

  # Regional groups with filter
  - name: "Hong Kong"
    type: url-test
    use:
      - provider-1
      - provider-2
    filter: "ๆธฏ|HK|Hong Kong"
    url: http://www.gstatic.com/generate_204
    interval: 300

Method B: Load Balancing

proxy-groups:
  - name: "Load-Balance"
    type: load-balance
    use:
      - provider-1
      - provider-2
    strategy: consistent-hashing  # or round-robin
    url: http://www.gstatic.com/generate_204

3. Key Parameters

Parameter Description
use Specify which proxy providers to use
filter Filter nodes by name (supports regex)
url-test Auto-test latency and select fastest
load-balance Distribute traffic across nodes
select Manual selection mode

4. Best Practices

๐Ÿ’ก Tip: Follow these practices for optimal performance

  • Regional Grouping - Use filter to group nodes by region
  • Smart Selection - Use url-test for automatic optimal node selection
  • Regular Updates - Set appropriate interval for subscription updates
  • Health Check - Enable health-check to filter unavailable nodes
  • Backup Sources - Configure multiple subscriptions for higher availability

๐Ÿ”ถ Surge Configuration

Compatible Clients: Surge for iOS ยท Surge for macOS

โš™๏ธ Basic Settings

Setting Value Description
HTTP Port 6152 Wi-Fi sharing port
SOCKS5 Port 6153 Wi-Fi sharing port
Controller 6160 API control port
Dashboard 6166 Web dashboard port
IPv6 false Disabled by default

๐ŸŒ DNS Configuration

Type Server Provider
System DNS 223.5.5.5, 223.6.6.6, 119.29.29.29 China DNS
DoH https://doh.pub/dns-query DNSPod
DoH https://dns.alidns.com/dns-query Alibaba DNS
Hijack 8.8.8.8:53, 8.8.4.4:53 Google DNS

๐ŸŽฏ Proxy Groups

๐Ÿš€ Core Groups

Group Type Description
NoAuto select Main entry point
Automatic select Regional selection
AllServer select All subscription nodes
Proxy select Proxy policy

๐ŸŒ Regional Groups (Auto URL-Test)

Group Filter Pattern Interval
Hong Kong ๆธฏ|๐Ÿ‡ญ๐Ÿ‡ฐ|้ฆ™ๆธฏ|HK|Hong 300s
Taiwan ๅฐ|๐Ÿ‡น๐Ÿ‡ผ|ๅฐๆนพ|TW|Tai 300s
Japan ๆ—ฅ|๐Ÿ‡ฏ๐Ÿ‡ต|ๆ—ฅๆœฌ|JP|Japan 300s
Singapore ๅก|๐Ÿ‡ธ๐Ÿ‡ฌ|ๆ–ฐๅŠ ๅก|็‹ฎๅŸŽ|SG 300s
United States ็พŽ|๐Ÿ‡บ๐Ÿ‡ธ|็พŽๅ›ฝ|US|States 300s
United Kingdom ๐Ÿ‡ฌ๐Ÿ‡ง|่‹ฑๅ›ฝ|UK 300s
Korea ้Ÿฉ|้Ÿฉๅ›ฝ|Korea|KR|๐Ÿ‡ฐ๐Ÿ‡ท 300s
Other Exclude above 300s

๐Ÿ“ฆ Service-Specific Groups

Group Default Purpose
AI Automatic ChatGPT, Claude, Gemini, Bing
YouTube Automatic YouTube videos
Netflix Hong Kong Netflix streaming
Disney+ Hong Kong Disney+ streaming
TikTok Taiwan TikTok unlock
Telegram Automatic Messaging
X Automatic Twitter/X
Microsoft Mainland Microsoft services
OneDrive Mainland Cloud storage
Apple Mainland Apple services
WeChat Mainland WeChat
Bilibili Mainland Bilibili (HK/TW unlock)
Speedtest Mainland Speed test

๐Ÿ“‹ Rule Priority

 1. ๐Ÿ”ง Unbreak Rules    โ†’ DIRECT
 2. โœ๏ธ Manual Rules     โ†’ Custom
 3. ๐Ÿšซ Ad Blocking      โ†’ REJECT
 4. ๐Ÿ”’ Privacy          โ†’ REJECT
 5. ๐Ÿ“ฑ CN Apps          โ†’ DIRECT
 6. ๐ŸŽ Apple Services   โ†’ DIRECT
 7. ๐Ÿค– AI Services      โ†’ Automatic
 8. ๐ŸŽฌ Streaming        โ†’ Regional
 9. ๐ŸŒ Regional Unlock  โ†’ Regional
10. ๐Ÿ’ฌ Social Media     โ†’ Automatic
11. ๐Ÿ”ง Other Global     โ†’ Auto
12. ๐Ÿ‡จ๐Ÿ‡ณ CN Rules        โ†’ DIRECT
13. ๐ŸŒ Global Rules     โ†’ Auto
14. ๐Ÿ  LAN              โ†’ DIRECT
15. ๐ŸŽฏ Final Rule       โ†’ NoAuto

โœจ Special Features

๐Ÿ”„ URL Rewrite

Original Target Type
google.cn google.com 302 Redirect
maps.google.cn maps.google.com 302 Redirect
taobao.com HTTPS Force upgrade
jd.com HTTPS Force upgrade

๐Ÿ  Host Mapping

Service DNS Server Description
Taobao/Tmall/Alipay 223.5.5.5 Alibaba services
JD/QQ/WeChat 119.28.28.28 Tencent services
Bilibili/NetEase 119.29.29.29 Entertainment
Router Admin System DNS Local devices

๐Ÿš€ Quick Start

1. Import Configuration

Download Surge.conf and import it to Surge.

2. Update Subscription URL

AllServer = select, ..., policy-path=https://your-subscription-url

3. Configure MITM Certificate

Install and trust the MITM certificate for URL rewrite functionality.

4. Enable Configuration

Enable the configuration in Surge.


๐Ÿ“š Rule Sources

Source Description Provider
[dler-io/Rules] Main Clash ruleset @dler-io
[blackmatrix7] Cross-platform rules @blackmatrix7
[SukkaW/Surge] SKK ruleset @SukkaW
[VirgilClyne] ASN rules @VirgilClyne
[Semporia] TikTok unlock @Semporia

โš ๏ธ Important Notes

Item Description
๐Ÿ”— Subscription Must replace with your own subscription URL
๐Ÿ”„ Rule Update Rules auto-update every 7 days
โฑ๏ธ Speed Test 300s interval, 3s timeout
๐Ÿ” MITM Certificate Required for Surge URL rewrite
๐Ÿ” Node Filter Auto-filter nodes with "traffic/reset/expire" keywords

๐Ÿ“„ License

This project is licensed under the MIT License.


Made with โค๏ธ for a better internet experience

โฌ† Back to Top

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published