-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propose httpath
as an official extension to multiaddr
format
#42
Comments
I've proposed It's currently using a "private" code
I guess there's a decision to be had here about how you handle a transition period and what kind of period that is. Do you perpetually support |
Thank you for getting this sorted @rvagg 🚀 WDYT @gammazero ? |
I would avoid using Take for example the multiaddr: Now, what happens when a node advertises a libp2p QUIC address as well? e.g. I think there are two separate things we're trying to solve:
Trying to do both things in a Multiaddr seems to introduce an MxN problem when you really only need an M+N solution. |
I think of the http prefix as part of the "where is this thing" - that if i have a middle box translating the mount point where my endpoint is in a sub-directory rather than the root of a web server, i now have this http-level path semantic to follow. I think it isn't unreasonable to argue that this parallels the type of path following we already allow when we use multiaddrs of the form I don't think we really want to say "you can't pass around a multiaddr as a full address" - to need both a multiaddr and some other struct indicating where ipni is seems unwieldy, and would mean we re-spec how to follow http paths in each HTTP-compatible protocol. You are right that we are using different semantics in this context of multiaddr, and i think that's maybe okay? I would intuitively think of it as |
Yes. I agree, I'm saying this is an application level concern rather than a node-routing concern (where do I find this node?) and multiaddrs have primarily been concerned with how do I get to the node rather than "how do I ask the node for a specific thing".
Ah okay. So this is used in a specific application context. I think that makes this better. I would push for trying to make it clearer somehow this isn't the same as the node's multiaddr. Maybe skip the part that describes how to reach the node? That would solve the MxN problem here as well. Something like
I think so. I'm pushing on this this week so expect an update in libp2p/specs. That's also why I'm trying to caution against adding the protocol specific stuff to the node's multiaddr since soon you'll be able to speak HTTP on every multiaddr, so having this only on multiaddrs that end in There's also going to be a built-in way of specifying custom mappings for protocols. Libp2p will know if the |
+1 on being careful with leaking HTTP semantics onto protocol-agnostic Multiaddr spec. After all, paths are not special, it is only one of many attributes that may impact HTTP endpoint's behavior. If we allow HTTP paths, the unanswered question is: how one adds basic auth or bearer token headers? or a cookie? or an Accept header for content type version negotiation? There are prior discussions in
which.. went nowhere. So far, every time someone tries to clean this up in a generic way, they read the above threads, see the interop problems and the spec work that needs to happen, and end up using plain old Adding a top level I've seen how much trouble new codes create across the stack, I am unsure if it is net positive. Once the code exists, people will start using it, leaking more HTTP onto multiaddrs, and then they will ask for support in non-IPNI cases, which creates even more maintenance work across libraries and apps.
Using Multiaddr for representing a specific path location of non-libp2p HTTP service feels very odd. It was probably discussed before, but if this is specific to IPNI, and in controlled environment, then why not use |
I've written down what I believe are the libp2p stack's expectations of the |
we support both an HTTP and a libp2p fetch of data. we have a single multiaddr currently that signals if the fetch is over graphsync vs over http. |
I changed some of my thoughts here.
I still think this opens the door to an MxN combination of M multiaddrs and N resources, but that's something application authors can work around or accept (Maybe they have a single The things that changed my mind are:
|
This is now an official part of multiaddr: multiformats/go-multiaddr#246 |
httpath
is used by IPNI to allow additional path in a HTTP URL expressed inMultiaddr
format. Propose it as an official extension toMultiaddr
and move the implementation to relevant repos inlibp2p
/multibase
orgs.The text was updated successfully, but these errors were encountered: