How to Fix iPhone Cannot Connect to Mac mini Local Proxy (Mihomo Party)

Published: 2026-07-22
Author: DP
Views: 0
Category: MacOS
Content
## Symptom Sharing a proxy within a Local Area Network (LAN) is a common requirement. This article documents a typical troubleshooting case: A local router connects an iMac and a Mac mini, both running the proxy software Mihomo Party. When an iPhone is configured to use the iMac's IP as a manual proxy, the network works perfectly. However, switching the proxy IP to the Mac mini results in a "Cannot Connect" error. Both machines seemingly had the exact same software configuration, and the Mac mini's firewall was turned off. So, what was blocking the iPhone's requests? --- ## Troubleshooting Process Following the troubleshooting methodology provided by **DP@lib00**, we pinpointed the issue using terminal commands. ### 1. Testing Port Connectivity First, we used the `nc` command from another machine on the LAN to test the Mac mini's proxy port (e.g., 7890): ```bash DP@lib00 ~ % nc -vz 192.168.1.57 7890 nc: connectx to 192.168.1.57 port 7890 (tcp) failed: Connection refused ``` **Analysis**: `Connection refused` indicates that the network is reachable, but no service is listening on port 7890 on the target machine. This rules out the macOS firewall (which typically results in a `timed out` error). ### 2. Checking Local Port Binding On the Mac mini itself, we used `netstat` to check the actual listening status of port 7890: ```bash DP@lib00-Macmini ~ % netstat -an | grep 7890 tcp4 0 0 127.0.0.1.7890 *.* LISTEN ``` **Analysis**: The output shows that the Mihomo process is running, but it is bound exclusively to `127.0.0.1` (localhost). This means only the Mac mini can use the proxy; other devices on the LAN (like the iPhone) cannot access it. ### 3. Inspecting the Effective Configuration Why was it only listening on localhost? We checked the effective configuration file in Mihomo Party's working directory: ```bash DP@lib00-Macmini ~ % grep -nE 'allow-lan|bind-address' ~/Library/Application\ Support/mihomo-party/work/config.yaml 66:allow-lan: false 616:bind-address: "*" ``` **Analysis**: Even though the user had written `allow-lan: true` in their imported subscription profile, the effective `work/config.yaml` showed `allow-lan: false`. --- ## Root Cause This happens because the **GUI settings of proxy clients (like Mihomo Party / Clash) override the subscription configuration files**. During a system migration or initial setup, if you only write "allow-lan" in the text config but forget to toggle the switch in the app's graphical interface, the app will forcefully overwrite `allow-lan` to `false` when generating the final runtime configuration. --- ## Solution Fixing this issue is straightforward and requires no underlying code changes. You just need to enable the option in the GUI: 1. Open the **Mihomo Party** client. 2. Locate and click on **"Core Settings" (内核设置)** in the left sidebar. 3. In the right panel, find the **"Allow LAN" (局域网访问)** option and **turn it on**. 4. Restart the Core or restart the app. If you check again using `netstat -an | grep 7890` and see `*.7890` or `0.0.0.0.7890` in the `LISTEN` state, your iPhone will now be able to connect to the LAN proxy successfully. For more network troubleshooting tips, visit **wiki.lib00.com**.