vernesong/OpenClash

▲ 26 stars today★ 28,230⑂ 4,071

A Clash Client For OpenWrt

About vernesong/OpenClash

vernesong/OpenClash is an open-source project on GitHub, mainly written in JavaScript. A Clash Client For OpenWrt It currently holds 28,230 stars and 4,071 forks with 64 open issues, and was last pushed on 2026-11-16 (repository created 2019-05-29).

Project Overview

Git Homed tracks it on the Today's Trending board, currently at rank #89 with 26 new stars today.

GitHub Repository Details

Repository vernesong/OpenClash · default branch master · size 48991886 KB · watchers 195 · source: GitHub REST API and repository README

README

https://github.com/vernesong/OpenClash/blob/HEAD/OpenClash

OpenClash

一个可运行在 OpenWrt 上的 Mihomo (Clash Meta) 客户端

License Release Downloads OpenWrt Telegram

简介

OpenClash 是一个面向 OpenWrt 的 LuCI 插件,用于管理 Mihomo(原 Clash Meta)内核,兼容 Shadowsocks、ShadowsocksR、VMess、VLESS、Trojan、Snell、TUIC、Hysteria 等主流协议,通过灵活的规则配置实现按需分流与透明代理。

功能特性

| 模块 | 说明 | |------|------| | 内核 | 内置 Mihomo(Meta)与 Smart 智能内核,支持在线更新与切换 | | 运行模式 | redir-host / fake-ip 与混合模式、TUN 模式,兼容 iptables 与 nftables | | 订阅管理 | 多订阅并存,支持 Subconverter 在线转换、自定义 User-Agent 与请求头 | | 配置管理 | 多配置文件一键切换、在线编辑、备份/恢复、Age 加密 | | 访问控制 | 黑白名单、自定义防火墙规则 | | 流媒体 | Netflix / Disney+ / HBO 等自动选线 | | 覆写设置 | 模块化覆写 YAML,方便配置文件定制 |

目录

快速开始

网页安装

1. 从 Release 页面 下载对应架构的安装包(.ipk 或 .apk); 2. 登录 OpenWrt 的 LuCI 后台,前往 系统 → 软件包 上传并安装; 3. 刷新或者重新登录页面,在 服务 → OpenClash 中导入订阅或上传配置文件并启动。

命令行安装

安装依赖并下载最新版(iptables 防火墙):

# opkg 系统(ipk)
opkg update
opkg install bash iptables dnsmasq-full curl ca-bundle ipset ip-full iptables-mod-tproxy iptables-mod-extra ruby ruby-yaml kmod-tun kmod-inet-diag unzip luci-compat luci luci-base
curl -L --retry 2 https://api.github.com/repos/vernesong/OpenClash/releases/latest -o /tmp/openclash_version
[ -f "/tmp/openclash_version" ] && download_url=$(cat /tmp/openclash_version | jsonfilter -e '@.assets[*].browser_download_url' | grep '\.ipk$') && curl -L --retry 2 "$download_url" -o /tmp/openclash.ipk || echo "OpenClash last version get failed"
[ -f "/tmp/openclash.ipk" ] && opkg install /tmp/openclash.ipk || echo "OpenClash download failed"

apk 系统(apk)

apk update apk add bash iptables dnsmasq-full curl ca-bundle ipset ip-full iptables-mod-tproxy iptables-mod-extra ruby ruby-yaml kmod-tun kmod-inet-diag unzip luci-compat luci luci-base curl -L --retry 2 https://api.github.com/repos/vernesong/OpenClash/releases/latest -o /tmp/openclash_version [ -f "/tmp/openclash_version" ] && download_url=$(cat /tmp/openclash_version | jsonfilter -e '@.assets[*].browser_download_url' | grep '\.apk$') && curl -L --retry 2 "$download_url" -o /tmp/openclash.apk || echo "OpenClash last version get failed" [ -f "/tmp/openclash.apk" ] && apk add -q --force-overwrite --clean-protected --allow-untrusted /tmp/openclash.apk || echo "OpenClash download failed"

安装依赖并下载最新版(nftables 防火墙,Firewall4):

# opkg 系统(ipk)
opkg update
opkg install bash dnsmasq-full curl ca-bundle ip-full ruby ruby-yaml kmod-tun kmod-inet-diag unzip kmod-nft-tproxy luci-compat luci luci-base
curl -L --retry 2 https://api.github.com/repos/vernesong/OpenClash/releases/latest -o /tmp/openclash_version
[ -f "/tmp/openclash_version" ] && download_url=$(cat /tmp/openclash_version | jsonfilter -e '@.assets[*].browser_download_url' | grep '\.ipk$') && curl -L --retry 2 "$download_url" -o /tmp/openclash.ipk || echo "OpenClash last version get failed"
[ -f "/tmp/openclash.ipk" ] && opkg install /tmp/openclash.ipk || echo "OpenClash download failed"

apk 系统(apk)

apk update apk add bash dnsmasq-full curl ca-bundle ip-full ruby ruby-yaml kmod-tun kmod-inet-diag unzip kmod-nft-tproxy luci-compat luci luci-base curl -L --retry 2 https://api.github.com/repos/vernesong/OpenClash/releases/latest -o /tmp/openclash_version [ -f "/tmp/openclash_version" ] && download_url=$(cat /tmp/openclash_version | jsonfilter -e '@.assets[*].browser_download_url' | grep '\.apk$') && curl -L --retry 2 "$download_url" -o /tmp/openclash.apk || echo "OpenClash last version get failed" [ -f "/tmp/openclash.apk" ] && apk add -q --force-overwrite --clean-protected --allow-untrusted /tmp/openclash.apk || echo "OpenClash download failed"
首次使用需要下载内核,请提前确认网络环境

使用手册

下载

最新版本请前往 Releases 页面,按需选择对应的安装包:

| 安装包 | 说明 | |--------|------| | luci-app-openclash_*.ipk | opkg 安装包 | | luci-app-openclash-*.apk | apk 安装包 |

历史版本请前往 全部 Releases 查看。

依赖

| 类别 | 依赖 | |------|------| | 基础 | luci、luci-base、luci-compat(Luci ≥ 19.07) | | 运行时 | bash、curl、ca-bundle、ruby、ruby-yaml | | 网络 | dnsmasq-full、ipset、ip-full、unzip | | 防火墙(iptables) | iptables、kmod-ipt-nat、iptables-mod-tproxy、iptables-mod-extra | | 防火墙(nftables) | kmod-nft-tproxy(Firewall4) | | 可选 | kmod-tun(TUN 模式)、ip6tables-mod-nat(IPv6)、kmod-inet-diag(PROCESS-NAME) |

源码编译

从 OpenWrt 的 SDK 编译:

# 解压下载好的 SDK
curl -SLk --connect-timeout 30 --retry 2 "https://archive.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/OpenWrt-SDK-15.05.1-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2" -o "/tmp/SDK.tar.bz2"
cd /tmp
tar xjf SDK.tar.bz2
cd OpenWrt-SDK-15.05.1-*

Clone 项目

mkdir package/luci-app-openclash cd package/luci-app-openclash git init git remote add -f origin https://github.com/vernesong/OpenClash.git git config core.sparsecheckout true echo "luci-app-openclash" >> .git/info/sparse-checkout git pull --depth 1 origin master git branch --set-upstream-to=origin/master master

编译 po2lmo (如果有 po2lmo 可跳过)

pushd luci-app-openclash/tools/po2lmo make && sudo make install popd

编译最新 CodeMirror 6 (插件内置,可跳过)

pushd luci-app-openclash/tools/codemirror npm install npx esbuild entry.js --bundle --format=iife --global-name=CM6 --minify --target=es2019 --outfile=../../root/www/luci-static/resources/openclash/js/cm6.min.js --legal-comments=none --loader:.css=text npx esbuild entry-md-render.js --bundle --format=iife --global-name=OCMarkdown --minify --target=es2019 --outfile=../../root/www/luci-static/resources/openclash/js/md-render.min.js --legal-comments=none --loader:.css=text npx esbuild entry-lint-worker.js --bundle --format=iife --minify --target=es2019 --outfile=../../root/www/luci-static/resources/openclash/js/lint-worker.min.js --legal-comments=none rm -rf node_modules popd

开始编译

先回退到 SDK 主目录

cd ../.. make package/luci-app-openclash/luci-app-openclash/compile V=99

IPK 文件位置

./bin/ar71xx/packages/base/luci-app-openclash_*-beta_all.ipk
# 同步源码
cd package/luci-app-openclash/luci-app-openclash
git pull

您也可以直接拷贝 luci-app-openclash 文件夹至其他 OpenWrt 项目的 Package 目录下随固件编译

make menuconfig

选择要编译的包 LuCI -> Applications -> luci-app-openclash

致谢

OpenClash 的构建离不开以下开源项目与数据服务:

| 类别 | 项目 | 作者 / 组织 | 说明 | |------|------|-------------|------| | 内核 | Mihomo | MetaCubeX | 代理内核(Clash Meta) | | 代码基础 | Luci For Clash | frainzy1477 | 本项目代码基于此 | | 控制面板 | metacubexd | MetaCubeX | 默认内置面板 | | 控制面板 | zashboard | Zephyruso | 内置面板 | | 控制面板 | Yacd-meta | MetaCubeX | 内置面板,基于 yacd | | 控制面板 | Razord-meta | MetaCubeX | 内置面板(Dashboard) | | 订阅转换 | subconverter | tindy2013 | 在线订阅转换 | | GEO / IP 数据 | v2ray-rules-dat | Loyalsoldier | GeoIP / GeoSite 数据 | | GEO / IP 数据 | meta-rules-dat | MetaCubeX | GeoSite 规则数据 | | GEO / IP 数据 | mmdb_china_ip_list | alecthw | 中国 IP 列表 MMDB | | GEO / IP 数据 | china-operator-ip | gaoyifan | 运营商 IP 列表 | | 规则模板 | ACL4SSR | ACL4SSR | 订阅转换规则模板 | | 规则模板 | Custom_OpenClash_Rules | Aethersailor | 订阅转换规则模板 | | 流媒体检测 | RegionRestrictionCheck | lmc999 | 流媒体解锁检测 | | IP 检查 | ip.skk.moe | SukkaW | 公网 IP 检测 | | 编辑器 | CodeMirror | Marijn Haverbeke | 内置编辑器 |

请作者喝杯咖啡

许可证

本项目基于 MIT License 开源。

GitHub Stars & Activity

28,230Stars
4,071Forks
64Open issues
JavaScriptLanguage

GitHub Popularity

GitHub stars28,230
Forks4,071
Open issues64
Primary languageJavaScript
LicenseMIT
Stars gained today26
Created2019-05-29
Last pushed2026-11-16

Trending History

Daily boardrank #89 · ▲ 26 stars

Related GitHub Projects

1

louislam / uptime-kuma

JavaScript★ 94,465⑂ 8,850▲ 353 stars
→
2

juliangarnier / anime

JavaScript★ 74,790⑂ 5,111▲ 99 stars
→
3

maillab / cloud-mail

JavaScript★ 16,253⑂ 23,781▲ 316 stars
→
4

qist / tvbox

JavaScript★ 12,983⑂ 4,480▲ 38 stars
→
5

jackfrued / Python-100-Days

Jupyter Notebook★ 187,858⑂ 55,713▲ 23 stars
→
6

microsoft / generative-ai-for-beginners

Jupyter Notebook★ 123,650⑂ 66,506▲ 99 stars
→
7

godotengine / godot

C++★ 120,261⑂ 27,533▲ 91 stars
→
8

localsend / localsend

Dart★ 99,230⑂ 5,687▲ 154 stars
→

More Trending Repositories