Clash

command module
v1.19.34-clash.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2026 License: GPL-3.0 Imports: 26 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Clash

Clash

English · 简体中文

Website App Store Download Telegram Channel Telegram Group

Clash is a proxy kernel based on mihomo v1.19.34, with Go bindings and build tooling for Apple applications. It produces Clash.xcframework for iOS, macOS and tvOS.

To install the official app, use the App Store link above. This repository is for developers building or integrating the kernel.

Upstream history and modifications

Clash is an independent derivative of MetaCubeX/mihomo, based on v1.19.34, commit 0455d0d28c4526937380505153e65a843d8612e8. It is not affiliated with MetaCubeX. The upstream project asks unaffiliated downstream projects not to use “mihomo” in their names.

This repository retains the original mihomo commits and contributor identities. Its first source publication records the accumulated Clash adaptations in one commit, joining the existing README history with the official upstream baseline. Later changes are published as separate logical commits; stable upstream upgrades retain the official upstream commits as merge parents. Compare the upstream baseline with a Clash revision to inspect the Apple bindings, SDK build tools and kernel modifications. This initial publication does not reconstruct the development history of those adaptations.

The upstream GPL-3.0 license remains in LICENSE. See NOTICE and THIRD_PARTY_LICENSES.md for attribution and dependency licenses.

Project repositories

Repository Contents
Clash Proxy kernel, Go bindings and Apple SDK build tools
Clash-Adapter Swift packet-flow bridge and provider lifecycle components
Clash-Client Native iOS, iPadOS, macOS and tvOS applications and extensions

Versions and downloads

Component Current reference
Upstream engine mihomo v1.19.34, recorded in UPSTREAM_VERSION
Released Apple SDK v1.19.34-clash.2
Client integration Kernel and Adapter commits pinned in the Client's Dependencies.lock.json

The upstream engine version, SDK release tag and App Store app versions are separate. Use a release tag to reproduce an SDK release; main can contain later changes. Client and Adapter source are currently published by commit, without their own release tags.

SDK downloads include all five Apple slices, license notices and a source manifest. Each release also provides the notices separately, the source archive for the embedded EasyTier core used by macOS, and SHA256SUMS for checking downloaded assets.

What is included

  • The mihomo-based proxy engine: protocol implementations, DNS, routing rules, proxy groups and providers.
  • bind/clash: the API exposed to Apple applications through gomobile.
  • cmd/build_libbox: SDK generation and platform packaging.
  • docs/config.yaml: configuration reference included with the source.

An application supplies configuration, storage, the Network Extension integration and signing. Platform capabilities differ; a configuration accepted by the parser does not establish end-to-end support for every protocol or rule on every platform.

The iOS and tvOS SDK slices use no_easytier and do not include EasyTier. The macOS slice does not apply that exclusion. Platform permissions, TUN stacks and outbound implementations still determine what is available at runtime.

Build the Apple SDK

Use macOS with the full Xcode installation and the iOS, macOS and tvOS SDKs. The binding module declares Go 1.26.0 and selects toolchain Go 1.26.11 in bind/clash/go.mod; allow Go to obtain that toolchain, or install it explicitly.

To build the current released SDK, clone the repository with its history and tags, check out the release, then install the pinned gomobile tools:

git clone https://github.com/ProjectClash/Clash.git
cd Clash
git checkout --detach v1.19.34-clash.2
go install github.com/sagernet/gomobile/cmd/gomobile@v0.1.13
go install github.com/sagernet/gomobile/cmd/gobind@v0.1.13
make lib_apple

Select the full Xcode installation as your active developer directory, rather than standalone Command Line Tools. If Xcode is installed at the standard path, you can set DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer in your build environment.

The core version comes from UPSTREAM_VERSION, shipped with the source, so a source upgrade does not inherit an older SDK tag. The SDK release version comes from a release tag at the current commit; building an untagged revision instead produces dev-<commit>. Go dependencies are recorded in the root and binding module's go.mod/go.sum files; the SDK build uses both modules.

The output is Clash.xcframework, containing five platform slices:

Platform Architectures
iOS device arm64
iOS Simulator arm64, x86_64
macOS arm64, x86_64
tvOS device arm64
tvOS Simulator arm64, x86_64

The SDK framework is static: choose Do Not Embed when linking it directly, and link libresolv. An app and its extension can share a dynamic framework wrapping the static SDK to avoid packaging the kernel twice; the iOS and macOS Client projects use this arrangement. Use the generated headers for the API of your pinned revision. The application source and build instructions are available in Clash-Client. The Mac app's bundled controller helper is maintained in Clash-Client/cli.

Development and feedback

For the root Go module:

go build ./...
go test ./...

The Apple binding has its own module and tests under bind/clash. An SDK build alone does not establish runtime behavior on a signed device.

Report kernel problems in this repository's Issues. Include the source revision, platform, reproduction steps, expected behavior and observed result. Use a minimal sample configuration with secrets removed. For app interface or installation problems, use Clash-Client Issues.

For security reports, follow SECURITY.md.

License and credits

Clash is based on MetaCubeX/mihomo and the work of its contributors. Clash is an independent project and is not affiliated with or endorsed by MetaCubeX.

The project is licensed under GPL-3.0. See NOTICE and THIRD_PARTY_LICENSES.md for attribution and dependency licenses.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
build_libbox command
common
arc
buf
cmd
lru
net
orderedmap
Package orderedmap implements an ordered map, i.e.
Package orderedmap implements an ordered map, i.e.
singleflight
Package singleflight provides a duplicate function call suppression mechanism.
Package singleflight provides a duplicate function call suppression mechanism.
yaml
Package yaml provides a common entrance for YAML marshaling and unmarshalling.
Package yaml provides a common entrance for YAML marshaling and unmarshalling.
component
age
ca
ech
iface/anet
Package anet fix "route ip+net: netlinkrib: permission denied" on android copy and modify from https://github.com/wlynxg/anet/tree/5501d401a269290292909e6cc75f105571f97cfa
Package anet fix "route ip+net: netlinkrib: permission denied" on android copy and modify from https://github.com/wlynxg/anet/tree/5501d401a269290292909e6cc75f105571f97cfa
memory
Package memory return MemoryInfoStat modify from https://github.com/shirou/gopsutil/tree/v4.25.8/process
Package memory return MemoryInfoStat modify from https://github.com/shirou/gopsutil/tree/v4.25.8/process
nat
tls
wildcard
Package wildcard modified IGLOU-EU/go-wildcard to support:
Package wildcard modified IGLOU-EU/go-wildcard to support:
hub
hysteria2_realm
Package hysteria2_realm copy and modify from: https://github.com/apernet/hysteria-realm-server/tree/1ec22609705b5896df17d4ae4bfb2a1675cdb606
Package hysteria2_realm copy and modify from: https://github.com/apernet/hysteria-realm-server/tree/1ec22609705b5896df17d4ae4bfb2a1675cdb606
jls
transport
gun
jls
kcptun
Package kcptun copy and modify from: https://github.com/xtaci/kcptun/tree/f54f35175bed6ddda4e47aa35c9d7ae8b7e7eb85 adopt for mihomo without SM4,QPP,tcpraw support
Package kcptun copy and modify from: https://github.com/xtaci/kcptun/tree/f54f35175bed6ddda4e47aa35c9d7ae8b7e7eb85 adopt for mihomo without SM4,QPP,tcpraw support
masque
Package masque copy and modify from https://github.com/Diniboy1123/usque/blob/d0eb96e7e5c56cce6cf34a7f8d75abbedba58fef/api/masque.go
Package masque copy and modify from https://github.com/Diniboy1123/usque/blob/d0eb96e7e5c56cce6cf34a7f8d75abbedba58fef/api/masque.go
trusttunnel
Package trusttunnel copy and modify from: https://github.com/xchacha20-poly1305/sing-trusttunnel/tree/v0.1.1 adopt for mihomo
Package trusttunnel copy and modify from: https://github.com/xchacha20-poly1305/sing-trusttunnel/tree/v0.1.1 adopt for mihomo
vless/encryption
Package encryption copy and modify from xray-core https://github.com/XTLS/Xray-core/commit/f61c14e9c63dc41a8a09135db3aea337974f3f37 https://github.com/XTLS/Xray-core/commit/3e19bf9233bdd9bafc073a71c65b737cc1ffba5e https://github.com/XTLS/Xray-core/commit/7ffb555fc8ec51bd1e3e60f26f1d6957984dba80 https://github.com/XTLS/Xray-core/commit/ec1cc35188c1a5f38a2ff75e88b5d043ffdc59da https://github.com/XTLS/Xray-core/commit/5c611420487a92f931faefc01d4bf03869f477f6 https://github.com/XTLS/Xray-core/commit/23d7aad461d232bc5bed52dd6aaa731ecd88ad35 https://github.com/XTLS/Xray-core/commit/3c20bddfcfd8999be5f9a2ac180dc959950e4c61 https://github.com/XTLS/Xray-core/commit/1720be168fa069332c418503d30341fc6e01df7f https://github.com/XTLS/Xray-core/commit/0fd7691d6b28e05922d7a5a9313d97745a51ea63 https://github.com/XTLS/Xray-core/commit/09cc92c61d9067e0d65c1cae9124664ecfc78f43 https://github.com/XTLS/Xray-core/commit/2807ee432a1fbeb301815647189eacd650b12a8b https://github.com/XTLS/Xray-core/commit/bfe4820f2f086daf639b1957eb23dc13c843cad1 https://github.com/XTLS/Xray-core/commit/d1fb48521271251a8c74bd64fcc2fc8700717a3b https://github.com/XTLS/Xray-core/commit/49580705f6029648399304b816a2737f991582a8 https://github.com/XTLS/Xray-core/commit/84835bec7d0d8555d0dd30953ed26a272de814c4 https://github.com/XTLS/Xray-core/commit/373558ed7abdbac3de41745cf30ec04c9adde604 https://github.com/XTLS/Xray-core/commit/38cc306c955c362f044e074049a5e67b6b9fb389 https://github.com/XTLS/Xray-core/commit/b33555cc0a52d0af3c23d2af8fca42f8a685d9af https://github.com/XTLS/Xray-core/commit/ad7140641c44239c9dcdc3d7215ea639b1f0841c https://github.com/XTLS/Xray-core/commit/0199dea39988a1a1b846d0bf8598631bade40902 https://github.com/XTLS/Xray-core/commit/fce1195b60f48ca18a953dbd5c7d991869de9a5e https://github.com/XTLS/Xray-core/commit/b0b220985c9c1bc832665458d5fd6e0c287b67ae https://github.com/XTLS/Xray-core/commit/82ea7a3cc5ff23280b87e3052f0f83b04f0267fa https://github.com/XTLS/Xray-core/commit/e8b02cd6649f14889841e8ab8ee6b2acca71dbe6 https://github.com/XTLS/Xray-core/commit/6768a22f676c9121cfc9dc4f51181a8a07837c8d https://github.com/XTLS/Xray-core/commit/4c6fd94d97159f5a3e740ba6dd2d9b65e3ed320c https://github.com/XTLS/Xray-core/commit/19f890729656bc923ae3dee8426168c93b8ee9c2 https://github.com/XTLS/Xray-core/commit/cbade89ab11af26ba1e480a3688a6c205fa3c3f8
Package encryption copy and modify from xray-core https://github.com/XTLS/Xray-core/commit/f61c14e9c63dc41a8a09135db3aea337974f3f37 https://github.com/XTLS/Xray-core/commit/3e19bf9233bdd9bafc073a71c65b737cc1ffba5e https://github.com/XTLS/Xray-core/commit/7ffb555fc8ec51bd1e3e60f26f1d6957984dba80 https://github.com/XTLS/Xray-core/commit/ec1cc35188c1a5f38a2ff75e88b5d043ffdc59da https://github.com/XTLS/Xray-core/commit/5c611420487a92f931faefc01d4bf03869f477f6 https://github.com/XTLS/Xray-core/commit/23d7aad461d232bc5bed52dd6aaa731ecd88ad35 https://github.com/XTLS/Xray-core/commit/3c20bddfcfd8999be5f9a2ac180dc959950e4c61 https://github.com/XTLS/Xray-core/commit/1720be168fa069332c418503d30341fc6e01df7f https://github.com/XTLS/Xray-core/commit/0fd7691d6b28e05922d7a5a9313d97745a51ea63 https://github.com/XTLS/Xray-core/commit/09cc92c61d9067e0d65c1cae9124664ecfc78f43 https://github.com/XTLS/Xray-core/commit/2807ee432a1fbeb301815647189eacd650b12a8b https://github.com/XTLS/Xray-core/commit/bfe4820f2f086daf639b1957eb23dc13c843cad1 https://github.com/XTLS/Xray-core/commit/d1fb48521271251a8c74bd64fcc2fc8700717a3b https://github.com/XTLS/Xray-core/commit/49580705f6029648399304b816a2737f991582a8 https://github.com/XTLS/Xray-core/commit/84835bec7d0d8555d0dd30953ed26a272de814c4 https://github.com/XTLS/Xray-core/commit/373558ed7abdbac3de41745cf30ec04c9adde604 https://github.com/XTLS/Xray-core/commit/38cc306c955c362f044e074049a5e67b6b9fb389 https://github.com/XTLS/Xray-core/commit/b33555cc0a52d0af3c23d2af8fca42f8a685d9af https://github.com/XTLS/Xray-core/commit/ad7140641c44239c9dcdc3d7215ea639b1f0841c https://github.com/XTLS/Xray-core/commit/0199dea39988a1a1b846d0bf8598631bade40902 https://github.com/XTLS/Xray-core/commit/fce1195b60f48ca18a953dbd5c7d991869de9a5e https://github.com/XTLS/Xray-core/commit/b0b220985c9c1bc832665458d5fd6e0c287b67ae https://github.com/XTLS/Xray-core/commit/82ea7a3cc5ff23280b87e3052f0f83b04f0267fa https://github.com/XTLS/Xray-core/commit/e8b02cd6649f14889841e8ab8ee6b2acca71dbe6 https://github.com/XTLS/Xray-core/commit/6768a22f676c9121cfc9dc4f51181a8a07837c8d https://github.com/XTLS/Xray-core/commit/4c6fd94d97159f5a3e740ba6dd2d9b65e3ed320c https://github.com/XTLS/Xray-core/commit/19f890729656bc923ae3dee8426168c93b8ee9c2 https://github.com/XTLS/Xray-core/commit/cbade89ab11af26ba1e480a3688a6c205fa3c3f8
vless/vision
Package vision implements VLESS flow `xtls-rprx-vision` introduced by Xray-core.
Package vision implements VLESS flow `xtls-rprx-vision` introduced by Xray-core.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL