Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

happy-token/HappyRouter

Repository files navigation

Happy Router

Per-app proxy routing for Clash Verge Rev on macOS. A native desktop app (Electron) with Web UI to select apps, assign proxy policies, and apply rules with one click.

πŸš€ Install with NPM

You can now install Happy App Router as a global command:

npm install -g @happytokenai/happy-router

After installation, you can use the command happy-router directly from anywhere in your terminal.

πŸ–₯️ Usage

Both CLI and Web UI are included and fully functional:

1. Web UI (Recommended)

Launch the beautiful, modern Web interface to manage all your rules visually:

happy-router --web

Alternatively, use npx @happytokenai/happy-router --web without installing.

2. CLI Interface

Step-by-step interactive command line guide:

happy-router

πŸ–₯️ Desktop App

Happy Router is also available as a native macOS desktop application with a system tray icon. The desktop app runs in the background, accessible from the menu bar at any time.

  • Tray icon β€” Quick access to the app from the macOS menu bar
  • Native look β€” macOS-native title bar with vibrancy and glass effects
  • Persistent β€” Keeps running in the tray when the window is closed

Download

Download the latest .dmg from the Releases page.

Build from Source

npm run dist:mac

The .dmg will be generated in the dist/ directory.

πŸ› οΈ Prerequisites

  • macOS with Clash Verge Rev installed
  • TUN mode enabled (required for per-process rules)
  • Node.js 22+

πŸ“– Key Features

  • Desktop App β€” Native macOS Electron app with tray icon and vibrancy effects.
  • Pick an app β€” Search and select from all installed macOS applications.
  • Pick a proxy β€” Choose a proxy group or individual node with live latency display.
  • i18n Support β€” Chinese and English interface with one-click language switching.
  • Theme Switching β€” Light, dark, and system-follow theme support.
  • Modern Design β€” High-end UI with transparency effects, icon-only controls, and elegant animations.
  • One-click Apply β€” Writes rules to clash-verge.yaml and hot-reloads via API automatically.

🚦 Routing Modes

Mode Behavior
Append (θΏ½εŠ θ§„εˆ™) Selected apps β†’ proxy, other traffic follows original Clash rules.
Exclusive (δ»…ι€‰δΈ­η›΄θΏž) Selected apps β†’ proxy, ALL other traffic goes DIRECT.

πŸ“¦ Development & Testing

If you want to contribute or test changes locally:

  1. Clone & Install:

    git clone https://github.com/happytokenai/HappyRouter.git
    cd HappyRouter
    npm install
  2. Local Linking (Development Mode): Link the package to your system to test the happy-router command globally without publishing:

    npm link

    Now, any changes you make in the code will be immediately reflected when you run happy-router.

  3. Running Interfaces:

    • Web UI: npm run web
    • CLI: npm start
    • Desktop: npm run electron

🚒 Publishing to NPM

To publish a new version to the NPM registry:

  1. Login (if not already):

    npm login --registry https://registry.npmjs.org
  2. Update Version: Increment the version in package.json (e.g., from 1.0.0 to 1.0.1).

  3. Publish:

    npm publish --access public

⚠️ Important

  • TUN mode must be enabled β€” PROCESS-NAME rules only work in TUN mode.
  • Auto Backup β€” A backup of your clash-verge.yaml is created before every change.
  • Safe Markers β€” Rules are wrapped in # BEGIN/END HAPPY_APP_ROUTER markers for safe removal.

πŸ“„ License

MIT

About

Per-app proxy routing for Clash Verge Rev on macOS. Native desktop app (Electron) with tray icon, i18n, and theme switching.

Resources

Stars

Watchers

Forks

Packages

Contributors

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /