Commit Graph

6 Commits

Author SHA1 Message Date
Alan Shaw
3021c00543
feat: retain aliased protocols (#11)
The upgrade to multiaddr 7 brings with it a change that means multiaddrs with libp2p peer ID keys like `/ipfs/QmXXX` will be transformed to `/p
2p/QmXXX` when converted from a string, to a multiaddr instance and back to a string.

This is because `p2p` and `ipfs` are name aliases for the same codec. `p2p` has now become the default and older `ipfs` names do not round trip(they are converted to `p2p` - as stated above).

This change allows us to use the new multiaddr 7 lib but retain backward compatibility by ensuring the protocol specified in a string multiaddr is the protocol used in the resulting URI.
2020-01-01 22:29:49 +00:00
Marcin Rataj
adda9366c1 feat: assume HTTP when multiaddr ends with /tcp (#7)
This makes multiaddrs ending with `/tcp/8080` to default to HTTP unless
an explicit assumeHttp: false is passed.

We also skip default ports for HTTP and HTTPS in the URL.

Motivation:
https://github.com/ipfs/js-ipfs/pull/2358#issue-307463029

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2019-08-21 11:09:35 +01:00
Henrique Dias
7fbb65a470 fix: add all protocols
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
2019-01-13 10:22:17 +00:00
Henrique Dias
ac2d98c49a fix: IPv6 rfc3986 compliancy
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
2019-01-13 10:12:30 +00:00
Alan Shaw
42d8704061
renames to multiaddr-to-uri 2018-03-21 10:09:39 +00:00
Alan Shaw
f159234297
initial commit 2018-03-20 14:39:26 +00:00