Hako

command module
v1.19.31-hako.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

README

Hako

Hako

English · 简体中文

Website App Store Download Telegram Channel Telegram Group

Hako is a proxy kernel based on mihomo v1.19.31, with Go bindings and build tooling for Apple applications. It produces Hako.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

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

This repository preserves the original upstream commits and contributor identities alongside Hako's existing public history. Stable upstream upgrades are recorded as merge commits: the first parent continues Hako's history and the second points to the official upstream commit. Hako changes continue as incremental commits for separate logical changes. Compare the upstream baseline with a Hako revision to inspect the complete delta, including Apple bindings, SDK build tooling and kernel 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
Hako Proxy kernel, Go bindings and Apple SDK build tools
Hako-Adapter Swift packet-flow bridge and provider lifecycle components
Hako-Client Native iOS, iPadOS, macOS and tvOS applications and extensions

The upstream baseline version describes the proxy engine. It is separate from the App Store app version and the SDK release tag. Untagged source on main is pre-release; pin a specific revision when integrating it. Published SDK versions and downloads are listed in Releases.

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/hako: 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 current build was checked with Xcode 27.0. The binding module declares Go 1.25.0 and selects toolchain Go 1.26.6 in bind/hako/go.mod; allow Go to obtain that toolchain, or install it explicitly.

Clone the repository with its history and tags, then install the pinned gomobile tools:

git clone https://github.com/TokenPLS/Hako.git
cd Hako
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

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 still comes from a release tag at the current commit; ordinary source builds are labeled dev-<commit>.

The output is Hako.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. For a working application integration, see Hako-Client.

Development and feedback

For the root Go module:

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

The Apple binding has its own module and tests under bind/hako. 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 Hako-Client Issues.

For security reports, follow SECURITY.md.

License and credits

Hako is based on MetaCubeX/mihomo and the work of its contributors. Hako 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