Live data from Hacker News

I Got Sick of Remembering Port Numbers

gregraiz.com

101–110 of 171 posts

Re: I Got Sick of Remembering Port Numbers

#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 ;
    }

    location /tensorboard/ {
        proxy_pass http://127.0.0.1:6006;
    }
...

Re: I Got Sick of Remembering Port Numbers

#102
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...

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.

This is the best example of Poe’s Law I’ve ever seen. Well done…?

Re: I Got Sick of Remembering Port Numbers

#103
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...

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.

Re: I Got Sick of Remembering Port Numbers

#104

Earlier quoted context omitted.

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…

> http://...:gopher is it http or gopher? :)

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.

Re: I Got Sick of Remembering Port Numbers

#106
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...

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.

Re: I Got Sick of Remembering Port Numbers

#107
post #78

Earlier quoted context omitted.

[flagged]

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.

Re: I Got Sick of Remembering Port Numbers

#108

Earlier quoted context omitted.

> http://...:gopher is it http or gopher? :)

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.

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.

Re: I Got Sick of Remembering Port Numbers

#110

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.

Portless is a great tool for this! I use it for all my apps now. Zero config + built in HTTPS locally.

https://portless.sh/

Example from the website:

- "dev": "next dev" # http://localhost:3000

+ "dev": "portless myapp next dev" # https://myapp.localhost

Post reply on HN