Identify the conflicting listener in the startup log

Start by finding the most recent startup error in the client log. For example, in listen tcp 127.0.0.1:7890: bind: address already in use, tcp is the protocol, 127.0.0.1 is the listening address, and 7890 is the local port. The core failed to bind a local listening address; switching nodes, updating subscriptions, or changing routing rules will not free the port. If the error shows 0.0.0.0:7890 or [::]:7890, look for processes listening on all interfaces, not just the loopback address.

  • mixed-port accepts both HTTP proxy and SOCKS5 connections. If your current configuration also enables port or socks-port, check whether those separate listeners and the mixed port use the same address and TCP port.
  • external-controller is the API address used by a dashboard or client to control the core; it is not the proxy address used by your browser. If the log points to the controller API, such as 127.0.0.1:9090 in your configuration, changing mixed-port will not fix the issue.
  • If the log says listen udp, check the port over UDP. TCP and UDP can use the same port number independently; a UDP endpoint does not explain a TCP bind error.

Find the process using port 7890 on Windows, macOS, or Linux

Run the query soon after startup fails, and note the listening address, process ID (PID), and process name. If you plan to switch to 7897, check that candidate port the same way. Results reflect the state at the time of the query; the listener after restarting is what ultimately matters.

Windows: Find the process with PowerShell using its PID

Get-NetTCPConnection -LocalPort 7890 -State Listen |
  Select-Object LocalAddress, LocalPort, OwningProcess

Get-Process -Id 1234 | Select-Object Id, ProcessName, Path

Replace 1234 in the example with the OwningProcess value returned by the first command. If multiple rows appear for the same port, check each address and PID; one process may listen on both IPv4 and IPv6. If the process path is unavailable, retry in an elevated PowerShell session. For a UDP error, run Get-NetUDPEndpoint -LocalPort 7890 and check its OwningProcess value.

macOS: Use lsof to find the listener, then check its launch command

sudo lsof -nP -iTCP:7890 -sTCP:LISTEN
ps -p 1234 -o pid=,ppid=,command=

Replace 1234 with the PID shown by lsof. The -nP options keep addresses and ports numeric. The second command shows the parent PID and launch command, which can help distinguish a core started by a desktop client from a standalone instance. For UDP, run sudo lsof -nP -iUDP:7890 and check the local bind address; do not filter for TCP listener state.

Linux: Use ss to check the listening address and process

sudo ss -ltnp 'sport = :7890'
sudo ss -lunp 'sport = :7890'
ps -p 1234 -o pid=,ppid=,args=

The first line checks TCP; the second checks UDP. Process details usually appear in the users: field. Copy the pid= value into the third line. If the core runs in a container, distinguish a bind failure inside the container from a port publishing failure on the host: for the former, check the container's network namespace; for the latter, check the published port on the host first.

Free the old port or change mixed-port to 7897

  1. The old Clash instance is no longer needed: Exit the old client from its system tray menu first. Closing the window may leave the core running in the background. If the instance was started as a service, stop it using the original client's service controls or the operating system's service manager, then check 7890 again. A PID can change or be reassigned, so never terminate a process based only on an old result.
  2. The process using the port must keep running: Configure the client to use a different listening port. For example, after confirming that 7897 is unused and no other TCP listener in the same configuration uses it, set the mixed port to 7897. Leave the process using 7890 alone to avoid disrupting other applications.
  3. Check which configuration file is active: When running mihomo standalone, edit the YAML file actually loaded by the startup command. If a GUI client offers a local mixed-port setting or persistent configuration overrides, use that instead. Changes to a downloaded subscription file may be overwritten on the next update; edits to an inactive configuration will not take effect after a restart.

A mihomo configuration intended for local connections can use the top-level fields below. Edit existing keys instead of adding duplicate entries. allow-lan: false suits local-only use. If you need LAN access, keep the confirmed access scope and update the port on downstream devices as well.

mixed-port: 7897
allow-lan: false

After saving, reload the configuration in the client, or exit and restart it normally. Check the new log for bind errors, then use the commands in the previous section to confirm that the listener on 7897 belongs to the intended core. If it still listens on 7890 after restarting, check which configuration is active and whether the client's port setting overrides the YAML file.

Update the system proxy and app proxy ports

Once the core listens on 7897, your system or apps may still point to the old port, 7890. If the client manages the system proxy, re-enable that feature after confirming the new listener works, then check the actual address in your OS settings. For manual setup, use 127.0.0.1 as the proxy host and 7897 as the port. If your configuration uses a different listening address, use that instead.

  • Windows 11: Open Settings → Network & internet → Proxy, then check the address and port under Manual proxy setup. Or press Win + R, enter ms-settings:network-proxy, and press Enter. If you use a setup script, check the proxy endpoint it returns rather than changing only the manual proxy settings.
  • macOS 13 and later: Open System Settings → Network → select your active Wi-Fi or Ethernet service → Details → Proxies. Check which web proxy, secure web proxy, or SOCKS proxy is enabled. Network services store settings separately, so check the active service when switching between Wi-Fi and Ethernet.
  • Linux and standalone apps: In GNOME, check Settings → Network → Network Proxy for manual proxy settings. Command-line tools may also read http_proxy, https_proxy, or ALL_PROXY. Update proxy settings separately in browsers, extensions, and developer tools that manage their own proxy. After changing a shell startup file, open a new terminal to verify the settings.

TUN routes traffic through a virtual network interface; apps do not connect to it by entering an HTTP proxy port. Changing mixed-port does not change TUN routing or DNS interception. If only TUN traffic is still failing after fixing the mixed port, check the TUN toggle, routes, and DNS logs separately instead of trying random ports.

Test the proxy endpoint and rule matching

Test with a request that explicitly specifies the proxy port, bypassing system proxy settings. On Windows, use curl.exe; on macOS or Linux, use the same command but start it with curl. The --noproxy "" option prevents a bypass list in your environment from sending the test request around the proxy.

curl.exe --proxy http://127.0.0.1:7897 --noproxy "" -v --max-time 15 https://example.com/
  • Connection to the local port is refused: The request has not reached the routing rules yet. Check that the core is running, that it listens on 127.0.0.1, and that the active configuration is not still using the old port.
  • Connected to the local proxy, but the request failed: Find the destination domain in the log or connections page at the time of the test, then check the matched rule and selected policy. Handle rule rejections, DNS resolution failures, and upstream node connection failures according to their respective logs.
  • The command works, but the browser still fails: The local HTTP proxy is reachable. Check whether the browser still uses the system proxy, has its own proxy extension or auto-config script, or is still set to 7890.

Finally, make a connection from an app you use regularly and check the client's connections page to confirm the rule and policy matched for the destination domain. A page loading successfully does not necessarily mean traffic went through a proxy node; in rule mode, DIRECT may be the correct match. Note whether the change was made in the client settings or a local override, and check the port again after the next subscription update to avoid the issue returning.