为所有人设计的规则代理客户端

支持 Shadowsocks、VMess、Trojan、Snell 等多种协议。高性能、跨平台、完全开源。

强大特性,为效率而生

🖥️

跨平台支持

Windows, macOS, Linux, Android, iOS (通过 Stash/Surge 桥接)。一套配置,全平台通用,无缝同步。

⚙️

灵活规则

域名、IP、GEOIP、进程规则与策略组(Select / Fallback / Load-Balance)。极致定制化分流。

高性能内核

基于 Go 语言,极低内存占用,多核并发处理,毫秒级规则匹配,资源消耗减少30%。

🔓

开源透明

GitHub 28k+ Stars,活跃社区,完全开源 (GPL v3),代码可审计,无后门担忧。

选择你的平台

🪟

Windows

立即下载
🍏

macOS

立即下载
🐧

Linux

立即下载
📱

Android

立即下载
📲

iOS

App Store

💡 命令行安装:brew install clash (macOS) 或 sudo apt install clash (Linux)

⚙️ 工作原理:流量 → 规则引擎 → 安全出口

1. 应用发起请求2. Clash 内核捕获3. 规则匹配 (域名/IP/GEOIP)4. 策略组决策5. 加密隧道传输

基于 Go 开发,微秒级规则匹配,多核并发低负载,支持 TUN 虚拟网卡透明代理。

⭐ GitHub Stars: 28.6k🍴 Forks: 4.2k👥 贡献者: 320+

活跃的开源生态

加入全球数万用户的讨论,获取插件、配置案例以及实时支持。

Discord Telegram Twitter

📢 最新动态

v1.18.4 正式发布 — 优化 TUN 模式内存占用,规则 Provider 支持热加载 (2026-03-28)

官方文档全面升级,新增交互式配置生成器,新手友好向导,助你10分钟快速上手。

常见问题 — 分步骤专业解答

1. Clash 是什么?支持哪些代理协议?
  1. Clash 核心定义:一款基于规则的多平台代理客户端,使用 Go 语言开发,提供灵活的流量分发策略。
  2. 原生协议支持:Shadowsocks、ShadowsocksR、VMess、Trojan、Snell、SOCKS5、HTTP/HTTPS 代理。
  3. 扩展能力:通过 outbound 插件支持 WireGuard 等自定义协议,满足高级用户需求。
  4. 策略路由:支持直连、代理、拒绝、故障转移和负载均衡等多种策略组。
  5. 配置格式:基于 YAML,易于版本控制,可动态热加载配置文件,无需重启。
  6. 社区生态:丰富的前端 GUI (Clash Verge, ClashX, Clash for Windows) 和 Dashboard,降低使用门槛。

✅ 总结:Clash 是当前开源社区最强大的规则代理核心之一,兼容主流协议。

2. 如何在不同操作系统上安装 Clash?
  1. Windows:下载 clash-windows-amd64.exe 或使用 GUI 客户端 Clash Verge,解压后运行,编辑 config.yaml。
  2. macOS:推荐 brew install clash 一键安装,或下载 dmg 包,配合 ClashX 图形界面。
  3. Linux:从 GitHub Releases 下载对应二进制,移动至 /usr/local/bin,设置 systemd 服务实现开机自启。
  4. Android:使用 Clash Meta for Android (CMFA) 或 ClashForAndroid,导入订阅链接即可。
  5. iOS:通过 Stash 或 Quantumult X 导入 Clash 配置,支持规则分流。
  6. Docker:官方镜像 dreamacro/clash 一行命令运行,适合服务器部署。

💡 每个平台均提供校验和 (SHA256) 确保文件完整性,历史版本可在 Release 页面查找。

3. 怎样高效编写与管理 Clash 规则?
  1. 规则语法理解:DOMAIN-SUFFIX、DOMAIN-KEYWORD、IP-CIDR、GEOIP、PROCESS-NAME 等基础类型。
  2. 使用规则提供者 (Rule Provider):远程加载外部规则集,自动更新,避免配置文件臃肿。
  3. 策略组设计:合理使用 select(手动)、fallback(自动优选)、load-balance(负载均衡)提升体验。
  4. 最终兜底策略:始终保留 MATCH 规则,建议设为代理或直连,防止漏网流量。
  5. 可视化调试:通过内置 REST API (端口 9090) 配合 Yacd 或 Clash Dashboard 实时查看匹配结果。
  6. 定期维护:更新 geoip.dat 和 GeoSite 数据库,清理过期规则,保证分流准确度。
4. Clash 与其他代理客户端(v2rayN / Surge)核心区别是什么?
  1. 跨平台性:Clash 原生支持 Win/macOS/Linux/Android;v2rayN 仅 Windows,Surge 仅 Apple 生态。
  2. 开源与免费:Clash 采用 GPL v3 完全免费;Surge 闭源且收费,v2rayN 免费但功能侧重不同。
  3. 规则引擎强度:Clash 拥有策略组、延时测试、自动故障转移,远超 v2rayN 的路由简易程度。
  4. TUN 模式:Clash 支持虚拟网卡透明代理,可代理所有流量;Surge 也有类似功能但需付费。
  5. API 与生态:Clash 提供标准 REST API,第三方面板丰富;Surge 模块化但封闭。
  6. 社区配置分享:Clash 配置文件通用性高,教程丰富,用户基数庞大,学习曲线平滑。
5. Clash 的开源许可证是什么?如何参与贡献代码或文档?
  1. 许可证:Clash 核心采用 GPL v3 协议,保证代码自由共享,任何修改必须开源。
  2. 代码仓库:GitHub 组织 Dreamacro/clash,欢迎提交 issue 或 pull request。
  3. 贡献指南:遵循 gofmt 规范,编写单元测试,并确保不破坏现有 API 兼容性。
  4. 非代码贡献:完善官方 Wiki、翻译文档(中/英)、设计 Logo 或制作视频教程。
  5. 社区沟通渠道:加入 Telegram 群组或 Discord,反馈 Bug 或讨论新特性设计。
  6. 财务支持:通过 GitHub Sponsors 赞助核心开发者,推动项目可持续发展。
6. 遇到连接失败或速度慢时,如何逐步调试并优化性能?
  1. 启用详细日志:在 config.yaml 中设置 log-level: debug,观察规则匹配与代理握手细节。
  2. 检查代理节点连通性:使用 Clash 内置的 http://127.0.0.1:9090/proxies API 测试延迟。
  3. 优化 DNS 设置:启用 dns: enhanced-mode: fake-ip 减少 DNS 污染,提升响应速度。
  4. 调整并发与连接池:修改 mixed-portkeep-alive 间隔,降低重连开销。
  5. 启用 TUN 模式优化:针对游戏或 UDP 场景,开启 tun: true 提升兼容性。
  6. 硬件资源监控:确保 CPU/内存未满载,若使用老旧设备,降低规则复杂度并禁用实验性功能。

🔧 最终建议:使用最新稳定版并定期更新 GeoIP 数据库,通常可解决大部分性能问题。

The Rule-Based Proxy Client for Everyone

Supporting Shadowsocks, VMess, Trojan, Snell & more. High performance, cross-platform, and open source.

Core Features

🖥️

Cross-Platform

Windows, macOS, Linux, Android, iOS (via Stash/Surge bridge). One config, all devices.

⚙️

Flexible Rules

Domain, IP, GEOIP, Process rules with policy groups. Ultimate customization.

High Performance

Built with Go, low memory, multi-core concurrency, millisecond response.

🔓

Open Source

GitHub 28k+ stars, transparent code, active community & plugin ecosystem.

Download for Your Platform

🪟

Windows

Download
🍏

macOS

Download
🐧

Linux

Download
📱

Android

Download
📲

iOS

App Store

💡 CLI install: brew install clash (macOS) or sudo apt install clash (Linux)

⚙️ How It Works: Traffic → Rule Engine → Secure Exit

1. App Request2. Clash Kernel Capture3. Rule Matching (Domain/IP/GEOIP)4. Policy Decision5. Encrypted Tunnel

Built with Go, microsecond rule matching, multi-core low overhead, TUN transparent proxy support.

⭐ GitHub Stars: 28.6k🍴 Forks: 4.2k👥 Contributors: 320+

Active Open Source Ecosystem

Join tens of thousands of users worldwide, get plugins, config examples and real-time support.

Discord Telegram Twitter

📢 Latest News

v1.18.4 released — TUN mode memory optimization, hot-reload for rule providers (2026-03-28)

Official docs upgraded: interactive config generator helps beginners get started in 10 minutes.

Frequently Asked Questions — Step-by-Step

1. What is Clash and what protocols does it support?
  1. Clash Core: Rule-based multi-platform proxy client written in Go.
  2. Native Protocols: Shadowsocks, VMess, Trojan, Snell, SOCKS5, HTTP/HTTPS.
  3. Extensibility: Outbound plugins for WireGuard etc.
  4. Policy Routing: Direct, Proxy, Reject, Fallback, Load-Balance.
  5. Config Format: YAML, hot-reload, version control friendly.
  6. Ecosystem: GUIs like Clash Verge, ClashX, and dashboards.

✅ Clash is one of the most powerful open-source proxy cores.

2. How to install Clash on different operating systems?
  1. Windows: Download clash-windows-amd64.exe or Clash Verge GUI.
  2. macOS: brew install clash or download .dmg with ClashX.
  3. Linux: Download binary, move to /usr/local/bin, set systemd service.
  4. Android: Use Clash Meta for Android (CMFA).
  5. iOS: Stash or Quantumult X import config.
  6. Docker: dreamacro/clash image.

💡 SHA256 checksums provided for each release.

3. How to write and manage rules efficiently?
  1. Syntax: DOMAIN-SUFFIX, IP-CIDR, GEOIP, PROCESS-NAME.
  2. Rule Providers: Remote rule sets with auto-update.
  3. Policy Groups: select, fallback, load-balance.
  4. MATCH rule: final fallback policy.
  5. Visual Debug: REST API + Yacd dashboard.
  6. Maintenance: Update geoip.dat and GeoSite regularly.
4. Differences between Clash and other clients (v2rayN / Surge)?
  1. Cross-platform: Clash works on Win/macOS/Linux/Android; v2rayN only Windows, Surge only Apple.
  2. Open Source: Clash is GPL v3 free; Surge is paid.
  3. Rule Engine: Clash advanced policy groups and auto failover.
  4. TUN Mode: Full transparent proxy on all OS.
  5. API & Ecosystem: REST API, rich third-party dashboards.
  6. Community Config Sharing: Broad user base, easy to find examples.
5. What license does Clash use? How to contribute?
  1. License: GPL v3, ensuring freedom and open collaboration.
  2. Repo: GitHub Dreamacro/clash.
  3. Contribution Guide: Follow gofmt, write tests.
  4. Non-code: Improve docs, translations, design.
  5. Community: Telegram/Discord for discussions.
  6. Sponsorship: GitHub Sponsors for sustainable development.
6. How to debug connection issues and optimize performance?
  1. Enable debug logs: set log-level: debug.
  2. Check proxy latency: via API http://127.0.0.1:9090/proxies.
  3. Optimize DNS: use fake-ip mode.
  4. Tune connection pool: adjust keep-alive.
  5. Enable TUN mode: for gaming/UDP.
  6. Monitor resources: reduce rule complexity if needed.

🔧 Keep GeoIP databases updated for best performance.