Port already in use: fixing the bind error
An error like listen tcp 127.0.0.1:7890: bind: address already in use at startup (or a red port on the General page) means another program owns the port. Two ways out:
Path 1: find the squatter
# find the PID using 7890 (last column)
netstat -ano | findstr :7890
# resolve the PID to a process name
tasklist | findstr 12345
Usual suspects: a zombie Clash instance (search Task Manager for clash and end it), another proxy tool, or a dev server. Kill it if it is expendable.
Path 2: change the port
Set Mixed Port on the General page to something else (7891, 7897 …) — effective immediately. Two follow-ups:
- System Proxy follows the new port automatically, but every app where you typed
127.0.0.1:7890by hand (git, npm, …) needs updating; - If collisions keep happening (a dev stack that grabs ports), consider Random Port — at the cost of hand-configured addresses never being stable. Your trade-off.