3 ms·
I'm not sure there would be any difficulty supporting Unix socket paths in your URI scheme? I guess you can just steal the semantics from the file:// scheme. O
by fulafel 7y ago
I'm not sure there would be any difficulty supporting Unix socket paths in your URI scheme? I guess you can just steal the semantics from the file:// scheme.
Or do you want the same URI scheme to support all your different transport protocols? It kind of feels like missing the point of URIs, after all the whole idea is that your application can interchangeably handle different kinds of URIs for different use cases.
- derefr 7y agoYes, in my ideal world, URIs would be a sequence of "steps" to resolving a resource, where each step starts off with a nominal "resolver object" it's working against, and then names a scheme (method) available upon that resolver object, where the rest of that step of the URL are then method parameters to that abstract call, resulting in either another "resolver object", or a fully-resolved resource. The scheme of the final step then determines the protocol for the interaction with the resource. This is somewhat, but not perfectly, analogous to how 9P mounts work in Plan9. In both models, you start off with your local namespace, which has servers mounted on it like /mnt/web or /mnt/ftp. These are the "schemes" available on the initial resolver object. You then build a path to a virtual file within one of these mountpoints (/net/tcp, say), where that path turns out to point to a resource that describes (in a format another 9P server understands) how to create another mount representing that connection. The difference between the two models is that, with 9P, you'd have to take this descriptor file and mount it yourself; whereas in my model, you wouldn't see a descriptor file, but rather another already-mounted server, with its own schemes as its root-level exposed virtual directories. Pretending 9P worked this way, you'd be able to have a namespace path that looks like, e.g.: /net/tcp/foo.com/80/http/patha/pathb/a=b/c=d Back in URL land, this kind of path would correspond to a "meta-URL" that looks like e.g.: tcp:foo.com:80#http:/patha/pathb?a=b&c=d where the "#" symbol now takes on new significance as a command for the URL resolver, to address the next part of the path to the resolver-object discovered by resolving everything on the meta-URL so far. (Which perfectly subsumes #'s current use, since browsers interpret a # as identifying a particular DOM-tree node within a document—i.e. as using the resource acquired from the previous URL-step as a resolver to find the next object.) You could do all sorts of crazy things with this, too, like creating URLs that represent files available within archives that exist as HTTP streams, e.g.: tcp:/foo.com/80#http:/foo/bar.tar#file:/index.html Or adding DNS or TLS arbitrarily into protocol stacks that weren't designed for them: ip:/dns/foo.com#tcp#tls#irc:%23room