强大特性,为效率而生
跨平台支持
Windows, macOS, Linux, Android, iOS (通过 Stash/Surge 桥接)。一套配置,全平台通用,无缝同步。
灵活规则
域名、IP、GEOIP、进程规则与策略组(Select / Fallback / Load-Balance)。极致定制化分流。
高性能内核
基于 Go 语言,极低内存占用,多核并发处理,毫秒级规则匹配,资源消耗减少30%。
开源透明
GitHub 28k+ Stars,活跃社区,完全开源 (GPL v3),代码可审计,无后门担忧。
选择你的平台
💡 命令行安装:brew install clash (macOS) 或 sudo apt install clash (Linux)
⚙️ 工作原理:流量 → 规则引擎 → 安全出口
基于 Go 开发,微秒级规则匹配,多核并发低负载,支持 TUN 虚拟网卡透明代理。
常见问题 — 分步骤专业解答
- Clash 核心定义:一款基于规则的多平台代理客户端,使用 Go 语言开发,提供灵活的流量分发策略。
- 原生协议支持:Shadowsocks、ShadowsocksR、VMess、Trojan、Snell、SOCKS5、HTTP/HTTPS 代理。
- 扩展能力:通过 outbound 插件支持 WireGuard 等自定义协议,满足高级用户需求。
- 策略路由:支持直连、代理、拒绝、故障转移和负载均衡等多种策略组。
- 配置格式:基于 YAML,易于版本控制,可动态热加载配置文件,无需重启。
- 社区生态:丰富的前端 GUI (Clash Verge, ClashX, Clash for Windows) 和 Dashboard,降低使用门槛。
✅ 总结:Clash 是当前开源社区最强大的规则代理核心之一,兼容主流协议。
- Windows:下载 clash-windows-amd64.exe 或使用 GUI 客户端 Clash Verge,解压后运行,编辑 config.yaml。
- macOS:推荐
brew install clash一键安装,或下载 dmg 包,配合 ClashX 图形界面。 - Linux:从 GitHub Releases 下载对应二进制,移动至 /usr/local/bin,设置 systemd 服务实现开机自启。
- Android:使用 Clash Meta for Android (CMFA) 或 ClashForAndroid,导入订阅链接即可。
- iOS:通过 Stash 或 Quantumult X 导入 Clash 配置,支持规则分流。
- Docker:官方镜像
dreamacro/clash一行命令运行,适合服务器部署。
💡 每个平台均提供校验和 (SHA256) 确保文件完整性,历史版本可在 Release 页面查找。
- 规则语法理解:DOMAIN-SUFFIX、DOMAIN-KEYWORD、IP-CIDR、GEOIP、PROCESS-NAME 等基础类型。
- 使用规则提供者 (Rule Provider):远程加载外部规则集,自动更新,避免配置文件臃肿。
- 策略组设计:合理使用 select(手动)、fallback(自动优选)、load-balance(负载均衡)提升体验。
- 最终兜底策略:始终保留
MATCH规则,建议设为代理或直连,防止漏网流量。 - 可视化调试:通过内置 REST API (端口 9090) 配合 Yacd 或 Clash Dashboard 实时查看匹配结果。
- 定期维护:更新 geoip.dat 和 GeoSite 数据库,清理过期规则,保证分流准确度。
- 跨平台性:Clash 原生支持 Win/macOS/Linux/Android;v2rayN 仅 Windows,Surge 仅 Apple 生态。
- 开源与免费:Clash 采用 GPL v3 完全免费;Surge 闭源且收费,v2rayN 免费但功能侧重不同。
- 规则引擎强度:Clash 拥有策略组、延时测试、自动故障转移,远超 v2rayN 的路由简易程度。
- TUN 模式:Clash 支持虚拟网卡透明代理,可代理所有流量;Surge 也有类似功能但需付费。
- API 与生态:Clash 提供标准 REST API,第三方面板丰富;Surge 模块化但封闭。
- 社区配置分享:Clash 配置文件通用性高,教程丰富,用户基数庞大,学习曲线平滑。
- 许可证:Clash 核心采用 GPL v3 协议,保证代码自由共享,任何修改必须开源。
- 代码仓库:GitHub 组织 Dreamacro/clash,欢迎提交 issue 或 pull request。
- 贡献指南:遵循 gofmt 规范,编写单元测试,并确保不破坏现有 API 兼容性。
- 非代码贡献:完善官方 Wiki、翻译文档(中/英)、设计 Logo 或制作视频教程。
- 社区沟通渠道:加入 Telegram 群组或 Discord,反馈 Bug 或讨论新特性设计。
- 财务支持:通过 GitHub Sponsors 赞助核心开发者,推动项目可持续发展。
- 启用详细日志:在 config.yaml 中设置
log-level: debug,观察规则匹配与代理握手细节。 - 检查代理节点连通性:使用 Clash 内置的
http://127.0.0.1:9090/proxiesAPI 测试延迟。 - 优化 DNS 设置:启用
dns: enhanced-mode: fake-ip减少 DNS 污染,提升响应速度。 - 调整并发与连接池:修改
mixed-port和keep-alive间隔,降低重连开销。 - 启用 TUN 模式优化:针对游戏或 UDP 场景,开启
tun: true提升兼容性。 - 硬件资源监控:确保 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
💡 CLI install: brew install clash (macOS) or sudo apt install clash (Linux)
⚙️ How It Works: Traffic → Rule Engine → Secure Exit
Built with Go, microsecond rule matching, multi-core low overhead, TUN transparent proxy support.
Active Open Source Ecosystem
Join tens of thousands of users worldwide, get plugins, config examples and real-time support.
📢 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
- Clash Core: Rule-based multi-platform proxy client written in Go.
- Native Protocols: Shadowsocks, VMess, Trojan, Snell, SOCKS5, HTTP/HTTPS.
- Extensibility: Outbound plugins for WireGuard etc.
- Policy Routing: Direct, Proxy, Reject, Fallback, Load-Balance.
- Config Format: YAML, hot-reload, version control friendly.
- Ecosystem: GUIs like Clash Verge, ClashX, and dashboards.
✅ Clash is one of the most powerful open-source proxy cores.
- Windows: Download clash-windows-amd64.exe or Clash Verge GUI.
- macOS:
brew install clashor download .dmg with ClashX. - Linux: Download binary, move to /usr/local/bin, set systemd service.
- Android: Use Clash Meta for Android (CMFA).
- iOS: Stash or Quantumult X import config.
- Docker:
dreamacro/clashimage.
💡 SHA256 checksums provided for each release.
- Syntax: DOMAIN-SUFFIX, IP-CIDR, GEOIP, PROCESS-NAME.
- Rule Providers: Remote rule sets with auto-update.
- Policy Groups: select, fallback, load-balance.
- MATCH rule: final fallback policy.
- Visual Debug: REST API + Yacd dashboard.
- Maintenance: Update geoip.dat and GeoSite regularly.
- Cross-platform: Clash works on Win/macOS/Linux/Android; v2rayN only Windows, Surge only Apple.
- Open Source: Clash is GPL v3 free; Surge is paid.
- Rule Engine: Clash advanced policy groups and auto failover.
- TUN Mode: Full transparent proxy on all OS.
- API & Ecosystem: REST API, rich third-party dashboards.
- Community Config Sharing: Broad user base, easy to find examples.
- License: GPL v3, ensuring freedom and open collaboration.
- Repo: GitHub Dreamacro/clash.
- Contribution Guide: Follow gofmt, write tests.
- Non-code: Improve docs, translations, design.
- Community: Telegram/Discord for discussions.
- Sponsorship: GitHub Sponsors for sustainable development.
- Enable debug logs: set log-level: debug.
- Check proxy latency: via API
http://127.0.0.1:9090/proxies. - Optimize DNS: use fake-ip mode.
- Tune connection pool: adjust keep-alive.
- Enable TUN mode: for gaming/UDP.
- Monitor resources: reduce rule complexity if needed.
🔧 Keep GeoIP databases updated for best performance.