- From: Peter H. Jin <notifications@github.com>
- Date: Tue, 21 Jan 2025 17:16:57 -0800
- To: whatwg/url <url@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/url/issues/577/2606072896@github.com>
> [@randomstuff](https://github.com/randomstuff) > > > Something like name.system.uds.localhost and name.username.users.uds.localhost would work nicely... > > Hmm - rhetorically, how does a hostname of the form which you suggest, having the top-level domain "localhost", get routed around the Internet? I do not understand what you are describing there. Can you be more specific? > > You could use the "userinfo" component of the "authority", preceding the "@" delimiter, to customize the effect of the URI. From the RFC, Section "3.2.1. User Information": > > ``` > The userinfo subcomponent may consist of a user name and, optionally, > scheme-specific information about how to gain authorization to access > the resource. The user information, if present, is followed by a > commercial at-sign ("@") that delimits it from the host. > ``` > > Did you mean something like that? @randomstuff's "soxidier" tool maps domain names to unix domain sockets, such that if the user went to http://name.username.users.uds.localhost/foo/bar then it would be effectively connecting to e.g. `/home/username/name`, and making the request `GET /foo/bar HTTP/1.1`, with the possibility of using symlinks to redirect connections to other sockets outside of this pattern. In this way, the syntax of the URL is not changed, as it looks like a normal URL with a domain name. Only the interpretation of the URL in terms of the network stack is changed. Mapping domain names or IP addresses to unix domain sockets may be a bit hacky, but the mappings can be automatically generated and managed with scripts, SQL tables, and/or similar. This basically shows that it is not necessary to modify the URL syntax to merely connect to a Unix domain socket, because as I've said, there are many URL parsers which would have to be updated, and it's not really practical to modify every one of them. But modifying the URL syntax still has a few advantages. For example, you might have an app that may print out something like this on the console: ``` =================================== To view a preview of your website, go to http://unix:/var/run/whatever.sock:/foo/bar?query=string in your browser. =================================== ``` With both my and @randomstuff's solutions, one would have to register the Unix domain socket in the respective tools. But embedding the unix path in this manner does not have this restriction. -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/url/issues/577#issuecomment-2606072896 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/url/issues/577/2606072896@github.com>
Received on Wednesday, 22 January 2025 01:17:01 UTC