Windows 步骤

Windows 步骤

安装 nssm 并配置服务

1
2
3
4
nssm.exe install mihomo
Application里
path选择mihomo.exe完整路径, dir选择所在的目录, arguments填写-f config.yaml完整路径
install service

mihomo 关键配置

1
2
3
4
external-ui: ./ui
external-ui-name: xd
# 目前支持下载zip,tgz格式的压缩包
external-ui-url: "https://gh-proxy.org/https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip"

Mac 步骤

安装 mihomo 服务并配置

安装

1
2
3
4
5
# homebrew
brew install mihomo

# macports
sudo port install mihomo

配置

1
2
3
4
5
6
7
# 把 iCloud 的配置文件链接到指定目录 (可选)

# Macports
ln -sf ~/Library/Mobile\ Documents/iCloud\~com\~metacubex\~ClashX/Documents/config.yaml /opt/local/etc/mihomo/config.yaml

# Homebrew
ln -sf ~/Library/Mobile\ Documents/iCloud\~com\~metacubex\~ClashX/Documents/config.yaml /opt/homebrew/etc/mihomo/config.yaml

Macports

1
2
3
4
5
6
7
8
## 启动服务 + 开机启动
sudo port load mihomo

## 重启服务
sudo port reload mihomo

## 关闭服务
sudo port unload mihomo

Homebrew

1
2
3
4
5
6
7
8
9
10
11
12
13
14
## 启动服务 + 开机启动
brew services start mihomo

## 重启服务
brew services restart mihomo

## 关闭服务
brew services stop mihomo

## 1. 给 mihomo 赋权
sudo chown root:wheel $(brew --prefix)/bin/mihomo

## 2. 赋予 SUID 权限(允许普通用户启动时以 root 权限运行)
sudo chmod u+s $(brew --prefix)/bin/mihomo