-
Notifications
You must be signed in to change notification settings - Fork 85
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
Defining /http #63
Comments
The open questions to me are:
Question mark is fine, slash could be also fine if libraries stopped to just split on every slash. Instead, string multiaddrs should probably be parsed step by step, with every protocol reading as much of the remaining bytes as it thinks is neccessary.
These look good to me for a start Encapsulation in a path protocol
Yep -- we'll still want to anticipate a way to encapsulate stuff within a path protocol though, e.g. a websocket at specific http path or /ipfs over a unix socket. In the binary form it's fine (everything is length-prefixed), but in the string/human-readable form it's tricky since we rely on forward-slashes to delimit protocols and values. There's several options:
We should split this particular question into a separate issue. Host headerThere is one more thing to consider which is the Host header. All other http headers I can think of don't matter for addressing the endpoint since they only deal with representations and encodings, but the Host header is actually crucial for addressing. The most elegant option seems to be Query string, fragment, authenticationTwo more things that matter for addressing are query strings and fragments. I have a hunch they can just be represented as they are in a URL, e.g. I think authentication ( ProxyingThis can likely be as simple as a |
Hey, I think that we should definitely advance with this topic. The initial examples provided by @victorbjelkholm are good, and we can add other examples that we intend to support, in order to find a uniform solution for all of them. Regarding @lgierth notes, I agree in every aspect, except the |
That's fine, it can be a separate multiaddr protocol, so people can use |
I see... Adding a special protocol for this special case seems fine for me then! |
Has there been any progress with this? |
Bikeshed + more detailed spec proposal:
…and also this:
…while these should be also invalid (ie: not equivalent to any of the above!):
As mentioned above the extra braces around HTTP's value should always be allowed, but only required if there is some other protocol wrapped within. Such as:
The canonical representation should always be the one with the least number of braces – reducing the number of bytes required and improving readability. Libraries should always emit the canonical representation and must accept both forms. All of this of course also applies for Unix sockets and whatever else we find in terms of path-like protocols. Sounds good? If you disagree on by bikeshed's color please also reply so that we can sort this out quickly. 🙂 |
I have two small concerns with that:
So, what if we just made it mandatory? That is, |
@vasco-santos you objected to the encapsulation. Mind taking a look at my comment? |
@Alexander255 please paint this bikeshed. |
Have a bunch of notes on /http, putting a TODO for myself here |
@Stebalien: I have an alternate proposal for solving this at #87: Since, as you correctly pointed out, the path is optional for
More examples:
(It also also comes an exact description of the proposed text syntax that is not reproduced here.) This would also allow for your proposed case of painless concatination ( Let me know what you think. |
I've taken a look, written a comment, and closed my browser. I'll try to comment on that issue ASAP. Making multiaddr solid is going to be really important. |
Putting the issues of additional key-value params (#87) and encapsulation-in-paths aside, my instict is we should have
I don't neccessarily see a need for expressing cookies and other data in To me it seems we'd only want what's neccessary to route the connection to the correct remote endpoint. That includes e.g. fingerprints of remote public keys to authenticate the other end, but I'm not convinced it should include authorization (session cookies). |
What about unix domain sockets? We can probably just use TLS doesn't necessarily require domains. What if we make the "sni" argument configurable? For example: I agree cookies are a separate issue. Multiaddrs shouldn't touch bearer tokens. |
What about them? There's no hostname there, just
I have a hunch we'll have an easier time going with separate protocols for variations of TLS, rather than parameterizing one protocol -- e.g. something like You'll notice I'm trying to avoid parameters :) But if we really have to, we can do it. |
My point is more that domain names don't really make sense in that context.
It would be nice to support Actually, this brings up the issue of libp2p support. For example, we now have the |
@lgierth: So parameters are off the table? For what it's worth I've updated the proposal to include a relatively compact binary representation for parameters, but maybe a more customized parameter-type-specific approach may be worth the hassle to get rid of some extra bytes.
How do you express “send SNI X and expect fingerprint Y in response” with this? Add an extra Just saying – obviously we disagree on this. 😉 |
Motivation for revisiting: ipfs/kubo#6560 Summary so far:
Questions:
|
We had a small discussion about that within Parity. |
Thanks for making that simpler! We're going to have a meeting on zoom (https://protocol.zoom.us/my/stebalien) at 15:00 UTC Thursday (today?) in case you'd like to join (or @Alexander255). The goal is to unblock ipfs/kubo#6560 without hating ourselves in the future so we're going to avoid trying to solve the entire problem all at once (just avoid hating ourselves in the future). |
Dumping my notes from meeting:
|
I think that this question has been open for almost 2 years now, and I've been in at least 2 meetings that have extensively discussed this exact thing. Maybe it is time for a decision, which is arbitrary anyway, and not just raise the question again. |
@lidel: Your “two” proposals are both technically identical to my proposal in #87, except for one of them using a different (an IMHO less readable) string-representation for the MultiAddr. If there is now consent on the requirement that we need an “arbitrary parameter”-extension for MultiAddr either way, that means we now just need to decide on the syntax, right? |
@Alexander255 yes, those were just quick examples, I prefer the first one more as well :) Thank you for creating #87, it states the problem space nicely. ps. I believe if someone wants to work on this, improving multiaddr SPEC would be the first step 🙏 |
Just wanted to point out that |
This issue has been pretty stale over the recent years, even if it is one of the most major issues of the multiaddress-scheme... I suggest to not over-complcate the addressing-scheme with parenthesis. Proposed formatUnix paths interpret '//' and '/' the same which is technically ok and could be human-interpreted as '/./.' as the '/' symbol does not name a file (or directory, etc.) this leeway is not given in a multidomain addressing scheme and as the implementations I have looked at interpret it as an encoding error as only single '/' are allowed. This can be updated in the following that unix (http, etc.) search for a '//' symbol (word, whatever...) which marks the end of the path.
The more correct wayA path specification on a single domain (file-system, etc.) does not have to deal with switching protocols, to update this one could encode every part of the path with its protocol e.g.
This is tedious and I don't recommend it. |
This should be resolved with libp2p/specs#550 |
Currently, libraries are implementing
/http
while it hasn't been defined 1 2. We should catch up with the implementations and define it, then implement the behaviour.As far as I know:
/tls
to supporthttps
./unix
), meaning no further multiaddrs can follow specifying/http/a/b/c
as we don't know when it ends. This is a general problem for path protocols (currently just/unix
)?
,/
and other characters that might confuse multiaddr. Encode them maybe?Examples:
https://1.2.3.4:5001/api
=>/ip4/1.2.3.4/tcp/5001/tls/http/api
http://1.2.3.4/api
=>/ip4/1.2.3.4/tcp/80/http/api
http://1.2.3.4
=>/ip4/1.2.3.4/tcp/80/http
http://1.2.3.4/api/
=>/ip4/1.2.3.4/tcp/80/http/api/
(keeping trailing slash)Issues mentioning
/http
and/tls/http
(https)The text was updated successfully, but these errors were encountered: