3 ms·
> ...it boggles my mind that listening on port 0 and then reporting the actual bound port is not the default. This already works by just telling flask to use p
by masklinn 5y ago
> ...it boggles my mind that listening on port 0 and then reporting the actual bound port is not the default.
This already works by just telling flask to use port 0. Binding to port 0 is standard behaviour (literally, part of the standard) and like most other software of that type the first thing Flask does is report the URL it’s running on.
> but it offers tremendous convenience.
Except when it does not as is the case here. If you’re working on your web stuff having to copy/paste a URL from your term every time you restart your server.
- Joker_vD 5y ago> Binding to port 0 is standard behaviour (literally, part of the standard) I've seen a couple of programs that explicitly check and refuse to start when asked to listen on port 0 (for example, to this day "ssh -D 127.0.0.1:0 remote-host" refuses to start). > If you’re working on your web stuff having to copy/paste a URL from your term every time you restart your server. Don't the developer's standard server-launching scripts (re)launch browser after they start the server? IIRC, npm start and VisualStudio+ASP.NET do exactly that.