稳定版本持续更新中 Stable Release Available

Clash —— 基于规则的现代网络代理工具 Clash —— The Rule-Based Modern Proxy Utility

开源、跨平台、高性能,为每一位互联网用户打造更好的网络体验。支持多协议、智能路由与灵活的策略组管理。 Open-source, cross-platform, high-performance. Built for a better network experience — supporting multiple protocols, intelligent routing, and flexible policy group management.

强大而灵活的代理能力 Powerful & Flexible Proxy Capabilities

Clash 提供丰富的协议支持与精细化的路由控制,满足从日常上网到高级网络管理的各类需求。 Clash offers comprehensive protocol support and fine-grained routing control for everything from daily browsing to advanced network management.

📥

入站连接支持Inbound Connections

支持 HTTP、HTTPS、SOCKS5 服务端以及 TUN 设备*,灵活接收各类网络流量。 Supports HTTP, HTTPS, SOCKS5 servers, and TUN device* — flexibly accepting all types of network traffic.

📤

出站连接支持Outbound Connections

兼容 Shadowsocks(R)、VMess、Trojan、Snell、SOCKS5、HTTP(S)、WireGuard* 等主流协议。 Compatible with Shadowsocks(R), VMess, Trojan, Snell, SOCKS5, HTTP(S), WireGuard*, and more.

🧭

基于规则的路由Rule-Based Routing

支持动态脚本、域名、IP 地址、进程名称等多种匹配规则,实现精细化流量分流。 Dynamic scripting, domain, IP, and process name matching for precise traffic splitting.

🔍

Fake-IP DNS

有效减少 DNS 污染影响,提升网络性能与响应速度,优化跨境访问体验。 Effectively reduces DNS pollution impact, improving network performance and cross-border access.

🔮

透明代理Transparent Proxy

使用自动路由表/规则管理 Redirect TCP 和 TProxy TCP/UDP*,实现无缝代理体验。 Auto route table/rule management for Redirect TCP and TProxy TCP/UDP* — seamless proxy experience.

Premium
⚖️

Proxy Groups 策略组Strategy Groups

支持自动可用性测试(fallback)、负载均衡(load balance)及延迟测试(url-test)等多种策略。 Auto fallback, load balancing, and url-test latency testing for intelligent proxy selection.

☁️

远程 ProvidersRemote Providers

支持动态加载远程代理列表,轻松管理和更新大量节点配置,保持配置始终最新。 Dynamically load remote proxy lists, easily manage and update large node configurations.

Premium
🔧

RESTful API

通过全面的 API 接口就地更新配置,支持自动化管理与第三方工具集成。 Comprehensive API for in-place configuration updates, automation, and third-party integration.

选择适合您的平台 Choose Your Platform

Clash 覆盖主流桌面与移动平台,点击下方标签切换平台,找到最适合您的客户端版本。 Clash covers all major desktop and mobile platforms. Switch tabs below to find the right client for you.

🖥️
Clash for Windows
版本:最新稳定版 Version: Latest Stable Premium
⬇️ 下载 Windows 版Download for Windows SHA256 校验说明见发布页 SHA256 verification on release page
🍎
ClashX Pro / Stash for macOS
版本:最新稳定版 Version: Latest Stable
⬇️ 下载 macOS 版Download for macOS SHA256 校验说明见发布页 SHA256 verification on release page
🐧
Clash for Linux
版本:最新稳定版 | 含命令行安装指南 Version: Latest Stable | CLI install guide included
⬇️ 下载 Linux 版Download for Linux SHA256 校验说明见发布页 SHA256 verification on release page
📱
Stash for iOS
版本:App Store 最新版 Version: Latest on App Store
🤖
Clash for Android
版本:最新稳定版 Version: Latest Stable Premium
⬇️ 下载 Android 版Download for Android SHA256 校验说明见发布页 SHA256 verification on release page
📡
OpenClash
版本:最新稳定版 | 适用于 OpenWrt 路由器 Version: Latest Stable | For OpenWrt routers
🔒 安全提示:Safety Notice: 请务必通过官方 GitHub 发布页或 App Store 下载客户端,下载后请核对 SHA256 校验值以确保文件完整性。 Always download from the official GitHub releases page or App Store. Verify the SHA256 checksum after downloading to ensure file integrity.

加入 Clash 开源生态 Join the Clash Open Source Ecosystem

Clash 遵循 GPL-3.0 开源许可,欢迎全球开发者与用户参与贡献、分享配置、共建生态。 Clash is licensed under GPL-3.0. Developers and users worldwide are welcome to contribute, share configurations, and build the ecosystem together.

关于 Clash 的常见疑问 Frequently Asked Questions About Clash

以下整理了用户最常咨询的六个类别问题,每个回答分为清晰步骤帮助您快速理解。 Below are six categories of the most commonly asked questions, each answered in clear steps to help you understand quickly.

❶ 什么是 Clash?它的核心工作原理是什么? ❶ What is Clash? How does it work at its core?
  1. 定义定位:Clash 是一款开源的、基于规则的跨平台网络代理工具,运行于网络层与应用层之间,帮助用户灵活管理网络流量走向。它不同于传统 VPN 的全局接管模式,而是采用精细化规则匹配来决定哪些流量走代理、哪些直连。
  2. Definition: Clash is an open-source, rule-based, cross-platform network proxy tool that operates between the network and application layers. Unlike traditional VPNs that take over all traffic, Clash uses fine-grained rule matching to determine which traffic goes through a proxy and which connects directly.
  3. 核心机制:Clash 的核心是"规则引擎"——用户定义一组匹配规则(基于域名、IP 段、进程名等),当网络请求发起时,Clash 按优先级逐一匹配规则,将流量分发到对应的出站代理或直连通道。
  4. Core Mechanism: At its heart lies a rule engine — users define matching rules (by domain, IP range, process name, etc.). When a network request is initiated, Clash matches it against rules in priority order, directing traffic to the appropriate outbound proxy or direct connection.
  5. 架构分层:Clash 的架构分为入站层(接收流量)、规则匹配层(决策路由)和出站层(发送流量)。入站支持 HTTP/SOCKS5/TUN 等多种方式,出站兼容 Shadowsocks、VMess、Trojan 等主流代理协议。
  6. Architecture Layers: Clash's architecture consists of an inbound layer (receiving traffic), a rule-matching layer (routing decisions), and an outbound layer (sending traffic). Inbound supports HTTP, SOCKS5, and TUN modes, while outbound is compatible with Shadowsocks, VMess, Trojan, and other major protocols.
  7. 适用场景:无论您是希望突破地域限制访问内容、保护上网隐私、优化跨境网络延迟,还是管理多节点负载均衡,Clash 都能通过灵活的配置满足需求,适用于个人用户到企业级网络管理。
  8. Use Cases: Whether you want to bypass geo-restrictions, protect browsing privacy, optimize cross-border latency, or manage multi-node load balancing, Clash meets these needs through flexible configuration — suitable for individual users to enterprise-level network management.
  9. 开源生态:Clash 采用 GPL-3.0 开源许可证,拥有活跃的全球开发者社区。内核由 Dreamacro 维护,各平台有对应的图形化客户端,形成了完整的产品矩阵。
  10. Open Source Ecosystem: Clash uses the GPL-3.0 license and has an active global developer community. The core is maintained by Dreamacro, with graphical clients available for each platform, forming a complete product matrix.
  11. 版本说明:Clash 提供社区版(开源免费)和 Premium 版(含 TUN 设备、远程 Providers 等高级功能),用户可根据需求选择合适版本,社区版已能满足绝大多数日常使用场景。
  12. Version Notes: Clash offers a Community edition (open-source & free) and a Premium edition (with advanced features like TUN device and remote Providers). The Community edition already covers most daily use scenarios.
❷ Clash 支持哪些代理协议?入站和出站有何区别? ❷ What proxy protocols does Clash support? What's the difference between inbound and outbound?
  1. 入站协议概览:入站指 Clash 如何接收来自您设备上应用程序的流量。支持 HTTP 代理、HTTPS 代理、SOCKS5 服务端以及 TUN 虚拟网卡模式(Premium),覆盖了浏览器、系统代理和全局抓取等多种接入方式。
  2. Inbound Overview: Inbound refers to how Clash receives traffic from applications on your device. It supports HTTP proxy, HTTPS proxy, SOCKS5 server, and TUN virtual NIC mode (Premium), covering browser, system proxy, and global traffic capture methods.
  3. 出站协议概览:出站指 Clash 将流量转发到目标代理服务器所使用的协议。Clash 兼容 Shadowsocks、ShadowsocksR、VMess、Trojan、Snell、SOCKS5、HTTP(S) 以及 WireGuard(Premium),几乎覆盖了市面上所有主流代理协议。
  4. Outbound Overview: Outbound refers to the protocol Clash uses to forward traffic to the target proxy server. Clash is compatible with Shadowsocks, ShadowsocksR, VMess, Trojan, Snell, SOCKS5, HTTP(S), and WireGuard (Premium), covering nearly all major proxy protocols available.
  5. 入站与出站的关系:简单来说,入站是"入口",决定流量如何进入 Clash 系统;出站是"出口",决定流量以何种加密方式发送到远端服务器。两者通过中间的规则引擎协同工作,实现端到端的代理链路。
  6. Inbound vs Outbound: Simply put, inbound is the "entry" — how traffic enters the Clash system; outbound is the "exit" — how encrypted traffic is sent to the remote server. Both work together through the rule engine to form an end-to-end proxy chain.
  7. 协议选择建议:对于普通用户,建议优先使用 Shadowsocks 或 VMess 协议(均衡稳定);追求极致性能可选 Snell 或 WireGuard;需要伪装抗审查可选 Trojan。Clash 支持同时配置多个出站节点并自动切换。
  8. Protocol Selection Tips: For general users, Shadowsocks or VMess are recommended (balanced and stable); for maximum performance, consider Snell or WireGuard; for obfuscation and anti-censorship, Trojan is preferred. Clash supports multiple outbound nodes with automatic failover.
  9. 协议兼容性矩阵:不同客户端对协议的支持略有差异,例如 Clash for Windows 全协议支持,而 iOS 端的 Stash 则聚焦于主流协议。建议查阅各客户端文档确认具体支持的协议列表。
  10. Compatibility Matrix: Protocol support varies slightly between clients — Clash for Windows supports all protocols, while Stash on iOS focuses on mainstream ones. Check each client's documentation for the specific supported protocol list.
  11. 安全提醒:无论选择何种协议,请确保使用强密码和最新加密算法,定期更新客户端版本以获取安全补丁,避免使用来源不明的免费节点。
  12. Security Reminder: Regardless of the protocol chosen, always use strong passwords and the latest encryption algorithms, regularly update client versions for security patches, and avoid using free nodes from untrusted sources.
❸ 如何为不同操作系统选择并安装合适的 Clash 客户端? ❸ How to choose and install the right Clash client for different operating systems?
  1. Windows 用户:推荐使用 Clash for Windows(Premium),提供友好的图形界面和系统托盘管理。访问 GitHub Releases 页面下载最新版安装包,安装后导入配置文件即可开始使用,支持一键开启/关闭代理。
  2. Windows Users: Clash for Windows (Premium) is recommended, offering a user-friendly GUI and system tray management. Download the latest installer from the GitHub Releases page, import your configuration file, and you're ready to go with one-click proxy toggling.
  3. macOS 用户:可选择 ClashX Pro(功能全面)或 Stash for macOS(界面精美)。两者均在 GitHub 上提供下载,安装后会在菜单栏显示图标,支持快捷切换代理模式和策略组。
  4. macOS Users: Choose between ClashX Pro (feature-rich) or Stash for macOS (polished UI). Both are available on GitHub, and after installation, a menu bar icon provides quick access to proxy mode and policy group switching.
  5. Linux 用户:推荐使用 Clash 命令行版本,轻量高效。可通过包管理器或直接下载二进制文件安装,配合 systemd 服务实现开机自启和后台运行,适合服务器和高级用户。
  6. Linux Users: The Clash CLI version is recommended — lightweight and efficient. Install via package manager or download the binary directly, and set up a systemd service for auto-start and background operation — ideal for servers and advanced users.
  7. iOS 用户:在 App Store 中搜索并下载 Stash,这是 Clash 生态在 iOS 平台的主要客户端。安装后通过导入配置文件或订阅链接即可配置,支持与系统代理设置无缝集成。
  8. iOS Users: Search for and download Stash from the App Store — the primary Clash ecosystem client for iOS. After installation, import a configuration file or subscription link to set up, with seamless integration into system proxy settings.
  9. Android 用户:推荐 Clash for Android(Premium),提供 Material Design 风格界面。下载 APK 安装后,可通过二维码扫描、URL 订阅或手动编辑来添加配置,支持分应用代理和网络规则定制。
  10. Android Users: Clash for Android (Premium) is recommended, featuring a Material Design interface. After installing the APK, add configurations via QR code scanning, URL subscription, or manual editing — with per-app proxy and custom network rules support.
  11. OpenWrt 路由器用户:使用 OpenClash 插件,可在路由器层面实现全家设备的透明代理。通过 OpenWrt 软件包管理器安装,配置后所有连接该路由器的设备自动获得代理能力,无需逐个设备安装客户端。
  12. OpenWrt Router Users: Use the OpenClash plugin for router-level transparent proxy covering all home devices. Install via the OpenWrt package manager, and once configured, all devices connected to the router automatically gain proxy capabilities without individual client installation.
❹ Clash 的规则路由系统如何实现智能流量分流? ❹ How does Clash's rule-based routing system achieve intelligent traffic splitting?
  1. 规则引擎基础:Clash 的规则路由系统是其最核心的功能。用户通过编写规则配置文件,定义一组"匹配条件 → 执行动作"的映射关系,Clash 按从上到下的顺序逐条匹配每条网络请求。
  2. Rule Engine Basics: Clash's rule-based routing system is its most essential feature. Users write rule configuration files defining "match condition → action" mappings, and Clash matches each network request against these rules from top to bottom.
  3. 匹配维度丰富:规则支持多种匹配维度,包括域名(DOMAIN)、域名关键词(DOMAIN-KEYWORD)、域名后缀(DOMAIN-SUFFIX)、IP 地址段(IP-CIDR)、进程名称(PROCESS-NAME)以及 GeoIP 地理位置数据库匹配,几乎可以覆盖所有分流场景。
  4. Rich Matching Dimensions: Rules support multiple matching dimensions including exact domain (DOMAIN), domain keywords (DOMAIN-KEYWORD), domain suffixes (DOMAIN-SUFFIX), IP CIDR ranges (IP-CIDR), process names (PROCESS-NAME), and GeoIP geolocation database matching — covering nearly all traffic splitting scenarios.
  5. 策略组联动:规则匹配后的目标可以是具体的出站节点,也可以是策略组(Proxy Group)。策略组支持自动故障转移(fallback)、基于延迟的自动选择(url-test)和负载均衡(load-balance)三种模式,实现智能节点切换。
  6. Policy Group Integration: The target of a matched rule can be a specific outbound node or a Proxy Group. Policy Groups support three modes — automatic failover (fallback), latency-based auto-selection (url-test), and load balancing (load-balance) — enabling intelligent node switching.
  7. 常见分流策略:典型配置包括:国内网站直连(DIRECT)、海外网站走代理(PROXY)、广告域名屏蔽(REJECT)、以及针对特定应用(如游戏、视频)使用低延迟节点。这种精细化控制远超传统 VPN 的全局代理模式。
  8. Common Splitting Strategies: Typical configurations include direct connection for domestic sites (DIRECT), proxy for overseas sites (PROXY), ad domain blocking (REJECT), and low-latency nodes for specific apps like games or video streaming. This fine-grained control far exceeds traditional VPN global proxy modes.
  9. 规则更新与维护:Clash 支持通过远程 URL 动态更新规则集,社区维护了大量现成的规则模板(如 ACL4SSR、Loyalsoldier 等),用户可直接引用而无需从零编写,大幅降低配置门槛。
  10. Rule Updates & Maintenance: Clash supports dynamic rule set updates via remote URLs. The community maintains numerous ready-to-use rule templates (e.g., ACL4SSR, Loyalsoldier), which users can directly reference without writing rules from scratch, significantly lowering the configuration barrier.
  11. 调试与验证:Clash 提供日志面板和 API 接口,用户可以实时查看每条请求匹配了哪条规则、走了哪个节点,方便调试配置问题。结合 Fake-IP DNS 模式,还能进一步提升规则匹配的准确性和速度。
  12. Debugging & Verification: Clash provides a log panel and API for real-time visibility into which rule matched each request and which node was used, making configuration debugging straightforward. Combined with Fake-IP DNS mode, rule matching accuracy and speed are further enhanced.
❺ Clash Premium 版本提供哪些额外功能?值得升级吗? ❺ What additional features does Clash Premium offer? Is it worth upgrading?
  1. TUN 模式:Premium 版本支持创建虚拟 TUN 网卡,实现真正的全局透明代理。这意味着所有网络流量(包括不支持代理设置的应用程序)都能被 Clash 接管,无需逐应用配置代理,是目前最强大的流量捕获方式。
  2. TUN Mode: Premium supports creating a virtual TUN network interface for true global transparent proxy. This means all network traffic — including from applications that don't support proxy settings — can be handled by Clash without per-app configuration, making it the most powerful traffic capture method available.
  3. 远程 Providers:支持动态加载远程代理列表(Proxy Providers)和远程规则集(Rule Providers),当节点信息或分流规则发生变化时无需重启 Clash,系统自动拉取更新,特别适合管理大量节点的场景。
  4. Remote Providers: Supports dynamically loading remote proxy lists (Proxy Providers) and remote rule sets (Rule Providers). When node information or routing rules change, there's no need to restart Clash — the system automatically pulls updates, ideal for managing large numbers of nodes.
  5. 性能增强:Premium 内核在连接处理、内存管理和 DNS 解析方面进行了深度优化,支持更高的并发连接数和更低的资源占用,在资源受限的设备(如路由器)上表现尤为突出。
  6. Performance Enhancements: The Premium kernel features deep optimizations in connection handling, memory management, and DNS resolution, supporting higher concurrent connections with lower resource usage — particularly beneficial on resource-constrained devices like routers.
  7. Script 脚本支持:Premium 允许用户编写 Lua 脚本实现自定义路由逻辑,例如根据请求的特定 Header 字段动态选择代理节点,为高级用户提供了极大的灵活性,适合有编程能力的用户深度定制。
  8. Script Support: Premium allows users to write Lua scripts for custom routing logic — for example, dynamically selecting proxy nodes based on specific request headers. This provides advanced users with tremendous flexibility for deep customization.
  9. WireGuard 出站:Premium 版本原生支持 WireGuard 协议作为出站方式。WireGuard 以其极简代码、高速传输和现代加密算法著称,在延迟和吞吐量方面表现优异,适合对网络性能有极致要求的用户。
  10. WireGuard Outbound: Premium natively supports the WireGuard protocol as an outbound option. WireGuard is known for its minimal codebase, high-speed transmission, and modern cryptography, delivering excellent latency and throughput — perfect for users with extreme performance requirements.
  11. 升级建议:对于普通用户,社区版已足够满足日常需求。如果您需要 TUN 全局代理、管理大量动态节点、或对网络性能有极致追求,Premium 版本提供的额外功能将显著提升使用体验。建议先使用社区版,按需升级。
  12. Upgrade Advice: For most users, the Community edition is sufficient. If you need TUN global proxy, manage many dynamic nodes, or demand maximum network performance, Premium's additional features will significantly enhance your experience. Start with the Community edition and upgrade as needed.
❻ 如何安全地参与 Clash 开源社区贡献代码或文档? ❻ How to safely contribute code or documentation to the Clash open-source community?
  1. 了解项目结构:首先访问 Clash 在 GitHub 上的主仓库(Dreamacro/clash),仔细阅读 README、CONTRIBUTING 指南和 Code of Conduct 行为准则。了解项目的技术栈(Go 语言)、架构设计和 Issue 提交规范,这是参与贡献的基础。
  2. Understand Project Structure: First, visit Clash's main repository on GitHub (Dreamacro/clash) and carefully read the README, CONTRIBUTING guide, and Code of Conduct. Understand the tech stack (Go language), architecture design, and Issue submission standards — this is the foundation for contributing.
  3. 选择贡献方向:贡献不限于代码——您可以帮助改进文档、翻译内容、报告 Bug、提交功能建议、参与社区讨论或在社交媒体上推广 Clash。对于初次贡献者,建议从文档改进或标记为"good first issue"的简单任务开始。
  4. Choose Contribution Direction: Contributions aren't limited to code — you can help improve documentation, translate content, report bugs, submit feature suggestions, participate in community discussions, or promote Clash on social media. For first-time contributors, start with documentation improvements or tasks labeled "good first issue."
  5. Fork 与分支管理:在 GitHub 上 Fork 主仓库到个人账户,然后 Clone 到本地进行开发。创建功能分支(如 feature/xxx 或 fix/xxx),保持每个分支专注单一改动,避免在一个 PR 中混合多个不相关的修改。
  6. Fork & Branch Management: Fork the main repository to your personal GitHub account, then clone it locally for development. Create feature branches (e.g., feature/xxx or fix/xxx), keeping each branch focused on a single change — avoid mixing unrelated modifications in one PR.
  7. 遵守编码规范:提交代码前,确保通过项目的自动化测试和代码风格检查(golangci-lint 等)。编写清晰的 commit message,遵循 Conventional Commits 格式。对于新功能,同步更新相关文档和测试用例。
  8. Follow Coding Standards: Before submitting code, ensure it passes automated tests and code style checks (golangci-lint, etc.). Write clear commit messages following the Conventional Commits format. For new features, update relevant documentation and test cases accordingly.
  9. 提交 Pull Request:完成开发后,向主仓库提交 PR。在 PR 描述中清晰说明改动目的、实现方式和测试情况。关联相关的 Issue(如 Fixes #123)。耐心等待维护者审核,积极响应反馈意见并进行修改。
  10. Submit Pull Request: After completing development, submit a PR to the main repository. Clearly explain the purpose, implementation approach, and testing in the PR description. Link related Issues (e.g., Fixes #123). Wait patiently for maintainer review and respond actively to feedback.
  11. 安全注意事项:切勿在提交的代码或 Issue 中包含个人代理节点信息、密码、API 密钥等敏感数据。所有贡献均在 GPL-3.0 许可下公开,请确保您拥有所贡献代码的完整版权,并遵守开源许可协议的要求。
  12. Security Precautions: Never include sensitive data such as personal proxy node information, passwords, or API keys in submitted code or Issues. All contributions are public under the GPL-3.0 license — ensure you have full copyright over contributed code and comply with open-source license requirements.