Re: [whatwg/url] Addressing HTTP servers over Unix domain sockets (#577)

> Could the [`.alt` special-use TLD](https://datatracker.ietf.org/doc/rfc9476/) be used? "This top-level label can be used as the final (rightmost) label to signify that the name is not rooted in the global DNS and that it should not be resolved using the DNS protocol."
> 
> e.g.:
> 
>     * http://1234.vsock.alt:5678/whatever
> 
>     * http://%2frun%2fuser%2f1000%2fproject.sock.unix.alt/whatever
> 
>     * http://%00mysocket.unix.alt/whatever (abstract namespace)

Sure, you could have a different TLD for the unix domain socket namespace, but it's still not intrinsically part of the url standard.

If you go to https://jsdom.github.io/whatwg-url/#url=aHR0cHM6Ly9uYW1lLnVzZXJuYW1lLnVzZXJzLnVkcy5sb2NhbGhvc3QvZm9vL2Jhcg==&base=YWJvdXQ6Ymxhbms= you see that the hostname portion of the URL http://name.username.users.uds.localhost/foo/bar is `name.username.users.uds.localhost`.

The ability to connect to a unix socket in this manner is realized because `name.username.users.uds.localhost` or `1234.vsock.alt` is interpreted **at the DNS level** to be meaningful (i.e. related to unix sockets), rather than at the URI level.

As I've said before, the interpretation of DNS names at the DNS level is operating system dependent and is modifiable by various subsystems. And, it is still necessary to parse the hostname as a domain name to determine that it has a tld of .alt in the first place.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/577#issuecomment-2606924716
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/url/issues/577/2606924716@github.com>

Received on Wednesday, 22 January 2025 10:59:16 UTC