5/1/2026 at 3:34:38 AM
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...by zdw
5/1/2026 at 3:43:55 AM
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
by tolciho
5/1/2026 at 8:10:25 AM
And if they want name resolution, maybe even names that reflect the scope of its location like .localhost or .internalby lloeki
5/1/2026 at 2:13:36 PM
Various services have existed, such as portmap(8), though NFS and similar services have often suffered from the "too complicated to debug" problem where devops (then sysadmins) would try turning the system off and then back on again in the hopes of resolving the issue du jour. You might get lucky and determine that node number three (of many) was cursed and leave it switched off for the Season of Mammon, more commonly known as Christmas, and to retire it quietly, later. Hypothetically.Generally host and port mapping gets shoved somewhere into the configuration management layer and hopefully does not become too complicated (or have too many security holes) as this could vary from "configuration files and a few scripts" to database and services layers that few can debug, especially not a sysadmin at 3 AM in the morning running on an hour of bad sleep. Hypothetically.
by tolciho
5/1/2026 at 11:43:43 PM
but you want security, so NIS+by m463
5/1/2026 at 4:39:47 AM
Heck, maybe even `resolvectl service`?by otabdeveloper4
5/1/2026 at 5:13:16 AM
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.
by pratyahava
5/1/2026 at 5:32:32 AM
> http://...:gopheris it http or gopher? :)
by bandie91
5/1/2026 at 6:11:51 AM
i chose gopher port just as an example. try with any other service name mapped to a port number from /etc/services and the result will be the same. the OP's goal was to use many http/https services, so we are talking about many http(s) services.i just wanted to make the point that even if you have service names in /etc/services, it is not possible to use that names easily to host/access http(s) services.
by pratyahava
5/1/2026 at 1:55:15 PM
The names are the kind of servers that listen on those ports (by default) like ssh, telnet, http, and smtp. They are not subdomains or for URI parsing.by skydhash
5/2/2026 at 8:32:24 AM
URI contains ":port" tho, but practically it is only digital number.the OP made a tool which helps them to avoid using port numbers. people commented in a way that looked like laughing at him, like he reinvented the wheel, and talking about /etc/services. well ok, i decided to try using /etc/services for the purpose of using names instead of port numbers.
would it be possible to add "myapp 60001/tcp" to /etc/services and then work with "http://localhost:myapp"? NO! browsers do not translate these names into port numbers. netcat does. curl does not.
so probably the OP's solution is not that questionable and really solved their need? and "good old friend /etc/services" is not useful for this? i dont know what it is useful for as running services on non-standard ports actually helps with hiding from security/vuln scanners and is practiced widely.
by pratyahava
5/2/2026 at 11:43:46 AM
Maybe the joke has gotten too far, but the point that most people have been trying to say is that the issue that the OP is trying to solve has been solved for years. It's called a reverse proxy. Doing the configuration automatically like OP does does not alter the fact that it is a reverse proxy. `/etc/services` serve a different purpose.Also URL parsing is a completely different matter. Browsers are primarily an HTTP(s) client. If you do not mention the ":port", it will try to connect to 80 (HTTP) or HTTPS (443). Because that the default ports for a web server. Other services have different port. So if your URL has the ftp scheme, the default port would be 21.
by skydhash
5/2/2026 at 4:08:38 AM
I know you're trying to be funny but ... technically it's 100% clear: You should talk HTTP, because that's the URL scheme here. The port makes no difference. You just happened to use a port by name. For all we know I run my HTTP server on some NFS related port so all the script kiddies try all the wrong exploits on it or something ;)by tharkun__
5/1/2026 at 1:38:22 PM
Well, the entire context of this is https so anything else is immaterial. The only reason it would be gopher is if you didn't read the post or don't understand the basics of https.by jasonlotito
5/2/2026 at 6:11:34 AM
This is not possible since it is ambiguous. It is impossible to parse “http://127.0.0.1:gopher/“ since that would be valid as either “scheme://user:host/“ or “scheme://host:portname/“.“http://127.0.0.1:70/“ is unambiguous since 70 is not a valid host.
by laurencerowe
5/1/2026 at 5:11:29 PM
Sounds like you need an AI agent that can determine whether http and gopher are the same protocolby mrhottakes
5/2/2026 at 5:27:49 AM
if you configure sshd to listen on port 443, does it become an https server? i was just trying to demondtrate: pick any port from /etc/services and try to use the name instead of port number. no, it does not work well when trying to use for local-hosting http(s) services. so to address the irony and sarcasm of the messages i was replying to: zdw: 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: 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
by pratyahava
5/2/2026 at 12:00:50 PM
Many clients also do not support getservent(3) or portmap or DNS SRV records or NIS or LDAP or ActiveDirectory so one might wonder why there are so many half-baked, failed, or overy complicated attempts at solving whatever the problem is here even before "AI has entered the chat".by tolciho
5/1/2026 at 6:02:01 AM
As bandie pointed out, you‘re explicitly making a http request. Duh.nc is for generic connections and handles it well.
by Tepix
5/1/2026 at 6:14:12 AM
i know, but the OP's goal was to host/access http(s) services with names and avoid port numbers, and gopher service name was chosen by me as an example. my point was that /etc/services cannot be used for the OP's need.if you host an http(s) service on port 11111 you can reach it with url http://127.1:11111, but url http://127.1:vce/ would not work in most software.
$ grep 11111 /etc/services
vce 11111/udp # Viral Computing Environment (VCE)
vce 11111/tcp # Viral Computing Environment (VCE)
by pratyahava
5/1/2026 at 5:12:26 PM
If I curl my phone number it doesn't connect, that's strangeby mrhottakes
5/2/2026 at 8:49:15 AM
can you please explain what you mean by this? because technically i do not see any similarity in this "analogy".by pratyahava
5/1/2026 at 3:10:13 PM
But if you want to contact vce, why use „http“? It‘s not going to workby Tepix
5/1/2026 at 6:28:51 PM
Try http://127.0.0.1:hkp instead of http://127.0.0.1:11371 for an OpenPGP HTTP keyserver. HTTP will work, but using the service name won't. Does that make what they're trying to say clearer?by SAI_Peregrinus
5/2/2026 at 8:46:05 AM
the question was "can we use port names from /etc/services instead of port numbers?"how about "ssh://git@ssh.github.com:https/golang/go.git" instead of "ssh://git@ssh.github.com:443/golang/go.git"? does not work, hmm.
by pratyahava
5/1/2026 at 6:19:35 AM
Perhaps we could even make the file the port itself, perhaps calling it a “socket”? A “unix socket” would be a great name. If we could place all these files behind a local reverse proxy then we could use localhost/jekyll or localhost/fastapi. It’s just a dreamby meitham
5/1/2026 at 1:52:19 PM
That would mean not being able to vibe code up an entire app to deal with something as insurmountable as looking at a list of numbers and post it on HN for those sweet, sweet upvotes. Why would they not do that.by kjs3
5/1/2026 at 4:23:35 AM
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.by TomK32
5/1/2026 at 6:30:59 AM
If the port number space was bigger, I wonder if we would have gotten a global naming service (ala DNS) for unique service names.You can still publish port numbers along with addresses in DNS though (SRV records).
by fulafel
5/1/2026 at 6:42:34 AM
Not modern enough. Unix is too low level, antiquated, and discriminates against those who just want to get shit done instead of reading manpages or documentation by hand.by rdevilla
5/1/2026 at 1:36:15 PM
This is the best example of Poe’s Law I’ve ever seen. Well done…?by sgarland
5/3/2026 at 1:16:04 AM
[dead]by nullsanity
5/1/2026 at 6:08:20 AM
This is exact problem I see with all of those vibe coded software: In few years everything will be super fragmented, everyone will be using their own set of tools, or vibe coding them, themselves. Communication between teams or even between team members will become very hard because of those differences. 'What do you mean production is down? On my vibe coded dashboard everything is green!'by npodbielski
5/1/2026 at 6:19:58 AM
Why do people always assume that change is permanent?It's never.
After decentralisation we always see decentralisation. After a period of growth, a decline will follow. After the vibe coding hype, consolidation will follow. After rain comes sunshine.
by spiderfarmer
5/3/2026 at 2:41:21 PM
Well, I am forty years old. In twenty years I won't be working. We are in the dawn of AI software. If this will be decentralisation it will be at least 10 years of that. Probably more. So if fifteen or twenty years things will be going back to 'our normal' as we see today, I won't be concerned about all of it that much anymore. Perspective change with age considerably.by npodbielski
5/1/2026 at 2:52:28 PM
It’s the Lisp curse again.“[X] is so powerful that problems which are technical issues in other programming languages are social issues in [X].”
— <https://www.winestockwebdesign.com/Essays/Lisp_Curse.html#ma...>
by teddyh
5/1/2026 at 11:46:18 PM
[dead]by m463
5/1/2026 at 1:11:28 PM
You have to be root to edit /etc/services ...by amelius
5/1/2026 at 7:20:15 PM
I am pretty convinced you need root on most systems to update DNS resolution mechanism system-wide (eg. to edit /etc/hosts or run a local DNS server and put that into /etc/resolv.conf).by necovek
5/1/2026 at 10:09:07 PM
Technically you can set the HOSTALIASES variable to point to a custom hosts file, but that only works with programs that use gethostbyname(3). (Which is most of them? IDK.)by MarsIronPI
5/1/2026 at 7:33:26 AM
Top reply, and clearly based on the article's title rather than its content, as are the follow-ups. You're making this site worse.The article is short; go read it then come back and delete.
by maeglin
5/1/2026 at 8:27:51 PM
The article is about the dude not knowing what service is where so he codes a json mapping. He could just update his /etc/services for the same thing. Oh but wait, he mentioned ai agents that changes everything!by halJordan
5/2/2026 at 8:55:23 AM
can you please demonstrate the workflow you are suggesting? asking because i tried what you suggest, and it does not work.by pratyahava
5/1/2026 at 2:23:55 PM
Sounds like more of a problem with the title than the person you're attempting to insult.by stronglikedan
5/1/2026 at 3:15:59 PM
[dead]by sieabahlpark
5/1/2026 at 8:11:10 AM
[flagged]by nsowz
5/1/2026 at 9:05:53 AM
you go and look in etc services for what is bound to port 5009. the article might not be the most useful but these comments are completely off the mark and stupid.by saidnooneever
5/1/2026 at 1:54:39 PM
The hosts file is enough, what is needed is a way to assign an ip address to a process/service like you can with port numbers.by afiori
5/1/2026 at 7:23:21 PM
You can trivially have a server process bind a listening socket to eg. 127.4.3.19.by necovek
5/1/2026 at 7:55:07 AM
[flagged]by imtringued
5/1/2026 at 8:44:17 AM
Why?by ai_slop_hater
5/1/2026 at 9:16:26 AM
What's up with the hate? It seemed like an interesting project to me, maybe not something I see myself using, but not something deserving hate.by stavros
5/2/2026 at 3:44:49 AM
Maybe not hate, but I think that kind of blog, and every single person posting AI slop to LinkedIn, deserve to be shamed publicly for that. It's just that no one does that, and those who do are frowned upon, and down voted to death, like here. The reason I asked "Why?" was to confirm that in fact there are others who think doing that is shameful, that I am not the only one. The outcome is disappointing.by ai_slop_hater
5/1/2026 at 7:15:18 AM
What about identifying different instances of the same service?by loa_in_
5/1/2026 at 1:30:32 PM
URLs already have default ports for service names as a feature.http:// means port 80 unless specified otherwise
https:// means port 443 unless specified otherwise
ftp:// means port 21 unless specified otherwise
sftp:// means port 22 unless specified otherwise
...
The practical solution for TFA is actually just an nginx server running on port 80 with proxy_pass
location /blog/ {
proxy_pass http://127.0.0.1:3000 ;
}
location /tensorboard/ {
proxy_pass http://127.0.0.1:6006;
}
...
by qurren
5/1/2026 at 2:32:11 PM
How many little web servers work without issue when their root page is loaded from a path other than /?by jameshart
5/1/2026 at 3:05:39 PM
If that's your concern you can also do this server {
listen 80;
server_name "tensorboard.localhost";
location / {
proxy_pass http://127.0.0.1:6006;
}
}
server {
listen 80;
server_name "blog.localhost";
location / {
proxy_pass http://127.0.0.1:3000;
}
}
HTTP 1.1 and later will have the browser supply the domain name that was used to access the site, and even though *.localhost all resolve to 127.0.0.1, nginx will pluck out the correct configuration and proxy_pass the correct one.
by qurren
5/1/2026 at 8:25:53 PM
That's because there defines in etc services (really the place where etc services gets its mapping). You're putting the cart in front of the horseby halJordan
5/1/2026 at 5:12:14 PM
The best way to find the right answer on the Internet is to slop-code a half-assed solution to a long-solved problem.https://meta.wikimedia.org/wiki/Cunningham%27s_Law
Sidenote: A good AI would interject, Clippy-like, "It looks like you're trying to recreate /etc/services. Would you like me to explain what that is?"
by xnx
5/1/2026 at 6:01:04 AM
> 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.
by locknitpicker
5/1/2026 at 6:27:37 AM
You forgot the /s at the end.by nesarkvechnep
5/1/2026 at 1:28:47 PM
All our bookkeeping is now in YAML. Watch the spaces on your way out the door.by adestefan
5/1/2026 at 6:49:09 PM
Learning nixos had been a lot of fun for me.Your comment unironically is something I prefer and one of my biggest pain points with Linux.
As a newb, I'm sure there's something called with a mycommonproblemd name that has a stateful interface. But sometimes that all adds up to make things feel complex. And it let's me make stupid mistakes, like I forgot to close or open a port on firewalld, or I disabled a container but forgot to commit a change to my systemd units.
It's nice to just have a nice file called myservice.nix that tracks the firewall port, name, systemd startup and update scripts.
by data-ottawa
5/1/2026 at 1:41:32 PM
And don’t forget to quote your port assignments and version strings.by sgarland
5/1/2026 at 2:44:48 PM
Hacker News loves to make snarky comments about everything to do with K8s and YAML all the time, and yet in my experience the amount of times an issue was caused by actual YAML can be counted on one hand.Way more often it’s developers who can’t figure out that their http library only supports 2 concurrent connections, or emit garbage/malformed log lines and then bitch that they can’t see their app logs because we dropped them, or can’t be fucked to do “kubectl describe” in their own developer namespace that they have full permission for.
If you truly experience issues with just using YAML then you need to skill up probably.
by pirates
5/1/2026 at 6:38:28 PM
Most of the issues with YAML are really issues with people who think that since "configuration as code" is good, that "code as configuration" must also be good.by SAI_Peregrinus
5/1/2026 at 1:36:34 PM
No, go ahead. Tell me how just using /etc/services does what this does. Because I'm calling bullshit.But go ahead. /etc/services, please, share with me how it's setup to do thing likes create the HTPS and makes it trusted and sets up the domain. Go ahead.
Go ahead. You can ONLY use /etc/services.
Or, you are admit you don't actually have a clue as to what /etc/services does.
by jasonlotito
5/1/2026 at 5:16:21 AM
[dead]by huflungdung