Context: Working on permission-suggestion (main)

AirPlay squatting port 5000

macOS AirPlay Receiver grabs port 5000 by default on Monterey+. Symptoms: any service you try to run on :5000 appears to start cleanly but the port is actually answered by AirPlay, which returns 403 Forbidden with Server: AirTunes/... to unrecognized requests.

Hit while running MLflow UI locally (mlflow server --port 5000) — browser showed 403, server logs showed no incoming requests. curl -I http://localhost:5000/ revealed the AirTunes Server header.

Fixes:

  • Use a different port (e.g. 5001)
  • Disable AirPlay Receiver: System Settings → General → AirDrop & Handoff → AirPlay Receiver → off

Apple docs: https://developer.apple.com/forums/thread/682332