| ▲ | pratyahava 5 hours 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. |
|
| ▲ | bandie91 4 hours ago | parent | next [-] |
| > http://...:gopher is it http or gopher? :) |
| |
| ▲ | pratyahava 4 hours ago | parent [-] | | 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. |
|
|
| ▲ | Tepix 4 hours ago | parent | prev [-] |
| As bandie pointed out, you‘re explicitly making a http request. Duh. nc is for generic connections and handles it well. |
| |
| ▲ | pratyahava 4 hours ago | parent [-] | | 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)
|
|