Clash —— 规则驱动的高性能代理内核 Clash — Rule-based High-Performance Proxy Kernel

跨平台、透明代理、灵活分流、社区驱动。保护隐私,突破限制。 Cross-platform, transparent proxy, flexible routing, community-driven. Protect privacy, bypass restrictions.

核心特性Core Features

规则灵活Flexible Rules

支持DOMAIN、IP-CIDR、GEOIP、PROCESS-NAME等多类型规则,实现精细化分流Support DOMAIN, IP-CIDR, GEOIP, PROCESS-NAME for fine-grained traffic splitting

高性能High Performance

基于Go开发,内存占用低,并发连接处理高效,轻松应对大规模流量Written in Go, low memory footprint, efficient concurrent connections

跨平台Cross-Platform

Windows、macOS、Linux、Android、iOS及路由器均可运行Run on Windows, macOS, Linux, Android, iOS, and routers

透明代理Transparent Proxy

支持TUN模式,实现全局流量捕获,无需单独配置应用TUN mode captures all traffic without app configuration

RESTful APIRESTful API

提供丰富的API,便于集成与动态控制,支持热加载配置Rich API for integration and dynamic control, hot reload

社区生态Ecosystem

众多GUI客户端、仪表盘、规则集,开箱即用Many GUI clients, dashboards, rule sets ready to use

下载 ClashDownload Clash

选择适合您设备的版本Choose version for your device

查看所有版本View all releases

文档与指南Docs & Guides

社区与生态Community & Ecosystem

⭐ GitHub 23.5k Stars | 👥 4500+ 社区成员 | 🧑‍💻 180+ 贡献者⭐ GitHub 23.5k Stars | 👥 4500+ members | 🧑‍💻 180+ contributors

GitHub Discord Telegram Reddit X

💬 “Clash 是我用过最灵活的代理工具,规则引擎强大。” — 社区开发者💬 “Clash is the most flexible proxy tool I've ever used, powerful rule engine.” — Community Dev

最新动态Latest News

📢 Clash Meta v1.18.0 发布Clash Meta v1.18.0 Released

2026-03-20

增强TUN性能,修复内存泄漏TUN performance improved, memory leak fixed

📖 官方文档Wiki全面升级Official Wiki Upgrade

2026-03-05

新增交互式配置生成器Interactive config generator added

🎨 Clash Verge 2.0 测试版Clash Verge 2.0 Beta

2026-02-18

全新UI,支持多配置热切换New UI, multi-config hot reload

常见问题深度解答Deep Dive FAQs

1. Clash如何实现灵活的规则分流?1. How to implement flexible rule-based routing?
  • 第一步:编辑config.yaml配置文件,定义规则部分rules。
  • Step 1: Edit config.yaml, define rules section.
  • 第二步:使用DOMAIN-SUFFIX匹配域名后缀,如google.com。
  • Step 2: Use DOMAIN-SUFFIX for domain matching.
  • 第三步:利用GEOIP实现基于地理位置的策略选择。
  • Step 3: Apply GEOIP for location-based policies.
  • 第四步:结合PROCESS-NAME规则,指定应用走特定代理。
  • Step 4: Combine PROCESS-NAME to route specific apps.
  • 第五步:支持SRC-IP-CIDR,实现源IP精细路由。
  • Step 5: Support SRC-IP-CIDR for source IP granularity.
  • 第六步:规则优先级从上至下匹配,灵活构造代理链。
  • Step 6: Rules match top-down; build flexible chains.
2. 怎样优化Clash性能并降低资源占用?2. How to optimize performance and reduce resource usage?
  • 第一步:启用fake-ip模式减少DNS查询延迟。
  • Step 1: Enable fake-ip mode to reduce DNS latency.
  • 第二步:合理设置experimental连接池复用。
  • Step 2: Tune experimental connection pool reuse.
  • 第三步:调整find-process-mode为always减少进程扫描。
  • Step 3: Set find-process-mode to 'always' carefully.
  • 第四步:精简规则集,避免过多正则匹配。
  • Step 4: Trim rule set, avoid heavy regex.
  • 第五步:使用rule-provider远程规则,降低本地内存。
  • Step 5: Use rule-provider for remote rules to lower memory.
  • 第六步:开启GCM cipher加密模式加速传输。
  • Step 6: Enable GCM cipher for faster encryption.
3. Clash如何保障隐私与安全?3. How does Clash protect privacy and security?
  • 第一步:开启mixed-port仅本地监听,避免暴露端口。
  • Step 1: Listen only on mixed-port locally.
  • 第二步:使用TLS加密的代理协议(VMess/Trojan)。
  • Step 2: Use TLS encrypted protocols (VMess/Trojan).
  • 第三步:启用DNS over HTTPS,防止DNS泄漏。
  • Step 3: Enable DNS over HTTPS to prevent leaks.
  • 第四步:配置allow-lan仅限信任IP,规避外部攻击。
  • Step 4: Set allow-lan to trusted IPs only.
  • 第五步:定期更新GeoIP数据库及核心版本。
  • Step 5: Regularly update GeoIP DB and core.
  • 第六步:审计日志,通过API监控异常连接。
  • Step 6: Audit logs via API to monitor anomalies.
4. 如何在不同平台上统一Clash配置?4. How to sync Clash config across platforms?
  • 第一步:将config.yaml托管在私有HTTP服务器或GitHub。
  • Step 1: Host config.yaml on private HTTP server/GitHub.
  • 第二步:利用RESTful API实现远程配置拉取。
  • Step 2: Use RESTful API for remote config pulling.
  • 第三步:各平台订阅相同的配置URL,保持同步。
  • Step 3: Subscribe same URL across devices.
  • 第四步:使用环境变量或者命令行参数覆盖差异项。
  • Step 4: Override differences via env vars.
  • 第五步:编写脚本自动转换不同平台的出站接口名。
  • Step 5: Write scripts to adapt interface names.
  • 第六步:借助Clash Verge跨平台客户端内置同步功能。
  • Step 6: Use Clash Verge built-in sync feature.
5. 如何参与Clash社区或贡献代码?5. How to contribute to Clash community?
  • 第一步:访问GitHub仓库,阅读贡献指南。
  • Step 1: Visit GitHub repo and read contribution guide.
  • 第二步:在Issues中认领good-first-issue标签任务。
  • Step 2: Claim good-first-issue tasks.
  • 第三步:Fork项目,创建功能分支并实现特性。
  • Step 3: Fork project, create feature branch.
  • 第四步:编写测试用例,保证代码覆盖率。
  • Step 4: Write tests, ensure code coverage.
  • 第五步:提交Pull Request,遵循commit规范。
  • Step 5: Submit PR following commit convention.
  • 第六步:参与Discord技术讨论,帮助他人解决问题。
  • Step 6: Join Discord, help others.
6. 如何启用TUN模式实现透明代理?6. How to enable TUN mode for full transparent proxy?
  • 第一步:在配置文件中添加tun: {enable: true}字段。
  • Step 1: Add tun: {enable: true} to config.
  • 第二步:设置stack为system或gvisor,根据系统选择。
  • Step 2: Set stack to system or gvisor.
  • 第三步:配置dns监听并开启enhanced-mode fake-ip。
  • Step 3: Configure DNS with enhanced-mode fake-ip.
  • 第四步:添加路由排除私有IP范围避免环路。
  • Step 4: Exclude private IP ranges to avoid loops.
  • 第五步:管理员权限启动Clash (macOS需要授权)。
  • Step 5: Run with admin/root privileges.
  • 第六步:测试curl ifconfig.me验证全局流量经过代理。
  • Step 6: Test with curl ifconfig.me for global proxy.