Clash — 基于规则的跨平台代理工具Clash — A Rule-Based Cross-Platform Proxy Tool
支持多协议、智能路由分流、全平台覆盖,改善每一位用户的 Internet 体验。从桌面到移动端,Clash 为您提供一致、高效、可定制的网络代理解决方案。Multi-protocol support, intelligent routing, and full platform coverage — enhancing every user's Internet experience. From desktop to mobile, Clash delivers a consistent, efficient, and customizable proxy solution.
$ clash -d /etc/clash INFO[0000] Start initial configuration INFO[0000] RESTful API listening at 127.0.0.1:9090 INFO[0000] SOCKS5 proxy listening at 127.0.0.1:7891 INFO[0000] HTTP proxy listening at 127.0.0.1:7890 # Rule-based routing active $
核心特性Core Features
全面了解 Clash 的能力边界Explore the Full Capabilities of Clash
Clash 提供丰富的入站/出站协议支持、灵活的规则路由系统以及强大的策略组管理功能,满足从新手到开发者的各类需求。Clash offers extensive inbound/outbound protocol support, a flexible rule-based routing system, and powerful strategy group management for users of all levels.
🌐
入站连接支持Inbound Support
HTTP、HTTPS、SOCKS5 服务端、TUN 设备,多种入站方式覆盖所有使用场景。HTTP, HTTPS, SOCKS5 server, TUN device — covering all usage scenarios.
🔌
出站连接支持Outbound Support
Shadowsocks(R)、VMess、Trojan、Snell、SOCKS5、HTTP(S)、Wireguard 等多协议出站。Shadowsocks(R), VMess, Trojan, Snell, SOCKS5, HTTP(S), Wireguard and more.
🧠
基于规则的路由Rule-Based Routing
动态脚本、域名、IP 地址、进程名称匹配,实现精准分流与智能代理。Dynamic scripts, domain, IP, and process name matching for precise traffic splitting.
🛡️
Fake-IP DNSFake-IP DNS
减少 DNS 污染影响,提高网络性能,通过虚拟 IP 响应加速域名解析。Reduce DNS pollution impact and improve network performance with virtual IP responses.
🔄
透明代理Transparent Proxy
使用自动路由表/规则管理 Redirect TCP 和 TProxy TCP/UDP,无需手动配置系统代理。Auto route-table management for Redirect TCP & TProxy TCP/UDP — no manual proxy setup needed.
⚖️
策略组与负载均衡Strategy Groups
自动可用性测试(fallback)、负载均衡(load balance)、延迟测试(url-test),智能选择最优节点。Fallback, load balance, and url-test for automatic optimal node selection.
📡
远程 ProvidersRemote Providers
动态加载远程代理列表,支持订阅自动更新,保持配置始终最新。Dynamically load remote proxy lists with auto-update support to keep configs fresh.
🔧
RESTful APIRESTful API
通过全面的 API 就地更新配置,支持自动化部署与第三方集成。Comprehensive API for in-place config updates, automation, and third-party integration.
全平台下载Downloads
选择您的平台,开始使用 ClashChoose Your Platform & Get Started
Clash 覆盖 Windows、macOS、Linux、Android、iOS 及鸿蒙系统,每个平台均有多款社区维护的优质客户端可供选择。Clash covers Windows, macOS, Linux, Android, iOS, and HarmonyOS — each with multiple community-maintained clients.
推荐REC
🪟
Clash Verge Rev
Windows · 集成 Clash Meta 内核Clash Meta Kernel
界面现代,支持 VLESS、Reality 等新协议Modern UI, supports VLESS, Reality & new protocols
4 步完成配置,即刻畅享安全网络4 Steps to Configure & Enjoy Secure Networking
从下载到使用,Clash 的上手流程简单明了。跟随以下步骤,几分钟内即可完成全部设置。From download to daily use — Clash setup is straightforward. Follow the steps below to get everything running in minutes.
下载客户端Download Client
在上方下载区选择对应您操作系统的推荐客户端并完成安装。Windows 用户推荐 Clash Verge Rev,macOS 用户可选择 ClashX Pro 或 Clash Verge Rev。Select the recommended client for your OS from the download section above and install it. Windows users should choose Clash Verge Rev; macOS users can pick ClashX Pro or Clash Verge Rev.
导入订阅/配置Import Subscription
通过订阅链接或本地配置文件导入节点信息。配置文件支持 URL 远程导入,开启后即可自动更新,无需手动维护节点列表。Import node info via subscription link or local config file. Configs support remote URL import with auto-update — no manual node list maintenance needed.
选择代理模式Select Proxy Mode
Clash 提供三种工作模式:全局(所有请求发往代理)、规则(按配置规则分流)、直连(所有请求直连)。推荐新手使用规则模式。Clash offers three modes: Global (all via proxy), Rule (split by config rules), and Direct (all direct). Rule mode is recommended for beginners.
开始使用Start Using
开启系统代理开关,确认状态栏图标显示为连接状态。此时您已成功接入安全、快速的网络通道,享受无阻碍的 Internet 体验。Enable the system proxy toggle and confirm the status icon shows connected. You're now on a secure, fast network — enjoy an unrestricted Internet experience.
涵盖下载安装、配置订阅、代理模式、规则配置、问题排查与高级功能,每个问题均提供详细的分步解答。Covering download & install, config & subscription, proxy modes, rule setup, troubleshooting, and advanced features — each with detailed step-by-step answers.
📥类别一:下载与安装Category 1: Download & Install
如何下载并安装 Clash 客户端?How to download and install Clash?
确认操作系统:Identify your OS:首先确认您使用的是 Windows、macOS、Linux、Android、iOS 还是鸿蒙系统,不同平台对应不同的推荐客户端。First identify whether you're on Windows, macOS, Linux, Android, iOS, or HarmonyOS — each platform has its own recommended client.
访问下载区块:Visit the download section:在本页面下载区块中选择对应平台,查看推荐客户端。Windows 推荐 Clash Verge Rev,macOS 推荐 ClashX Pro。Go to the download section on this page, select your platform, and check the recommended client — Clash Verge Rev for Windows, ClashX Pro for macOS.
点击下载按钮:Click the download button:点击对应卡片的下载按钮,跳转至官方发布页或 GitHub Releases 页面获取最新安装包。Click the download button on the card to go to the official release page or GitHub Releases for the latest package.
运行安装程序:Run the installer:下载完成后运行安装文件,按照提示完成安装。Windows 为 .exe 安装包,macOS 为 .dmg 镜像,Linux 为 .deb 或 .rpm 包。After downloading, run the installer and follow the prompts. Windows uses .exe, macOS uses .dmg, Linux uses .deb or .rpm packages.
启动并检查:Launch and verify:安装完成后启动客户端,检查系统托盘或菜单栏是否出现 Clash 图标,确认程序正常运行。After installation, launch the client and check if the Clash icon appears in the system tray or menu bar to confirm it's running.
授予必要权限:Grant permissions:首次运行可能需要授予网络访问权限或防火墙例外,请根据系统提示操作以确保代理功能正常工作。On first run, you may need to grant network access or firewall exceptions — follow system prompts to ensure proxy functionality works correctly.
📋类别二:配置文件与订阅Category 2: Config & Subscription
如何导入订阅配置?How to import a subscription?
获取订阅链接:Get subscription link:从您的代理服务提供商处获取 Clash 兼容的订阅链接,通常以 URL 形式提供,格式为 http(s):// 开头。Obtain a Clash-compatible subscription link from your proxy service provider — usually a URL starting with http(s)://.
打开客户端配置界面:Open client config panel:启动 Clash 客户端,进入"配置"或"Profiles"页面,找到导入订阅或添加配置的入口。Launch the Clash client, go to "Config" or "Profiles" page, and find the import subscription or add config option.
粘贴订阅链接:Paste subscription link:在订阅 URL 输入框中粘贴链接,点击下载或导入按钮。客户端会自动拉取远程配置并解析节点信息。Paste the link into the subscription URL field and click download/import. The client will automatically fetch and parse the remote config.
设置自动更新:Set auto-update:建议开启自动更新功能并设置更新间隔(如每 6-12 小时),确保节点列表始终保持最新状态。Enable auto-update and set an interval (e.g., every 6-12 hours) to keep your node list up to date.
验证配置生效:Verify config:导入成功后检查节点列表是否正常显示,尝试切换不同节点确认连接可用,完成配置验证。After import, check if the node list displays correctly, try switching nodes to confirm connectivity, and complete verification.
🎯类别三:代理模式与策略Category 3: Proxy Modes
三种代理模式有什么区别?如何选择?How to choose between the three proxy modes?
全局模式(Global):Global Mode:所有网络请求全部发往代理服务器,适合需要全面代理的场景。优点是简单直接,缺点是国内网站也会走代理,可能影响访问速度和稳定性。All network requests go through the proxy — ideal for full-proxy scenarios. Simple and direct, but domestic sites may slow down as they also route through the proxy.
规则模式(Rule):Rule Mode:根据配置文件中的规则进行智能分流——国内网站直连、海外网站走代理,兼顾速度与访问需求,是大多数用户的最佳选择。Intelligently splits traffic based on config rules — domestic sites go direct, overseas sites use proxy. Balances speed and access needs; the best choice for most users.
直连模式(Direct):Direct Mode:所有请求直接发往目的地,不经过代理服务器。适合临时关闭代理或进行网络诊断时使用,日常使用不建议开启此模式。All requests go directly to the destination without proxy — useful for temporarily disabling the proxy or network diagnostics. Not recommended for daily use.
选择建议:Recommendation:新手用户推荐使用规则模式,既能访问海外资源又不影响国内网站速度。进阶用户可根据需求自定义规则文件实现更精细的控制。Beginners should use Rule mode — access overseas resources without slowing domestic sites. Advanced users can customize rule files for finer control.
📐类别四:规则路由配置Category 4: Rule Configuration
如何自定义分流规则?How to customize routing rules?
理解规则语法:Understand rule syntax:Clash 规则由三部分组成:类型(DOMAIN-SUFFIX、DOMAIN-KEYWORD、IP-CIDR 等)、匹配内容和策略组,例如 DOMAIN-SUFFIX,google.com,Proxy。Clash rules consist of three parts: type (DOMAIN-SUFFIX, DOMAIN-KEYWORD, IP-CIDR, etc.), match content, and strategy group — e.g., DOMAIN-SUFFIX,google.com,Proxy.
定位配置文件:Locate config file:在客户端中找到配置文件编辑入口,或直接打开 YAML 格式的配置文件,找到 rules 字段所在区域。Find the config file editor in your client, or directly open the YAML config file and locate the rules section.
添加自定义规则:Add custom rules:在 rules 列表中添加新条目,按优先级从上到下排列。常用的规则类型包括 DOMAIN(精确域名)、DOMAIN-SUFFIX(域名后缀)、GEOIP(按地区)等。Add new entries to the rules list, arranged top-to-bottom by priority. Common types include DOMAIN (exact), DOMAIN-SUFFIX, and GEOIP (by region).
使用规则集(Rule Providers):Use Rule Providers:通过 rule-providers 引用远程规则集,无需手动维护大量规则,社区维护的规则集覆盖常见网站分类。Reference remote rule sets via rule-providers — no need to manually maintain large rule lists. Community-maintained sets cover common website categories.
测试规则效果:Test rules:保存配置后使用客户端的连接日志功能查看请求匹配情况,确认规则按预期生效,必要时调整顺序或匹配条件。After saving, use the client's connection log to check request matching, confirm rules work as expected, and adjust order or conditions as needed.
备份配置:Backup config:修改前建议备份原始配置文件,以便出现问题时快速恢复。大多数客户端也支持配置文件的版本管理。Back up the original config before making changes for quick recovery if issues arise. Most clients also support config version management.
🔍类别五:连接问题排查Category 5: Troubleshooting
连接失败如何排查?How to troubleshoot connection failures?
检查系统代理开关:Check system proxy:确认 Clash 客户端的系统代理开关已开启,部分系统需要手动设置代理地址为 127.0.0.1,端口为 7890(HTTP)或 7891(SOCKS5)。Ensure the system proxy toggle in Clash is on. Some systems require manually setting the proxy to 127.0.0.1, port 7890 (HTTP) or 7891 (SOCKS5).
验证节点可用性:Verify node availability:在客户端中测试节点延迟,确认至少有一个节点可达。如果所有节点超时,可能是订阅过期或服务商问题。Test node latency in the client to confirm at least one node is reachable. If all nodes time out, the subscription may have expired or there may be a provider issue.
检查防火墙/安全软件:Check firewall/security software:部分防火墙或安全软件可能拦截 Clash 的网络请求,尝试将 Clash 添加至信任列表或暂时关闭安全软件进行测试。Some firewalls or security software may block Clash — try adding Clash to the trusted list or temporarily disable security software to test.
查看日志输出:Check logs:打开客户端的日志面板,查看是否有报错信息。常见的错误包括 DNS 解析失败、TLS 握手超时、认证失败等,根据日志针对性解决。Open the client's log panel to check for errors. Common issues include DNS resolution failures, TLS handshake timeouts, and authentication failures — address them based on log details.
重置配置尝试:Try resetting config:如果问题持续存在,尝试使用默认配置或重新导入订阅。排除配置文件本身的问题后再进一步排查网络环境。If the issue persists, try using the default config or re-importing the subscription. Rule out config file issues before investigating the network environment further.
⚡类别六:高级功能使用Category 6: Advanced Features
如何使用负载均衡和自动测试功能?How to use load balancing and auto-testing?
理解策略组类型:Understand strategy types:Clash 支持多种策略组:url-test(自动选择延迟最低的节点)、fallback(按优先级选择首个可用节点)、load-balance(轮询分配请求),每种适用于不同场景。Clash supports multiple strategy types: url-test (auto-select lowest latency), fallback (select first available by priority), and load-balance (round-robin distribution) — each suited for different scenarios.
配置 url-test 策略:Configure url-test:在策略组中设置 type 为 url-test,指定测试 URL 和测试间隔(如每 300 秒),Clash 会自动选择延迟最低的节点。Set type to url-test in the strategy group, specify the test URL and interval (e.g., every 300s). Clash will automatically select the lowest-latency node.
配置负载均衡:Configure load-balance:将策略组类型设为 load-balance,多个节点之间轮流处理请求,有效分散流量负载,适合高并发场景。Set the strategy group type to load-balance — nodes take turns handling requests, effectively distributing traffic load. Ideal for high-concurrency scenarios.
监控与调优:Monitor and tune:通过 RESTful API 或客户端面板观察各节点的延迟和可用性数据,根据实际情况调整测试间隔和节点列表,持续优化代理性能。Observe latency and availability data via the RESTful API or client panel, adjust test intervals and node lists based on actual conditions, and continuously optimize proxy performance.
社区与信任Community & Trust
开源驱动,社区共建Open Source Driven, Community Built
Clash 采用 GPL-3.0 开源许可证,拥有活跃的全球开发者社区。以下数据来自 GitHub 公开统计(数据定期更新)。Clash is licensed under GPL-3.0 with an active global developer community. Data below is from public GitHub statistics (updated periodically).