Live data from Hacker News

I Got Sick of Remembering Port Numbers

gregraiz.com

41–50 of 171 posts

Re: I Got Sick of Remembering Port Numbers

#42
There is no need to come up with "local TLDs" like .vibe, .local, .test and so on -- there is already an industry convention! macOS and most Linux distros support subdomains of localhost, so .localhost works. You still need the reverse proxy to do the host->port mapping, but you save yourself local DNS fiddling.

Re: I Got Sick of Remembering Port Numbers

#44

There is no need to come up with "local TLDs" like .vibe, .local, .test and so on -- there is already an industry convention! macOS and most Linux distros support subdomains of localhost, so .localhost works. You still need the reverse proxy to do the host->port mapping, but you save yourself local DNS fiddling.

> There is no need to come up with "local TLDs" like .vibe, .local, .test and so on -- there is already an industry convention! macOS and most Linux distros support subdomains of localhost, so .localhost works.

That would work if your goal was to route traffic to localhost.

What if it isn't?

There are reasons why the likes of example.com exists.

Re: I Got Sick of Remembering Port Numbers

#45
post #6

It's like someone should make a file... maybe in /etc ... and put short names for services in it... maybe it could be called /etc/services...

> It's like someone should make a file... maybe in /etc ... and put short names for services in it... maybe it could be called /etc/services...

People shit-talk container orchestration systems like Kubernetes, but if anything they greatly simplified (if not completely eliminated) the need for this sort of network bookkeeping.

Re: I Got Sick of Remembering Port Numbers

#46
post #7

Earlier quoted context omitted.

And then they might code up some sort of service lookup tool thingy to use on the train wreck that is the modern web. $ getent services gopher gopher 70/tcp

this is a nice idea, but idk why, in macos if i do `nc -l 127.0.0.1 gopher` and then try to open url " http://127.0.0.1:gopher/ " - safari does not open it, no requests visible in the `nc` output. also `curl -v http://127.0.0.1:gopher/ ` gives error message * URL rejected: Port number was not a decimal number between 0 and 65535 * Closing connection curl: (3) URL rejected: Port number was not a decimal number between…

As bandie pointed out, you‘re explicitly making a http request. Duh.

nc is for generic connections and handles it well.

Re: I Got Sick of Remembering Port Numbers

#49
This is a neat approach. One thing I wonder about is how it handles services that use the same port number across different protocols (like 443 for both HTTPS and SMTPS). The /etc/services file approach has the same ambiguity, but at least it lists the protocol alongside the port. A lookup table that includes protocol would be more robust for mixed environments.

Re: I Got Sick of Remembering Port Numbers

#50
post #27
post #23

Why not resolve everything with UNIX sockets instead, that way you can have them named and scoped instead, hiding behind port 443, since it's mosly HTTP anyway.

Does this work in the browser? How will paths to different resources used by the web app work?

works with curl, maybe there is a case to either build a proxy for UDS and expose them to a browser, or open a request ticket to browser maintainers to support UDS
Post reply on HN