A small, reproducible setup for routing local traffic through mihomo, while using an internal HTTP proxy as the upstream dialer for subscription nodes.
Traffic path:
program -> local mihomo -> internal proxy -> subscription nodes -> internet
For a normal Linux host with root, systemd, curl, and python3, use the one-command installer.
sudo INTERNAL_PROXY_URL='http://proxy.example.internal:3128' \
INTERNAL_PROXY_SERVER='proxy.example.internal' \
INTERNAL_PROXY_PORT='3128' \
MIHOMO_SUBSCRIPTION_URL='https://example.com/your-subscription?clash=1' \
./scripts/install.shThe installer will:
- install
mihomo - install scripts and shell helpers
- write
~/.config/mihomo/env.sh - generate
config.yaml - install and enable
mihomo.service - wire
~/.zshrcand~/.bashrc
You need to provide these values:
INTERNAL_PROXY_URL: full upstream HTTP proxy URL, used bycurlwhen refreshing subscriptionINTERNAL_PROXY_SERVER: upstream HTTP proxy host, used in runtimemihomoconfigINTERNAL_PROXY_PORT: upstream HTTP proxy portMIHOMO_SUBSCRIPTION_URL: Clash YAML subscription URL
After installation, these values are persisted in:
~/.config/mihomo/env.sh
scripts/install.sh: one-command installer for a new hostscripts/update_mihomo_config.py: converts a Clash YAML subscription into a runtimemihomoconfig and injectsdialer-proxyscripts/refresh_mihomo.sh: fetches subscription YAML and regenerates configsystemd/mihomo.service: example service templateshell/mihomo_helpers.zsh: zsh helper functionsshell/mihomo_helpers.bash: bash helper functionsdocs/INSTALL_zh.md: Chinese install guidedocs/USAGE_zh.md: Chinese usage notesdocs/TUTORIAL_zh.md: Chinese setup tutorial
If you need to inspect or customize each step manually, see the install guide. The manual path is now treated as an advanced or debugging workflow, not the default path.
Do not commit your real subscription URL, raw subscription file, generated config, or node credentials.
This repository only contains sanitized templates.