Skip to content
This repository was archived by the owner on Oct 10, 2026. It is now read-only.
ProjectClashPublic archive

About

Historical archive of TokenPLS/Hako-Adapter. Development: ProjectClash/Clash-Adapter. 历史存档;后续开发与反馈请前往新仓库。

Resources

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

Clash-Adapter-Legacy

English · 简体中文

Active repository Website App Store

Important

Development has moved to Clash-Adapter.

This is the historical repository formerly located at TokenPLS/Hako-Adapter, transferred to ProjectClash on October 10, 2026. It is retained as an archive and will receive no further code updates or releases.

Use the active repository for current source, build instructions, releases and new issues. Outstanding reports have been transferred with their discussions; their original issue links redirect to the new locations.

Historical commits, contributor attribution, branches, tags, releases and download assets are retained. Stars and fork relationships remain attached to this historical repository. Earlier names and build instructions below describe the historical version, not the current project.

Historical README

Hako Adapter

English · 简体中文

Website App Store Download Telegram Channel Telegram Group

Swift components for connecting an Apple Packet Tunnel provider to a proxy kernel. This repository contains the packet-flow bridge and provider lifecycle code used by the Hako client.

For the complete application, see Hako-Client. The proxy kernel and SDK build tools are in Hako.

Components

Source Responsibility
PacketFlowBridge.swift Transfers packets between NEPacketTunnelFlow and a file descriptor, with framing, bounded queues and flow statistics
ProviderLifecycle.swift Coordinates provider state, session ownership, reloads, teardown and physical network path monitoring

These components use Apple system frameworks. They do not include a proxy engine, an application interface or a complete NEPacketTunnelProvider implementation.

Requirements

  • macOS with Xcode and the SDK for your target platform.
  • Swift 5.9 or later.
  • Deployment targets: iOS 15+, macOS 13+ or tvOS 17+.
  • A Packet Tunnel extension with its required capabilities and signing configured by your application.

Integrate the sources

The current types have Swift internal access. Compile the source files in your consuming target; importing the package from another module does not expose these types as a public API.

  1. Check out a specific revision of this repository.
  2. Add the files under Sources/HakoAdapter to your Packet Tunnel extension target, keeping the accompanying license.
  3. Supply your kernel connection and coordinate startup, network settings, packet handling and shutdown in your provider.

The Hako-Client bootstrap script demonstrates fetching a pinned revision and placing the sources in the consuming project.

PacketFlowBridge.start() returns the core-facing descriptor of a socket pair. The descriptor carries packets with a four-byte address-family prefix; it is not Apple's private utun descriptor. Keep the bridge alive for the tunnel session and call stop() during teardown. See the source for descriptor ownership and error handling.

ApplePhysicalPathMonitor exposes the current physical interface and interface inventory. Supply its optional logHandler to receive path diagnostics. The Hako SDK interface iterator and application logging integration live in the Client repository.

Status and feedback

This is pre-release integration code. Pin a revision and validate the lifecycle and packet flow in your own application. The repository's package declaration describes its build structure; it does not promise a stable external Swift API.

Report component problems in Issues, including the revision, target platform and a minimal reproduction. App issues belong in Hako-Client; kernel issues belong in Hako. Remove credentials and subscription links from public reports. Follow SECURITY.md for security reports.

License

GPL-3.0. See the source and license file for attribution.

About

Historical archive of TokenPLS/Hako-Adapter. Development: ProjectClash/Clash-Adapter. 历史存档;后续开发与反馈请前往新仓库。

Resources

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages