-
Notifications
You must be signed in to change notification settings - Fork 299
Using a multiaddr with DNS fails connect to IPFS node #712
Comments
@charlescrain we actually never added DNS support to js-ipfs-api client, but it definitely should work. Looks like this is a good first contribution for anyone to take. Would you like to give it a try? |
Yeah I'll give her a shot! |
Hello @charlescrain @diasdavid , I gave a look at this issue and I have a few notes regarding it. Firstly, the currently supported format for a Multiaddr is All things considered, we may accept @charlescrain Taking into account your use case, I think it would be used as follows (53 is the standard port of var maString = '/dns4/ipfs.infura.io/tcp/53';
var ma = Multiaddr(maString); @diasdavid What do you both think about this approach? Other solution can be the solution that I proposed in #581 (comment). If we support a specific hostname, in this case, we could use the DNS address directly. |
hrm... this seems to be a legit issue. When I try this code with one of our bootstrap nodes it also fails. |
Are you using a multiformat address with |
multiaddr as-is does miss some features to be specified, having proper DNS support is one of them and is why The second part would be which port to use, in this case we want to use Third part is which protocol to use. This is the part that is a bit under-specified right now. The current thinking (@lgierth, correct me if I'm wrong) is to use So the full multiaddr that has to be supported by the Steps for moving forward with multiaddr is outlined over here: multiformats/multiaddr#62 |
Yes, what @victorbjelkholm said - and In http(s) URLs, the hostname serves three purposes: DNS lookup, TLS SNI, and HTTP Host, all at once. This coupling of course limits applications in networking stack constructions they can express. Domain fronting for example, where the (cleartext) SNI header is e.g. In a multiaddr, domain fronting could be expressed like this: There's also the question of how HTTP paths should be represented. In most cases it seems fine to just say "the remainder of the multiaddr is the path", but then sometimes you want to further encapsulate something, e.g. a websocket at a specific path. It's tricky, and there are some notes on how this might look like, but we need to further lay this out and discuss and experiment. For now I'll just use These addresses get pretty verbose, but we can have a resolution step which transforms a short multiaddr to its full form, depending on context. For example, a web browser today transforms |
I see @victorbjelkholm and @lgierth. Thanks for your complete explanation, I will give it a try now. |
For allowing the |
Hey!
Below is the code I'm using to connect to the infura ipfs node. From what I've read this is an appropriate use of multiaddr but perhaps I'm wrong and would appreciate understanding how to correctly turn
https://ipfs.infura.io
into a multiaddr.js-multiaddr
seems to supportdns4
andhttps
but maybe I've misunderstood.Thanks for any help guys!
-Charles
The text was updated successfully, but these errors were encountered: