libp2p / specs

Technical specifications for the libp2p networking stack
https://libp2p.io
1.55k stars 274 forks source link

http: document how to reference http resources #554

Open p-shahi opened 1 year ago

p-shahi commented 1 year ago

Paraphrasing @MarcoPolo "HTTP semantics can run on top of any transport. So these need to be able to be defined on top of any multiaddr not just ones that end in /http" (as documented in https://github.com/libp2p/specs/pull/550)

MarcoPolo commented 1 year ago

Context for this issue is that Juan asked that we define a way to reference HTTP resources in multiaddrs sooner rather than later because:

This introduces a new way of using Multiaddrs that we haven't seen much in practice (With the exception of IPNI's use of a custom multicodec httpath https://github.com/ipni/go-libipni/issues/42). Multiaddrs have primarily been used as a way of describing how to reach a peer. With this, multiaddrs will describe how to reach a resource.

Prior discussion: https://github.com/multiformats/multicodec/pull/324 https://github.com/ipni/go-libipni/issues/42

MarcoPolo commented 1 year ago

My current thinking is that /httpath (or /httppath, my preference) is a reasonable solution to this. This can be appended to any transport and defines where an HTTP resource exists and the transport used to address the peer that has this resource. More details here: https://github.com/ipni/go-libipni/issues/42#issuecomment-1601372891

MarcoPolo commented 1 year ago

PR here: https://github.com/multiformats/multiaddr/pull/164