Memo/free-port-5000-on-macos
1 分钟阅读
关闭 macOS 监听的端口 5000
关闭 AirPlay Receiver,释放 macOS 的 5000 端口。
我很喜欢 sigoden/dufs 这个项目,启动一个 HTTP server 还是共享文件,都非常方便。
但是 macOS 下会有一个烦人的家伙占用 5000 端口。
-> % dufs
Error: Failed to bind `0.0.0.0:5000`
Caused by:
Address already in use (os error 48)
抓一下。
-> % sudo lsof -i -P | grep ":5000" ControlCe 629 fanyang 12u IPv4 0xdc924348e03ccb2f 0t0 TCP *:5000 (LISTEN) ControlCe 629 fanyang 13u IPv6 0xcb88b5ec8a71ad1a 0t0 TCP *:5000 (LISTEN)
好家伙,原来是 Control Center。这就把你干了。
Why always something is running at port 5000 on my mac
For fixing this you need to turn off System Settings > General > AirDrop & Handoff > AirPlay Receiver.

嗯,确实没了,很好。
讨论
邮箱用于身份识别和回复通知,并由 Waline 存储。