Read the Startup Logs: Identify Proxy and Controller Ports
Start with the first listen error from the current startup. Note the protocol, address, port, and error message. For example, listen tcp 127.0.0.1:7890: bind: address already in use means the app failed to bind to a local TCP address. This happens while setting up the local listener, so the client may fail to provide a proxy endpoint even when the subscription is valid and its nodes are reachable. Windows logs may also say Only one usage of each socket address is normally permitted.
mixed-portprovides a shared local endpoint for HTTP and SOCKS proxies;portandsocks-portcreate separate endpoints. Any of these settings could be using the conflicting port, so check the active configuration before making changes.external-controlleris the listening address for the control API. If the log reports a bind failure on127.0.0.1:9090, check port 9090. Changing only the controller port does not require changing the system proxy port.0.0.0.0:7890is an IPv4 wildcard address that also covers the local loopback address. A conflict can occur even if127.0.0.1:7890does not appear explicitly in the listener list. For IPv6 entries, look for[::]:7890; whether it also accepts IPv4 connections depends on the system and listener settings.
Find the Process Listening on Port 7890: Windows, macOS, and Linux
Run a query as soon as the error appears, and note the listening address and PID. Check local listening ports only: a remote connection that happens to use port 7890 does not mean local port 7890 is occupied. If the log reports port 9090, replace the port in the commands below with 9090.
Windows: Find the PID and Process Name in PowerShell
Get-NetTCPConnection -LocalPort 7890 -State Listen |
Select-Object LocalAddress, LocalPort, OwningProcess
For example, if OwningProcess shows 4321, use the command below to find the process name and executable path. Replace 4321 with the actual PID. Some process paths are only available from an elevated PowerShell session.
Get-Process -Id 4321 | Select-Object Id, ProcessName, Path
macOS: Find the Listener with lsof in Terminal
sudo lsof -nP -iTCP:7890 -sTCP:LISTEN
ps -p 4321 -o pid,ppid,comm
Use the COMMAND and PID columns in the first command to identify the process. The second command shows the process and its parent process for the PID you found. If the name is a kernel process, check its parent to determine whether it was started by the current client, another client, or a background service.
Linux: Find the Listening Address and Process with ss
sudo ss -ltnp 'sport = :7890'
ps -p 4321 -o pid,ppid,comm
Check the Local Address:Port and Process columns. If the error specifically mentions UDP, check the same protocol: on Windows, use Get-NetUDPEndpoint -LocalPort 7890; on macOS, use sudo lsof -nP -iUDP:7890; on Linux, use sudo ss -lunp 'sport = :7890'. An empty TCP query does not rule out a UDP port conflict.
Confirm which process owns the port before deciding whether to stop it or change ports. If it is a duplicate instance of your own client, quit it from the system tray or menu bar, then check whether the listener has disappeared. If it belongs to an app you still need or a managed service, leave it running and choose another port for the current client.
Change mixed-port and the External Controller Port
- Note the old port, system proxy state, and source of the active configuration. If the app provides port settings in its interface, use those first. If the client generates its configuration at startup from a subscription and override rules, editing the subscription cache directly may be overwritten on the next refresh. In that case, change the local override or client settings instead.
- Use the commands above to check candidate ports. For example, try
17890for the proxy endpoint; check19090separately only if the control API is also affected. These are example values. An empty listener query is only a preliminary check—the port is confirmed free when the app restarts and binds successfully. - For Clash or mihomo cores that read YAML directly, edit the existing top-level keys. The snippet below shows the two settings to change; it is not a complete configuration. Keep your existing proxies, rules, and authentication settings, and use each top-level key only once. If only the proxy port is in conflict, change only the corresponding proxy endpoint key.
mixed-port: 17890
external-controller: "127.0.0.1:19090"
If you use mixed-port, also check whether enabled port and socks-port settings use the same number. If the API is only for local control, keep it bound to 127.0.0.1. Update the address in any separate API dashboard, and retain its existing secret. If a built-in dashboard shows as offline after saving, check that its connection address matches the core's actual listening address. Do not enter the proxy endpoint in the controller address field.
After saving, apply the changes in the client or fully quit and restart it. Check the new startup log and query the new port again. Success means the new port appears on the expected address and the PID belongs to the core started by the current client. A “Running” status in the interface alone does not confirm that the port has changed.
Update System Proxy, Browser, and Terminal Settings
Once the client is listening on the new port, check where traffic is routed. Apps still using the old 127.0.0.1:7890 may fail to connect or reach another proxy that is still listening there. If the client manages the system proxy, reapply it after saving the new port, then verify the configured values in your system settings.
- Windows 11: Go to Settings → Network & internet → Proxy → Manual proxy setup → Use a proxy server. If you previously used a manual proxy, confirm the address and port are
127.0.0.1and17890. If you used an automatic configuration script, check the proxy endpoint in the script; do not switch modes just to hide an outdated value. - macOS 15: Go to System Settings → Network → your active network service → Details → Proxies. Check only the services that were already enabled, such as Web Proxy (HTTP), Secure Web Proxy (HTTPS), or SOCKS Proxy. If you switch network services, make sure you check the one currently in use.
- Firefox: Go to Settings → General → Network Settings → Settings…. Update the port separately if you use a manual proxy. If Firefox is set to use the system proxy, check the system endpoint instead. Also check any browser extension with its own proxy settings to see whether it still points to the old port.
- Terminals and developer tools: Check
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY, and their lowercase equivalents in the current session. Update only values that point to the old port. If a value comes from a startup script, reopen the terminal after changing it; running programs usually keep the environment they read at launch.
Test Connectivity and Check for Recurring Port Conflicts
Test the New Port, Then Check Your Usual Traffic Route
The command below explicitly sets an HTTP proxy and uses an HTTPS request to test the tunnel. --noproxy "" prevents existing bypass rules from affecting the test, while --max-time 15 limits it to 15 seconds. On Windows, run the same options with curl.exe.
curl -v --noproxy "" --proxy http://127.0.0.1:17890 --max-time 15 https://example.com/
The verbose output should first show a connection to 127.0.0.1:17890. Then check the CONNECT response and final HTTP response. If the local connection succeeds but the tunnel or request to the destination fails, check the client's connection logs and the selected policy instead of trying more ports. Once the explicit test passes, visit the same address in your usual browser and compare the client connection records to confirm that app traffic reaches the core. Whether the request goes direct or through a proxy node depends on the matching rule and outbound policy.
The Port Appears Free, but the Error Persists—or Returns After Restart
- If no listener appears in the query but startup still reports a conflict, first check whether multiple listeners in the active configuration use the same port. Then check for another client or background instance launched at sign-in or by a startup task. Quitting the front-end window may not stop the background listener, so confirm that it has been released.
- If Windows reports an access error but no listening process appears, use
netsh interface ipv4 show excludedportrange protocol=tcpto check the excluded IPv4 TCP port ranges. If your candidate port falls within a listed range, choose a free port outside it and leave the system's reserved-port settings unchanged. - If the port reverts after a subscription update, correct it in the override or client port settings, then refresh once more to verify. To roll back, first make sure the original port is free. Then restore the old values for the client listener, system proxy, and browser together so the endpoint and listener do not get out of sync.