lukeed / sirv

An optimized middleware & CLI application for serving static files~!
MIT License
1.06k stars 56 forks source link

Default port conflicts with Airplay MacOS Monterey #124

Closed platypusjones closed 2 years ago

platypusjones commented 2 years ago

This was raised in an issue in the Svelte template repo: https://github.com/sveltejs/template/issues/184

Due to the fact that MacOS Monterey ships with Airplay receiving functionality enabled, port 5000 is blocked unless user disabled. This is most likely going to affect anyone using such a common port (especially Flask, etc.), but from an onboarding perspective, I'm not sure whether asking users to change settings (disabling airplay receiving on their machines or change the port on their end) is enough, or if the default port should be changed out.

lukeed commented 2 years ago

Wow that's incredibly annoying

kresnasatya commented 2 years ago

I think it would be better if we change sirv port in svelte template instead of disable port 5000 for Airplay in macOS Monterey settings.

lukeed commented 2 years ago

Yes, if this is the case (will verify) then sirv-cli will need to adjust its default. It'd have to be a breaking change, which is fine, because there are some other changes I've been wanting to make.

If someone can leave instructions as to how I can verify that'd be helpful 🙇‍♂️

platypusjones commented 2 years ago

Changing default would definitely be great!

lsof -i :5000 Should return a ControlCenter process, and can confirm this occurring on latest release 12.0.1.

Download commented 2 years ago

Just came here from the linked issue. I can testify to the fact that indeed, port 5000 gets blocked by default on Mac OS Monterey. I disabled Airplay Receiver and after that, Svelte's default template project works. Changing the default port for sirv sounds like the best solution, because Apple will most probably not change and lots of devs are on Apple these days.

Download commented 2 years ago

Also, maybe good to link this one: https://github.com/sveltejs/template/issues/181