Top
Best
New

Posted by graiz 2 days ago

I Got Sick of Remembering Port Numbers(gregraiz.com)
43 points | 27 comments
zdw 1 hour ago|
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...
tolciho 1 hour ago||
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
pratyahava 6 minutes ago|||
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 0 and 65535
so the ports are named, it is nice, but in practice it does not make life easier.
otabdeveloper4 39 minutes ago|||
Heck, maybe even `resolvectl service`?
TomK32 55 minutes ago|||
Sure, but they are running web-apps they've vibe-coded (hence the .vibe tld) and for that use-case of many web apps that I run in docker containers I use nginx-proxy [0]. All the container needs is a VIRTUAL_HOST environment variable with the domain and what my router needs is an address entry for the wildcard subdomains. I even have nginx-proxy on a internet-accessible staging server.

[0] https://github.com/nginx-proxy/nginx-proxy

huflungdung 3 minutes ago||
[dead]
hotfixguru 11 minutes ago||
Vercel’s portless is a great alternative, but unfortunately it doesn’t work well with oauth flows. I’ve built portmap[0] to solve that. Also comes with skills which makes it work really great with coding agents (instructions in the readme).

[0] https://github.com/JonasKs/portmap

lainzhow 8 minutes ago||
I wonder why not use nginx and some local DNS settings to just serve all these local services under a new, local URL.

Not too long ago I had a similar issue and solved with that.

arjie 45 minutes ago||
This is a valid concern, certainly. I use kube for most things so it's not a problem, but my homeserver and its apps run on quadlets that I manage. In my case, I just added a README.md in the server account folder that each project's CLAUDE.md or whatever is configured to read. Then it selects a port and sticks that in the document and to be honest I have a few tens of services and it works. Haha, a direct replacement of machine for my own process.
pyreal 1 hour ago||
I created something similar to help me spin up complex apps in multiple worktrees with full port orchestration: https://outport.dev/
isodude 22 minutes ago||
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.
tdeck 16 minutes ago|
Does this work in the browser? How will paths to different resources used by the web app work?
magicalhippo 19 minutes ago||
I know it's mixing of layers, but I can't help but feel the IPv6 transition missed the boat when they didn't just get rid of ports in the process. They've changed so much else anyway.

Want to run another webserver instance or whatever on your computer? Get the OS to allocate a new IP for it. Ports be damned.

Could be implemented in a backwards compatible way by requiring all IPv6 TCP/UDP traffic to use a fixed port number.

CGamesPlay 56 minutes ago||
I've built this twice before. The main problem that I hit is that the AI agents suck at the process lifecycle management: leaving processes alive, starting the same daemon multiple times, etc.

From a brief glance over the code I like the approaches I see. Using the `/etc/resolver/` mechanism is a new trick to me!

The interesting part to me isn't the port numbers, it's the automatic service start/stop, including idle route shutdown.

tdeck 18 minutes ago||
What is the benefit of using HTTPS for this particular use case?
kasperni 1 hour ago|
Not the same, but omeone recently posted this "port" tool here on HN: https://github.com/raskrebs/sonar
thunderbong 52 minutes ago|
HN Thread

https://news.ycombinator.com/item?id=47452515

More comments...