Live data from Hacker News

I Got Sick of Remembering Port Numbers

gregraiz.com

141–150 of 171 posts

Re: I Got Sick of Remembering Port Numbers

#141
post #121

Earlier quoted context omitted.

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 C…

But if you want to contact vce, why use „http“? It‘s not going to work

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?

Re: I Got Sick of Remembering Port Numbers

#142

Earlier quoted context omitted.

And don’t forget to quote your port assignments and version strings.

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 dr…

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.

Re: I Got Sick of Remembering Port Numbers

#143

Earlier quoted context omitted.

You forgot the /s at the end.

All our bookkeeping is now in YAML. Watch the spaces on your way out the door.

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.

Re: I Got Sick of Remembering Port Numbers

#144
post #98
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...

You have to be root to edit /etc/services ...

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).

Re: I Got Sick of Remembering Port Numbers

#145
post #107

Earlier quoted context omitted.

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.

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.

You can trivially have a server process bind a listening socket to eg. 127.4.3.19.

Re: I Got Sick of Remembering Port Numbers

#146
post #101
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...

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 ; } l…

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 horse

Re: I Got Sick of Remembering Port Numbers

#147
post #71
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...

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.

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!

Re: I Got Sick of Remembering Port Numbers

#148
post #98

Earlier quoted context omitted.

You have to be root to edit /etc/services ...

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).

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.)

Re: I Got Sick of Remembering Port Numbers

#149
post #127

Earlier quoted context omitted.

What do you mean? You’ll still have to use TCP or UDP over IPv6, and both of those protocols use ports. Nothing is stopping you from creating a transport protocol that doesn’t use ports if you want to, but that has nothing to do with the network layer.

I mean that to connect to a service you wouldn't need to know the port, the IPv6 address would be enough. This is why I consider ports a layer violation of sorts. You never talk to a machine with TCP/UDP, you talk to a service on a machine. And so as it is the full address to the service isn't just the layer 3 address. As I mentioned this would be especially interesting when hosting multiple services, same or differe…

Yeah, but I mean you just have to have something on the transport layer, you can't just encapsulate application layer into network skipping network, that's not how the network stack works.

Re: I Got Sick of Remembering Port Numbers

#150
post #77
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

And if they want name resolution, maybe even names that reflect the scope of its location like .localhost or .internal

but you want security, so NIS+
Post reply on HN