Skip to content

extekky/hyToggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyToggle

A minimal macOS menu bar app for managing Hysteria 2 VPN connections.

macOS Swift

image

Features

  • Sits in the menu bar — no Dock icon, no windows
  • Automatically discovers all .yaml / .yml configs in ~/.config/hysteria/
  • Switch between servers in one click
  • Sets macOS system SOCKS5 proxy automatically on connect / disconnect

Requirements

  • macOS 12 or later
  • Hysteria 2 installed via Homebrew:
brew install hysteria

Config setup

Create your config files in ~/.config/hysteria/. Each file becomes one menu entry — the filename (without config and .yaml) is used as the display name.

Example structure:

~/.config/hysteria/
├── configSweden.yaml
└── configNetherlands.yaml

This produces two entries in the menu: Sweden and Netherlands.

Minimal config example (configSweden.yaml):

server: <YOUR_SERVER>:<PORT>
auth: <YOUR_USERNAME>:<YOUR_PASSWORD>

tls:
  insecure: false

socks5:
  listen: 127.0.0.1:1080

http:
  listen: 127.0.0.1:8080

Replace <YOUR_SERVER>, <PORT>, <YOUR_USERNAME>, and <YOUR_PASSWORD> with your actual server details.

For the full list of available config options, see the Hysteria 2 client configuration docs.

Installation

Option 1 — Download prebuilt app (recommended)

Go to the Releases page and download the latest hyToggle.app.zip. Unzip and drag to /Applications.

Option 2 — Build from source

# 1. Build release binary
swift build -c release

# 2. Package into .app bundle
./build_app.sh

# 3. Copy to Applications
cp -r ~/projects/vpnBar/vpnBar.app /Applications/

Run locally without installing:

./.build/release/vpnBar

How it works

When you connect, hyToggle:

  1. Launches hysteria client --config <selected.yaml> as a background process
  2. Sets your Wi-Fi SOCKS5 proxy to 127.0.0.1:1080 via networksetup

When you disconnect, it terminates the process and clears the proxy.

Under the hood, hyToggle manages a hysteria client instance like this:

/opt/homebrew/bin/hysteria client \
  --config ~/.config/hysteria/configSweden.yaml \
  -l ERROR

Notes

  • Only Wi-Fi proxy is managed automatically. If you use Ethernet, you may need to set the proxy manually.
  • The app expects hysteria to be at /opt/homebrew/bin/hysteria (default Homebrew path on Apple Silicon).

Why I created this

I noticed that most macOS clients for Hysteria are either over-engineered or tend to break with every new update. I wanted something stable and lightweight, so I built hyToggle. It's a simple tool to manage the Hysteria binary natively without the bloat.

License

MIT

About

A lightweight switch for Hysteria2 that lives in the macOS system tray. No overloaded interfaces and unnecessary settings: just your configs, one click and automatic control of the system proxy.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors