12 ms·
Why is Control Center on Monterey listening on ports?
- cromka 5y agoThis was discussed before: https://news.ycombinator.com/item?id=29006861 https://news.ycombinator.com/item?id=29006861 Their usage of port 5000 appears compliant with IANA port designation.
- jug 5y agoDevelopers trying out their web servers should probably add another zero for port 50000 and now they'd suddenly get an IANA compliant one. I'm not sure how this came to be to be honest. This is a very old system, but yet we still abuse the four digit range with private use ports. I mean, it's often just one digit away. Even as defaults in software packages where their developers should at least know better even if a random web developer might not.
- stefan_ 5y agoOr we stop pretending this IANA document means anything and make software that is shipped on millions of computers by default use port numbers that don't take away from what humans prefer to use?
- zinekeller 5y agoLike, how Linux DEs change their standard APIs so often that unless you've targeted X, it sucks? There are reason for having sensible standards. You can say something bad about Windows, but the paramount stabilty (despite their multiple changes in theming) is very appreciated, thank you.
- ChuckNorris89 5y ago>Like, how Linux DEs change their standard APIs so often that unless you've targeted X, it sucks? AFAIK that's mostly a GNOME issue, so despite it wrongly, IMO, being the default and the most popular DE of the Linux distros for some reason, I wouldn't throw mud on the whole Linux DE ecosystem because of it alone. KDE, LXQT, LXDE and XFCE seem to have their shit together for the most part.
- zinekeller 5y agoKDE ain't too, unfortunately, and really unrelated to Qt. I'm using Plasma right now, but that transition was rough, and unrelated to it's refresh.
- ChuckNorris89 5y agoWould you mind detailing why you think KDE isn't? I'm no fanboy and have no dog in this DE fight, just curious.
- zinekeller 5y agoIf you wrote without KDE dependencies and your distro did include the correct Qt version, there's no problems at all (apart from edge-case bugs). But KDE3 to KDE4 and KDE4 to KDE5 (Plasma) was associated with a whole change, similar to Mozilla's Firefox's "Daylight", "Quantum", and "Australis" and web extensions, and associated behavioural relearings.
- ChuckNorris89 5y agoI thought we were talking about the present situation of KDE, not about past history.
- stefan_ 5y agoIt's not a standard if it was never adopted. The port assignment document has two practical uses: 1) To cite it in a smart hacker news comment 2) To show alarming text in "security scans" to gullible people Seriously, google "commplex" and all you find is confused home users thinking they got a trojan of sorts. In 2021, it is purely a drain on everyones nerves.
- smaudet 5y agoWhat about Dns, smtp, http, https, ftp, ssh, sftp, etc.? Pretty sure those are not drains on everybody's nerves. Devs bashing standards cause they don't want to follow the rules which make things work well is a drain on everyone's nerves. But maybe I have misunderstood the document (didn't read). Standards are nice, except when they are mostly geared towards one company. Then yeah, it would be better to have SRV records and discourage default port usage such as Apple is doing. If we could go back in time, forcing an app layer (e.g. an ssh header) over a port might have been helpful, port conflicts might have been less common and you could have even eliminated root only ports. At any rate let's not break the web because some lazy mofo doesn't want to get off their couch.
- cromka 5y ago> Or we stop pretending this IANA document Yeah, and while we're at it, let's burn all IETF RFCs. Who needs that?
- stefan_ 5y agoThe point is that even the IANA doesn't give a fuck about the port assignment document. It's full of dead entities.
- zinekeller 5y agoThat is rather an audacious statement. Company dead != unused. Also, the process is well-defined and guided by an RFC itself, so it's really in IETF's control, just stewarded by IANA.
- josephg 5y agoWhat we should really do / have done is add port numbers to DNS entries. Then IANA wouldn’t need a public registry of port assignments. Everyone can use whatever ports for our public services that we like. Sadly, its almost certainly too late to add port numbers to DNS.
- detaro 5y agothat's exactly what SRV records do. Used for many things, but not HTTP(S)
- kroltan 5y agoActually, DNS SRV entries do support port numbers (and transport layer!) https://en.wikipedia.org/wiki/SRV_record https://en.wikipedia.org/wiki/SRV_record It is just a matter of specifying the use of such entries in the protocols (HTTP et al). A lot of new protocols already rely on them. As someone who doesn't do much infra, I've encountered them when setting up the DNS for a Minecraft server. The game checks for the SRV record, or if it is missing, assumes (or reads from the user) a given port.
- deleted 5y ago[deleted]
- the_mitsuhiko 5y agoI'm to blame for 5000 being popular as HTTP port as I picked it by default for Flask. The reason I did this was that there is only one HTTP port (other than 80 you can't bind to) in the IANA registration which is 8080. A few people started using other ports around the time because 8080 was commonly already occupied by some userspace HTTPDs. I picked specifically 5000 because the IANA registration for this port was assigned to a single service, was not used and generally obscure. Whatever Apple has running on there is also unlikely to be what the IANA registration refers to.
- zinekeller 5y ago> Whatever Apple has running on there is also unlikely to be what the IANA registration refers to. Here's a quotation: > Just did a bit more digging, and IANA actually assigns port 5000 to "commplex-main" - so really any other service that's using that port is violating the official assignment. Based on a quick search of what commplex-main is, it's related to UPnP for network device discoverability. I'm not sure exactly what the AirPlay Receiver service does, but I get the gist that it probably does fit somewhere into the scope of UPnP-related features. At the very least, it's probably a far more accurate usage of port 5000 than some random dev servers. This port was actually also used back in XP and * Lion days both by Apple and Microsoft, but I have a hunch that *.local replaced these use cases and that's why it became disused until recently.
- the_mitsuhiko 5y agoI believe that comment to be incorrect. UPnP is using this port, but unofficially. The IANA port registration for 5000 is for commplex whatever it is, and it refers to two ports: 5000 and 5001. UPnP uses 5000 unofficially and does not use 5001.
- zinekeller 5y agoDoes Multiplex Communication sounds familliar? But yeah, someone should check the IANA archives to know what really is "commplex-main".
- KarlKemp 5y agoI'm not quite certain how common it really is. But, in any case, ports are expected to occasionally collide and therefore easy to configure. If port collisions were such a hassle, we wouldn't see anything like a "common" port (i. e. one that unrelated tools choose per default). Good developers can have a pipe in every port, I guess... (valid for development work only, especially those cases where you run some server and it opens the browser for you, port helpfully provided. There is value in ssh on 22 and http on 80, obvsly)
- capableweb 5y agoJudging by that thread in the Apple forums, people are for some reason unable to change the default port their development environment uses, so they blame Apple for using a port they have been using for a long time. Not sure why they are unable to change them, but the typical Apple user isn't directly famous for their willingness to configure their own software (either changing the ports of their development environment, or configure their OS to stop using that port), so I guess it's fairly common to end up with scenarios like this.
- Lhiw 5y agoUsing whole round numbers like 5000 for public release software is pretty braindead though.
- mavhc 5y agoAre ports 1-4999 already in use? Can we reserve a private area like 192.168/24 for IPs? Also why is there no official TLD for DNS for local domains?
- tomklein 5y agoThe first 1024 are reserved and you usually can freely choose the ones greater than that. You can also use .local for local domains.
- SturgeonsLaw 5y agoUsing .local is no longer recommended since it's used for mDNS. Apple devices in particular have issues resolving .local addresses. Current best practice is to use a subdomain of a domain you control for internal stuff. Makes getting certs for internal hosts easier too if you can be bothered.
- AndyJames 5y ago1-1024 are reserved for root so you can still technically use them. Port 0 is the only one truly reserved/impossible to used
- davidsojevic 5y agoYou can use the .local, .localhost, .example, and .test TLDs for local domains -- these are IANA reserved: https://www.iana.org/assignments/special-use-domain-names/special-use-domain-names.xhtml https://www.iana.org/assignments/special-use-domain-names/sp...
- mschuster91 5y ago.local is used for mDNS these days, don't use it if your network has Apple devices.
- detaro 5y agonot just Apple devices, you'll find mDNS resolvers on many setups. Overrides in the hosts file might be fine, but still, I'd avoid it.
- IceWreck 5y agoIs that forum post's poster so lazy or incompetent that they cant change a port in their development config file ?
- eloisius 5y agoIt would be lazy not to investigate why something that has worked for years suddenly broke upon OS upgrade.
- capableweb 5y agoYou're expecting too much, the reason developers use macOS in the first place is to not having to consider the entire of their environment. They rather call a number and have someone solve it for them, than investigating why a OS update broke something, otherwise they'd use a OS that required them to understand the full stack from the beginning.
- ribit 5y agoAs repeatedly pointed out, Apple has been using these ports for audio streaming functionality since 2004. If your web framework is so inflexible that it hard-codes ports to collide with OS functionality without an easy way of reconfigure it, that's on the framework, no?
- baq 5y agowhat if there IS an easy way to do it, as is the case here?
- vadfa 5y agoThen you don't post a new thread ;)
- eloisius 5y agoOn airports or what? I used Mac as my development environment for ten years and never had a conflict using port 5000. It’s not about inflexible web frameworks, lazy or stupid developers that use Macs. 5000 is a popular default port for web frameworks, and if it stops working one day, there’s nothing wrong with wondering why. It might be a small headache to get your entire team to redefine the default port in your project’s dev environment if half of them use another OS, or you happened to upgrade MacOS before everyone else. Of course, the most likely outcome will be switching to another port, but what is with all the hostile comments in this thread about someone asking why something that’s worked for so long broke?
- sam0x17 5y agoWhat web framework commonly uses 5000 in development mode? I've seen a lot of port 3000 and 8888 and 8080 and 10000, but never 5000.
- Kwpolska 5y agoFlask is one example: https://flask.palletsprojects.com/en/2.0.x/quickstart/#a-minimal-application https://flask.palletsprojects.com/en/2.0.x/quickstart/#a-min...
- detaro 5y agoFlask, svelte.js' "sirv", angulars "ng serve", ASP.NET
- Shacklz 5y agoAngulars "ng serve" defaults to 4200 as far as I'm aware; never seen 5000 in the wild in the context of Angular
- deleted 5y ago[deleted]
- bryanrasmussen 5y agowe ran into it recently, basically when running microservices locally the different services were running on different ports, obviously don't need all running but there was a collision. The main problem is that with Apple's normally great communication skills about what they do, it takes a while to figure out what has all of a sudden happened and then change your port. And then you're mad at apple for making you waste some time.
- op00to 5y agoLooking at open ports takes a while?
- bryanrasmussen 5y ago
- lifthrasiir 5y agoIt is easy to bash those complaints, but it does show that the IANA port assignments [1] do not work well for ports 1024-- in practice. You generally don't see this kind of complaints for system ports (0--1023) because you need root for them in UNIXish systems and thus has a much higher bar for collision. If we were enfocing the same rule for ports 1024-- we should have overflown the IANA registry by now [2], but it will be absurd and we instead collectively chose to ignore the registry. It hardly makes a difference whether you have actually registered your port to the registry or not; you should prepare for a possibility that your use of that port collides with other's. [1] https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml https://www.iana.org/assignments/service-names-port-numbers/... [2] The actual rate is something like 3--50 new and updated entries per year.
- joosters 5y agoI hope you're not advocating the return of the portmapper?
- gnrlst 5y ago~1 month ago, when setting up my new Macbook it took me forever to debug this. After hours of trying to mess with the builtin Apache service (thinking it was the culprit), I found a random blog post that said to disable the sharing feature occupying the port in the system preferences. It was devilishly hard to debug (and google for) at the time. For those wondering why I needed port 5000 in my case, it was a standard Svelte app serving on localhost:5000 (via Sirv).
- rdbell 5y agoDoesn't something like `lsof -i TCP -s TCP:LISTEN` quickly show what's monopolizing 5000?
- op00to 5y agoYes.
- tokamak-teapot 5y agoDoes lsof show that 5000 is in use? Is Svelte hard-wired to 5000?
- gnrlst 5y agoI didnt try lsof. I figured it was a permissions issue and started going down the Apache rabbit hole since when trying localhost without a port it displayed a page with "it works"... I thought it had monopolized the whole localhost. Svelte is not hard-wired to 5000, but I made it a point to fix it since I didn't like the idea of a random port being blocked.
- op00to 5y agoWalk the OSI model next time instead. :)
- tokamak-teapot 5y agoIt’s interesting that you thought it was a permissions issue, which suggests that Svelte didn’t report that the port was in use - at least not in clear enough language. I started off thinking it was a bit ridiculous that people developing wouldn’t just think ‘oh port 5000 is busy - let me try -p 6000 when running this’ but I see that was a wrong assumption, because the tool itself seems to perhaps be flawed in that it isn’t making it easy to diagnose and change how it runs to sidestep the used port. Perhaps a feature request for svelte is in order?
- punnerud 5y agoPort 5000 is reserved for the service "commplex-main": https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?&page=88 https://www.iana.org/assignments/service-names-port-numbers/...
- onion2k 5y agoEvery time I've written something that uses a port I've added a check to see if the code returns an EADDRINUSE error when the listener connects, and offered the user an alternative port if it does. I always assumed everyone did that but apparently not. Maybe I should make an NPM package...
- zinekeller 5y agoIt should be a Pip package instead! (The main non-IANA compliant user of the port is Flask, a Python-based web framework.)
- onion2k 5y agoNo one would want to use a Python package written by a JS developer. :)
- emteycz 5y agoNo one would see any difference, any perceived difference in quality is a meme
- OJFord 5y agoI don't know, if you'd never done any Python, and perhaps particularly if you learnt JS in 'callback hell' days, you might not realise what was wrong with: def doSomething(theArgs, cb): food, bard = 0, 0 try: doFoo(theArgs["foo"], lambda: food = 1) doBar(theArgs["bar"], lambda: bard = 1) except Exception: cb(food + bard, "didn't work") else: cb(food + bard, None) or whatever. I can get by in JS, I use it professionally even now, but it's not good quality; I know that. (Trivial example, I discovered `??` recently. I've definitely written a lot of null/undefined checks without it, or even naive ternaries that assume non-null/undef values aren't falsey (`thing ? thing : 123` vs. `thing ?? 123`) - which is kind of like seeing `dict.get(key, None)` in python.)
- spiffytech 5y ago
- richardwhiuk 5y agoThere are plenty of ports reserved for HTTP without using 5000 - this is a bug in those frameworks using 5000.
- rock_artist 5y agoI am surprised to see so much comments without mentioning the reason of that (written in the thread)... * It's the new AirPlay server capability. * It can be toggled off. * Those ports are the defaults for AirPlay. It might've been nice to allow simple way of customizing the ports though..
- deleted 5y ago[deleted]
- zinekeller 5y agoSidenote: a dispute (https://news.ycombinator.com/item?id=29305298 https://news.ycombinator.com/item?id=29305298) has been raised on the validity of UPnP even properly using the port. All the details here not contradicting are still correct to the best of my knowledge and research. Update: "It would appear commplex was a part of seeplex, some visualization tool for old Sun workstations in the early 90ies https://lib.dr.iastate.edu/cgi/viewcontent.cgi?article=11617&context=rtd https://lib.dr.iastate.edu/cgi/viewcontent.cgi?article=11617..." "The Commplex is a communications package for communication with the NCUBE from Sun workstations." > * Those ports are the defaults for AirPlay. No, those are the default port for UPnP discovery, and have been used also by Microsoft in the XP days. There's a reason Apple picked them: it's aligned with their use case, and already assigned by what, 16 years or so? Probably also the context that you're missing, since that this post is actually somewhat a dupe.
- the_mitsuhiko 5y agoUPnP does not own this port. In the past that also hasn't been much of a problem as the port 5000 was opened by UPnP on the Router, not on localhost where Flask or other web servers are normally listening.
- marcellus23 5y agoSoftware should be written under the assumption that any given port can already be in use.
- deleted 5y ago[deleted]
- legulere 5y agoWhy does no web framework let the operating system give them a free port?
- Denvercoder9 5y agoBecause having the port change on every run is annoying for developers.
- masklinn 5y agoAnd it complicates quickstarts. “Open your browser to localhost:5000” is way easier than “look at the command line, find the line starting with “listening on”, copy the URL (hope you’re not such a beginner you’re unaware it’s C-S-c on linux and have just killed the process scrub), paste that in your browser.
- ratww 5y agoLots of them do. They try, for example, 8080, then 8081, then 8082, and so on.
- hk1337 5y agoWeb development frameworks should be easily overridden in case you have other conflicts or want to run multiple apps that default to the same port.
- ypcx 5y agoSimilarly, the port 7000 is taken by `afs3-fileserver`. (I've found yesterday when playing with Redis Cluster, https://redis.io/topics/cluster-tutorial#creating-and-using-a-redis-cluster https://redis.io/topics/cluster-tutorial#creating-and-using-...)
- gbraad 5y agoAnd so is 3000, 8000, 8080, 9000, etc. ... I don't understand the issue as it is easy to change.
- op00to 5y agoSomeone moved their cheese.
- AndyJames 5y agoIt's just a pain in larger organizations that's all. I met developers in my life that have no idea how any of the dev env work, they just code, so if setting up docker dev instance fails because of their machine it require someone else involvement and modifications in docs for the future. It's not a big deal but it may be pain in the ass for some organizations.
- JiNCMG 5y ago9000!!! In the PHP Dev environment, 9000 has been used for debugging for over a decade and the fpm-php project comes out and uses 9000 as their default. This is the definition of shooting yourself in the foot. Both solutions can easily switch ports but why choose 9000. It's not like xdebug was an obscure piece of software, it's the most widely used debugger on the platform.
- pjmlp 5y agoCommon where? I never used it in 25 years.
- thrower123 5y agoI've noticed a lot of new aspnet core stuff defaulting to using 5000 and 5001 lately, which is kind of weird when you are used to the way that VS used to use IISExpress with a random port number
- ppetty 5y agoWhat common web development server runs on 5000 that wouldn’t automatically increment or throw an error indicating the port desired was occupied and a different one should be used? This seems like a trivial problem.
- hulitu 5y agoBecause good security practices are so old time.