Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port 5000 may not be a safe default #688

Open
kinglozzer opened this issue Mar 4, 2024 · 0 comments
Open

Port 5000 may not be a safe default #688

kinglozzer opened this issue Mar 4, 2024 · 0 comments

Comments

@kinglozzer
Copy link

Hi,

Every now and then when I’m working using the local development server via retype start, I get a HTTP 403 error. This really confused me for a while, until I spotted the following HTTP header in Chrome inspector: Server: AirTunes/750.14.1.

Apparently macOS now uses this port for AirPlay, so it’s sometimes available and sometimes not. What’s slightly odd is that if I stop and restart retype, it doesn’t detect that the port is already in use by something else.

lsof -i :5000
COMMAND     PID       USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
ControlCe 71112 kinglozzer    8u  IPv4 0x2bfa09bfcfaa7eef      0t0  TCP *:commplex-main (LISTEN)
ControlCe 71112 kinglozzer    9u  IPv6 0x2bfa09b638bd21ef      0t0  TCP *:commplex-main (LISTEN)
ControlCe 71112 kinglozzer   23u  IPv6 0x2bfa09b6392fe9ef      0t0  TCP localhost:commplex-main->localhost:55031 (ESTABLISHED)
ControlCe 71112 kinglozzer   24u  IPv6 0x2bfa09b638c2c1ef      0t0  TCP localhost:commplex-main->localhost:55032 (ESTABLISHED)

I would suggest that fixing the port detection would be enough to solve this (so that stopping and restarting uses a different port number), but it might be better to change the default port - at least on macOS - because it may work initially, and then AirPlay will step in and steal the port at random.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant