🆓 开源免费 · GPL-3.0 协议 🆓 Open Source · GPL-3.0 Licensed

Clash — 基于规则的跨平台网络代理工具 Clash — Rule-Based Cross-Platform Proxy Tool

支持多协议、智能分流,为你的网络体验提供精细化控制。覆盖 Windows、macOS、Linux、Android、iOS 全平台,代码开源可审计,数据完全本地化存储。 Multi-protocol support with intelligent traffic routing for fine-grained network control. Available on Windows, macOS, Linux, Android & iOS. Fully open-source with auditable code and local-only data storage.

68K+ GitHub Stars
GPL-3.0 开源协议 License
6 支持平台 Platforms
15+ 支持协议 Protocols

为什么选择 Clash? Why Choose Clash?

Clash 以规则分流为核心,提供强大的网络流量管理能力,兼顾性能与安全。 Clash delivers powerful network traffic management with rule-based routing, balancing performance and security.

🔌

多协议兼容 Multi-Protocol Support

支持 Shadowsocks(R)、VMess、Trojan、Snell、SOCKS5、HTTP(S)、Wireguard 等主流协议,轻松应对各类网络环境。 Supports Shadowsocks(R), VMess, Trojan, Snell, SOCKS5, HTTP(S), Wireguard and more for diverse network environments.

🧠

智能规则路由 Smart Rule Routing

基于域名、IP、进程名称等动态脚本规则进行精准流量分流,自动选择最优线路。 Precise traffic routing based on domain, IP, process name with dynamic script rules for optimal path selection.

💻

全平台覆盖 Cross-Platform

覆盖 Windows、macOS、Linux、Android、iOS 全部主流操作系统,一个配置多端使用。 Available on Windows, macOS, Linux, Android & iOS — one configuration works across all your devices.

⚙️

策略组管理 Proxy Groups

支持自动故障转移、负载均衡和延迟测试,确保连接始终稳定高效。 Automatic failover, load balancing and latency testing ensure stable and efficient connections at all times.

🔒

开源安全 Open Source & Secure

GPL-3.0 开源协议,代码完全公开可审计,数据本地化存储,无任何云端依赖。 GPL-3.0 licensed with fully auditable source code. All data stored locally with zero cloud dependencies.

🚀

Fake-IP DNS Fake-IP DNS Premium

有效减少 DNS 污染影响,显著提升网络性能与响应速度,降低延迟。 Effectively reduces DNS pollution impact, significantly improving network performance and reducing latency.

下载适合你设备的客户端 Download for Your Device

请优先从官方渠道下载,确保安全。每个版本均提供 SHA256 校验信息以供验证。 Always download from official sources. SHA256 checksums provided for verification.

🪟

Clash for Windows

v0.20.39 推荐 · 官方版 Recommended · Official ⬇ 官方下载 ⬇ Download SHA256: 点击查看校验
🍎

ClashX Pro

v1.123.0 Premium ⬇ 官方下载 ⬇ Download SHA256: 点击查看校验
📱

Clash for Android

v2.5.12 Premium ⬇ 官方下载 ⬇ Download
📱

Stash / Shadowrocket

iOS 替代方案 App Store 获取 App Store 📖 查看详情 📖 Details
🐧

Clash 内核 / OpenClash

Latest Release 命令行 · OpenWrt CLI · OpenWrt ⬇ GitHub Release ⬇ GitHub Release

快速上手,仅需三步 Get Started in 3 Steps

无需复杂配置,跟随以下步骤即可快速开启安全、智能的网络代理体验。 No complex setup needed. Follow these steps for a secure, intelligent proxy experience.

1

下载安装 Download & Install

选择对应系统版本下载并安装客户端。优先使用上述官方可信来源,避免从不明第三方下载。 Select your platform version and install. Always use official trusted sources listed above.

查看下载 → View Downloads →
2

导入配置 Import Config

通过订阅链接或本地 YAML 文件导入配置,按需启用规则集与策略组,灵活管理流量。 Import config via subscription link or local YAML file. Enable rule sets and proxy groups as needed.

配置指南 → Config Guide →
3

启用代理 Enable Proxy

开启系统代理或服务模式,验证分流是否生效,即可享受智能网络代理体验。 Turn on system proxy or service mode, verify routing works, and enjoy intelligent network proxying.

常见问题 → FAQ →

广泛兼容主流代理协议 Broad Protocol Compatibility

入站与出站连接均支持多种协议,满足不同场景需求。标注 Premium 的功能为高级版专属。 Both inbound and outbound connections support multiple protocols. Premium features are marked accordingly.

HTTP HTTPS SOCKS5 TUN 设备
Shadowsocks ShadowsocksR VMess Trojan Snell SOCKS5 HTTP(S) Wireguard

你可能有以下疑问 Frequently Asked Questions

我们整理了用户最常遇到的6个问题,每个解答均提供详细的分步指导。 We've compiled the 6 most common questions with detailed step-by-step guidance for each.

🔰 Clash 是什么?适合哪些用户使用? 🔰 What is Clash and who is it for?

Clash 是一款基于规则的跨平台网络代理工具,以下分4步详细解答:

  1. 理解Clash的本质:Clash 是一个在网络层和应用层运行的代理工具,它通过解析用户自定义的YAML配置文件来执行流量分流策略。与传统的VPN将所有流量全部转发不同,Clash可以根据预先设定的规则精确控制哪些流量走代理、哪些流量直连,从而实现智能化的网络管理。它本身不提供代理服务,而是作为一个客户端来连接用户已有的代理服务器,支持Shadowsocks、VMess、Trojan等多种主流协议。
  2. 适合新手用户:对于首次接触代理工具的用户,Clash提供了相对友好的图形化客户端界面,用户只需导入订阅链接即可自动完成大部分配置。新手用户可以通过Clash快速实现基本的网络代理需求,无需深入了解底层技术细节,大大降低了使用门槛。
  3. 适合进阶用户:对于有一定技术基础的用户,Clash提供了强大的自定义规则系统和策略组管理功能。用户可以编写精细的YAML配置文件,实现基于域名、IP地址段、进程名称等多维度条件的流量分流,甚至可以结合脚本实现动态规则更新和自动化运维。
  4. 适合开发者和开源贡献者:Clash采用GPL-3.0开源协议,全部源代码托管在GitHub上,开发者可以自由审查代码安全性、提交功能改进或基于Clash内核开发自己的客户端应用。其丰富的API接口也为二次开发和集成提供了便利条件。

Clash is a rule-based cross-platform proxy tool. Here's a detailed 4-step explanation:

  1. Understanding Clash's Core: Clash operates at the network and application layers, using YAML configuration files to execute traffic routing strategies. Unlike traditional VPNs that route all traffic through a single tunnel, Clash intelligently decides which traffic should go through proxies and which should connect directly based on predefined rules. It acts as a client connecting to your existing proxy servers, supporting protocols like Shadowsocks, VMess, and Trojan.
  2. For Beginners: Clash offers user-friendly graphical interfaces where beginners can simply import a subscription link to get started. The automatic configuration process removes the complexity of manual setup, making it accessible even for users with limited technical knowledge.
  3. For Advanced Users: Power users can leverage Clash's sophisticated rule system and proxy group management. By writing detailed YAML configurations, they can implement multi-dimensional traffic routing based on domain names, IP ranges, and process names, even incorporating dynamic scripts for automated rule updates.
  4. For Developers & Contributors: Licensed under GPL-3.0 with all source code publicly available on GitHub, developers can audit the code, contribute improvements, or build custom clients based on the Clash kernel. Its comprehensive API also facilitates third-party integrations.
📥 如何下载安装并完成初始配置? 📥 How to download, install and set up Clash?

安装和初始配置是使用Clash的第一步,请按照以下5个步骤操作:

  1. 确认操作系统与选择客户端:首先确定你使用的设备操作系统类型。Windows用户推荐使用Clash for Windows,macOS用户可选择ClashX或ClashX Pro,Android用户使用Clash for Android,iOS用户由于没有官方客户端,推荐使用Stash或Shadowrocket作为替代方案,Linux/OpenWrt用户可直接使用Clash内核或OpenClash插件。
  2. 从官方渠道下载安装包:务必从GitHub官方仓库或本网站提供的链接下载对应平台的安装包。下载完成后,Windows用户运行.exe安装程序并按向导完成安装,macOS用户将.app文件拖入应用程序文件夹,Android用户安装APK文件并授予必要权限,Linux用户通过命令行或包管理器进行安装部署。
  3. 获取有效的配置文件或订阅链接:Clash本身不提供代理服务,你需要从服务提供商处获取配置文件(通常为YAML格式)或订阅链接。订阅链接是一个URL地址,Clash客户端可以通过该地址自动下载并更新代理节点信息和规则配置,这是最为便捷的配置方式。
  4. 在客户端中导入配置:打开Clash客户端,找到配置导入入口(通常在设置页面或主界面的配置管理区域)。选择通过URL订阅方式导入,将订阅链接粘贴到输入框中并确认下载;或者选择本地文件导入方式,选择已下载的YAML配置文件进行加载。
  5. 验证配置并首次连接:配置导入成功后,检查客户端是否正确显示了代理节点列表和策略组信息。在代理节点列表中选择一个可用的节点,然后开启系统代理开关。访问一个被规则覆盖的网站来验证代理是否正常工作,如果页面能正常加载则说明配置成功。

Follow these 5 steps to install and configure Clash:

  1. Identify Your OS and Choose a Client: Determine your operating system. Windows users should choose Clash for Windows, macOS users can pick ClashX or ClashX Pro, Android users use Clash for Android. iOS users should consider Stash or Shadowrocket as alternatives since there's no official iOS client. Linux/OpenWrt users can use the Clash kernel directly or install OpenClash.
  2. Download from Official Sources: Always download installation packages from official GitHub repositories or the links provided on this website. Run the installer for Windows, drag the .app file to Applications on macOS, install the APK on Android with necessary permissions, or use command-line package managers on Linux.
  3. Obtain a Valid Configuration File or Subscription Link: Clash doesn't provide proxy services itself. You need to obtain a configuration file (usually YAML format) or a subscription link from your service provider. The subscription link allows Clash to automatically download and update proxy node information.
  4. Import the Configuration: Open your Clash client and find the configuration import section. Paste your subscription link for URL-based import, or select a local YAML file for manual import. Wait for the client to download and parse the configuration data.
  5. Verify and Connect: After successful import, check that proxy nodes and strategy groups are displayed correctly. Select an available node, enable the system proxy switch, and visit a website to verify the proxy is working properly.
🔗 如何获取订阅链接并导入到客户端? 🔗 How to get and import subscription links?

订阅链接是Clash最便捷的配置方式,以下是详细的6步操作指南:

  1. 从服务提供商获取订阅链接:订阅链接通常由你的代理服务提供商在用户后台面板中提供,一般是一个以http或https开头的URL地址。请确保从可信的提供商处获取,避免使用来源不明的订阅链接以防止安全风险。部分提供商可能提供多个订阅链接对应不同的节点组合,你可以根据需要选择最合适的一个。
  2. 复制订阅链接到剪贴板:在服务提供商的网站或应用中,找到订阅链接区域并点击复制按钮,或手动选中完整URL进行复制。务必确保复制的是完整的链接地址,不要遗漏任何字符,否则可能导致导入失败或配置不完整。
  3. 打开Clash客户端并进入配置管理:启动你已安装的Clash客户端,在主界面中找到配置(Config)或订阅(Subscription)相关的入口。不同客户端界面略有差异,但通常都会在设置菜单或侧边栏中提供配置管理功能。
  4. 选择URL订阅导入方式:在配置管理页面中,选择通过URL订阅方式添加配置。将之前复制的订阅链接粘贴到URL输入框中,部分客户端还允许你为这个订阅设置一个自定义名称以便于识别和管理多个订阅源。
  5. 点击下载并等待同步完成:确认链接无误后,点击下载或同步按钮。客户端会自动向订阅链接发送请求,下载最新的节点信息和规则配置。下载过程通常只需几秒钟,完成后客户端界面会刷新并显示新导入的代理节点列表和相关策略组。
  6. 设置自动更新频率并验证:建议在客户端设置中开启订阅自动更新功能,并设置合理的更新间隔(如每12小时或每天更新一次),以确保节点信息始终保持最新。更新完成后,手动切换几个节点测试连接是否正常,确认分流规则是否按预期工作。

Subscription links are the most convenient way to configure Clash. Here's a 6-step guide:

  1. Get the Subscription Link from Your Provider: Your proxy service provider typically offers a subscription link in their user dashboard, usually a URL starting with http or https. Always use trusted providers and avoid unknown sources for security. Some providers offer multiple links for different node combinations.
  2. Copy the Link to Your Clipboard: Find the subscription link area on your provider's website and click the copy button, or manually select and copy the full URL. Ensure you copy the complete link without missing any characters.
  3. Open Clash Client and Navigate to Config Management: Launch your Clash client and find the Config or Subscription section, usually located in the settings menu or sidebar.
  4. Choose URL Subscription Import: Select the URL subscription import option and paste your copied link into the URL input field. Some clients also allow you to set a custom name for easier identification of multiple subscriptions.
  5. Download and Wait for Sync: Click the download or sync button. The client will automatically fetch the latest node information and rule configurations. This usually takes just a few seconds.
  6. Set Auto-Update and Verify: Enable automatic subscription updates in client settings with a reasonable interval (e.g., every 12 hours). After updating, manually test several nodes to verify connectivity and rule functionality.
🧭 策略组和规则系统如何工作? 🧭 How do proxy groups and rule systems work?

策略组和规则系统是Clash的核心功能,以下分5步详细解释其工作机制:

  1. 理解规则(Rules)的作用:规则是Clash进行流量分流的判断依据,每条规则由匹配条件和执行动作组成。匹配条件可以是域名关键字、完整域名、IP地址段、进程名称等,执行动作则决定匹配到的流量是直连、走代理还是被拒绝。规则按照配置文件中定义的顺序从上到下依次匹配,一旦某条规则命中,后续规则将不再被检查。
  2. 理解策略组(Proxy Groups)的概念:策略组是将多个代理节点组织在一起并进行统一管理的逻辑分组。每个策略组可以包含多个代理节点,并设定一个选择策略来决定实际使用哪个节点。常见的策略类型包括手动选择、自动故障转移和负载均衡等,用户可以根据不同用途创建多个策略组。
  3. 手动选择策略组的使用:这是最基础的策略组类型,用户可以在客户端界面中手动从组内节点列表里挑选一个作为当前使用的代理。这种方式给予用户最大的控制权,适合需要根据实时网络状况灵活切换节点的场景,比如在不同国家节点之间手动选择以获得最佳访问速度。
  4. 自动故障转移策略组:该策略会按照用户设定的顺序自动测试组内节点的可用性,优先使用排在前面的节点。如果当前节点出现连接失败或延迟过高的情况,系统会自动切换到下一个可用节点,确保连接不会中断。这种策略非常适合对稳定性要求较高的场景。
  5. 负载均衡策略组与规则协同:负载均衡策略会将流量分散到组内的多个节点上,避免单一节点负载过重。结合规则系统,用户可以为不同类型的流量指定不同的策略组——例如视频流量使用高带宽节点组成的负载均衡组,网页浏览使用低延迟节点组,从而实现精细化的网络流量管理。

Proxy groups and rule systems are Clash's core features. Here's a 5-step explanation:

  1. Understanding Rules: Rules are the criteria Clash uses for traffic routing. Each rule consists of a matching condition and an action. Conditions can include domain keywords, full domains, IP ranges, or process names. Actions determine whether matched traffic goes direct, through a proxy, or gets rejected. Rules are evaluated top-to-bottom in order.
  2. Understanding Proxy Groups: A proxy group organizes multiple proxy nodes into a logical unit with a selection strategy. Common strategies include manual selection, automatic failover, and load balancing. Users can create multiple groups for different purposes.
  3. Manual Selection Groups: The most basic type where users manually pick which node to use from the group's list. This gives maximum control, ideal for scenarios where you want to switch between nodes based on real-time network conditions.
  4. Automatic Failover Groups: This strategy automatically tests node availability in a user-defined order. If the current node fails or has high latency, the system switches to the next available node, ensuring uninterrupted connectivity.
  5. Load Balancing Groups with Rules: Load balancing distributes traffic across multiple nodes. Combined with the rule system, users can assign different traffic types to different groups for fine-grained network management.
🔒 使用Clash时如何确保安全和隐私? 🔒 How to ensure security and privacy with Clash?

安全与隐私是使用代理工具时最重要的考量,请遵循以下6个步骤来确保安全:

  1. 始终从官方渠道下载客户端:下载Clash客户端时务必认准GitHub官方仓库或本网站提供的链接,避免从任何非官方第三方网站下载安装包。非官方渠道的安装包可能被植入恶意代码或后门程序,对你的设备安全构成严重威胁。每次下载后建议核对文件的SHA256校验值是否与官方公布的一致。
  2. 使用可信的代理服务提供商:Clash本身不提供代理服务,你需要选择一家信誉良好的服务提供商。在选择时应注意提供商是否有清晰的隐私政策、是否承诺不记录用户活动日志、服务器的法律管辖区域等因素,这些直接关系到你的网络隐私能否得到有效保护。
  3. 定期更新客户端和配置文件:保持Clash客户端为最新版本可以及时修复已知的安全漏洞。同时,开启订阅自动更新功能确保节点信息和规则配置始终处于最新状态,过期的节点可能存在安全隐患或已被服务提供商弃用。
  4. 仔细审查YAML配置文件内容:如果你使用本地YAML配置文件而非订阅链接,请仔细检查文件内容,确保没有包含任何可疑的远程脚本调用或不明的外部资源引用。配置文件的规则部分应当清晰可读,任何你不理解的配置项都应先查证再使用。
  5. 理解数据本地化存储的意义:Clash的所有配置数据和运行日志默认存储在本地设备上,不会上传到任何云端服务器。这意味着你的代理节点信息、浏览习惯和网络活动记录都不会被Clash本身收集或分享,这是Clash相比一些商业VPN产品的重要隐私优势。
  6. 结合其他安全措施使用:代理工具只是网络安全体系中的一环,建议同时使用防火墙、杀毒软件等其他安全工具。对于高度敏感的网络活动,还应考虑使用端到端加密通信工具,并避免在代理连接下登录涉及个人身份信息的敏感账户。

Security and privacy are paramount. Follow these 6 steps for safe usage:

  1. Always Download from Official Sources: Only download Clash clients from official GitHub repositories or links on this website. Avoid third-party sites that may distribute tampered installers with malware or backdoors. Verify SHA256 checksums after downloading.
  2. Use Trusted Proxy Service Providers: Choose reputable providers with clear privacy policies, no-logging commitments, and transparent server jurisdiction information. These factors directly impact your privacy protection.
  3. Regularly Update Client and Configurations: Keep your Clash client updated to the latest version to patch security vulnerabilities. Enable automatic subscription updates to ensure node information stays current.
  4. Carefully Review YAML Configuration Files: If using local YAML files, inspect them for suspicious remote script calls or unknown external references. Every configuration item should be understood before use.
  5. Understand Local-Only Data Storage: All Clash configuration data and logs are stored locally on your device by default. No data is uploaded to cloud servers, meaning your proxy node information and browsing habits are never collected or shared by Clash itself.
  6. Combine with Other Security Measures: Proxy tools are just one component of network security. Use firewalls and antivirus software alongside Clash. For highly sensitive activities, consider end-to-end encrypted communication tools.
🛠 常见连接问题如何排查和解决? 🛠 How to troubleshoot common connection issues?

遇到连接问题是使用代理工具时的常见情况,以下是系统性的6步排查流程:

  1. 检查基础网络连接:首先确认你的设备本身能够正常访问互联网。关闭Clash代理后,尝试访问一个国内常用网站来验证基础网络是否通畅。如果基础网络本身就存在问题,那么代理工具也无法正常工作,此时需要先解决网络连接的基本问题,比如检查WiFi连接、路由器状态或联系网络服务提供商。
  2. 确认代理节点是否有效:在Clash客户端中查看当前选中节点的状态信息,注意延迟测试结果是否正常。如果延迟显示超时或数值异常高,说明该节点可能已失效或网络路径存在问题。尝试切换到同一策略组中的其他节点,或者使用客户端的延迟测试功能对全部节点进行测速,选择响应最快的节点。
  3. 验证系统代理设置是否正确开启:检查Clash客户端的系统代理开关是否处于开启状态,部分客户端还提供了代理模式选择(如全局模式、规则模式、直连模式),确保当前处于规则模式或全局模式下。同时检查操作系统的网络设置中代理配置是否被Clash正确设置,有时其他软件可能会冲突性地修改代理设置。
  4. 排查DNS相关的问题:DNS解析失败是导致连接问题的常见原因之一。如果你使用的是Premium版本并开启了Fake-IP DNS功能,尝试暂时关闭该功能看是否恢复正常。也可以尝试在配置文件中指定使用公共DNS服务器(如8.8.8.8或1.1.1.1)来排除DNS污染导致的域名解析异常。
  5. 检查防火墙和安全软件的干扰:某些防火墙或安全软件可能会拦截Clash的网络请求或修改其代理设置。尝试暂时禁用防火墙或安全软件进行测试,如果问题得到解决,则需要在这些软件中将Clash客户端添加为例外或信任程序,允许其正常进行网络通信。
  6. 查看日志文件定位具体错误:Clash客户端通常提供日志查看功能,日志中会详细记录每次连接尝试的结果和可能出现的错误信息。打开日志面板,尝试重现连接问题并观察日志输出,根据错误提示(如认证失败、连接超时、TLS握手错误等)来针对性地搜索解决方案或向社区寻求帮助。

Connection issues are common. Here's a systematic 6-step troubleshooting process:

  1. Check Basic Network Connectivity: First, verify your device can access the internet without Clash. Try visiting a website with the proxy turned off. If basic connectivity is broken, resolve that first by checking WiFi, router status, or contacting your ISP.
  2. Verify Proxy Node Availability: Check the status of your currently selected node in the Clash client. If latency shows timeout or abnormally high values, the node may be down. Switch to another node in the same group or run a latency test on all nodes to find the fastest one.
  3. Confirm System Proxy Settings: Ensure Clash's system proxy switch is turned on and the correct proxy mode is selected (rule-based or global). Also check your OS network settings to confirm Clash has properly configured the proxy, as other software may have conflicting modifications.
  4. Troubleshoot DNS Issues: DNS resolution failures are a common cause. If using Premium with Fake-IP DNS, try temporarily disabling it. You can also specify public DNS servers (like 8.8.8.8 or 1.1.1.1) in your configuration to rule out DNS pollution.
  5. Check Firewall and Security Software Interference: Some firewalls or security software may block Clash's network requests. Try temporarily disabling them to test. If resolved, add Clash as an exception or trusted application in those programs.
  6. Examine Log Files for Specific Errors: Clash clients typically provide log viewing functionality. Open the log panel, reproduce the connection issue, and observe the output. Use specific error messages to search for targeted solutions or seek community help.