Skip to content

feicong/BaoLianDeng

 
 

Repository files navigation

BaoLianDeng

macOS VPN proxy app powered by Mihomo (Clash Meta) core.

Download DMG · Website

Features

  • Transparent Proxy — Built on NETransparentProxyProvider for socket-level flow interception, faster than traditional TUN-based solutions
  • Rust-Powered Engine — Mihomo (Clash Meta) compiled as a native xcframework via Rust FFI
  • Per-App Proxy — Choose which apps go through the proxy (allowlist) or bypass it (blocklist)
  • Subscription Management — Add, refresh, and switch between proxy subscriptions (Clash YAML and base64 formats)
  • Smart Proxy Routing — Browse nodes with latency indicators, switch proxy groups, rule/global/direct modes
  • Traffic Analytics — Daily bar charts, session stats, and monthly summaries for proxy traffic

Architecture

┌─────────────────────────────────────────────┐
│             macOS App (SwiftUI)             │
│  ┌──────────┬────────┬───────┬───────────┐ │
│  │  Home    │ Config │ Data  │ Settings  │ │
│  │ Subs &   │ YAML   │Charts │ Groups /  │ │
│  │  Nodes   │ Editor │& Stats│ Logs      │ │
│  └──────────┴────────┴───────┴───────────┘ │
│  ┌───────────────────────────────────────┐  │
│  │  VPNManager (NETunnelProviderManager) │  │
│  └──────────────────┬────────────────────┘  │
├─────────────────────┼───────────────────────┤
│    System Extension (TransparentProxy)      │
│  ┌──────────────────┴────────────────────┐  │
│  │  NETransparentProxyProvider           │  │
│  │    ┌──────────────────────────────┐   │  │
│  │    │ MihomoCore.xcframework (Rust)│   │  │
│  │    │  - Proxy Engine              │   │  │
│  │    │  - DNS (fake-ip)             │   │  │
│  │    │  - Rules / Routing           │   │  │
│  │    └──────────────────────────────┘   │  │
│  └───────────────────────────────────────┘  │
└─────────────────────────────────────────────┘

IPC between the app and tunnel extension uses NETunnelProviderSession.sendMessage for mode switching, traffic stats, and version queries. Both targets share preferences via standard UserDefaults.

Install

Homebrew

brew tap madeye/BaoLianDeng https://github.com/madeye/BaoLianDeng
brew install --cask baoliandeng

From DMG

  1. Download the latest DMG from Releases
  2. Open the DMG and drag BaoLianDeng to Applications
  3. Launch from Applications
  4. Enable the network extension: System Settings → General → Login Items & Extensions → Network Extensions → toggle on BaoLianDeng

The DMG is signed with Developer ID and notarized by Apple.

Build from Source

Prerequisites: macOS 14.0+ with Xcode 15+, Rust toolchain (rustup with aarch64-apple-darwin and x86_64-apple-darwin targets)

1. Build the Rust framework

make framework    # macOS universal (arm64 + x86_64)

This compiles the Mihomo Rust FFI into Framework/MihomoCore.xcframework.

2. Configure signing

Copy the template and set your Apple development team ID:

cp Local.xcconfig.template Local.xcconfig
# Edit Local.xcconfig and set DEVELOPMENT_TEAM = YOUR_TEAM_ID

Finding your Team ID: Apple Developer portal → Membership → Team ID (10-character string, e.g. AB12CD34EF).

Both targets require these capabilities (already configured in entitlements):

  • App Sandbox
  • Network Extensions — Packet Tunnel Provider

3. Build and run

open BaoLianDeng.xcodeproj
# Select BaoLianDeng scheme → My Mac → Run (⌘R)

License

GPL-3.0 — see LICENSE for details.

About

A macOS VPN proxy app powered by Mihomo (Clash Meta)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Swift 71.1%
  • Shell 18.1%
  • Rust 6.1%
  • Python 1.6%
  • Objective-C 1.4%
  • Makefile 0.9%
  • Ruby 0.8%