logoalt Hacker News

quotemstrtoday at 4:13 PM2 repliesview on HN

Christ Almighty I hate our industry practice of binding to some inscrutable port number on localhost. Unix domain sockets aren't that hard! They're secure against all sorts of attacks and more convenient to boot. Instead of connecting to a number, you connect to a file. An ordinary file, with an ordinary name you can mv, chmod, and rm. Boring on a good way.

So why doesn't everyone run local services over Unix sockets?

The only problems: 1) web browsers don't support AF_UNIX URI scheme, and 2) ancient versions of Java don't have built-in APIs for AF_UNIX sockets.

That's it. For these trivial reasons, we've beat our head against arbitrary opaque numbers for decades.

And so, for want of a nail, the Unix was lost.


Replies

0x457today at 4:42 PM

Some random daemon binding to 3000 because it's the express default drives me nuts. I either do a Unix socket, a pick any random port if it has to bind on a port.

formerly_proventoday at 4:18 PM

> So why doesn't everyone run local services over Unix sockets?

> The only problems:

3) 40 years of Windows not supporting UDS.