
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@multiformats/uri-to-multiaddr
Advanced tools
Convert a URI to a Multiaddr
import { uriToMultiaddr } from '@multiformats/uri-to-multiaddr'
console.log(uriToMultiaddr('https://protocol.ai'))
// -> /dns4/protocol.ai/tcp/443/https
Domain names can represent one of
/dns4 - domain resolves to an ipv4 address (default)/dns6 - domain resolves to an ipv6 address/dnsaddr - domain has a DNSLink TXT record pointing to an IPFS CIDThis library assumes /dns4 when it finds a domain name in the input string.
It makes no attempt query DNS. To override the default assumption, you can pass
in an options object as the second parameter to override it:
import { uriToMultiaddr } from '@multiformats/uri-to-multiaddr'
console.log(uriToMultiaddr('https://protocol.ai'), { defaultDnsType: 'dns6' })
// -> /dns6/protocol.ai/tcp/443/https
See test.js for the currently supported conversions.
Note: uri-to-multiaddr will throw if the passed URI:
$ npm i @multiformats/uri-to-multiaddr
<script> tagLoading this module through a script tag will make its exports available as MultiformatsUriToMultiaddr in the global namespace.
<script src="https://unpkg.com/@multiformats/uri-to-multiaddr/dist/index.min.js"></script>
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
FAQs
Convert a URI to a Multiaddr
The npm package @multiformats/uri-to-multiaddr receives a total of 23,923 weekly downloads. As such, @multiformats/uri-to-multiaddr popularity was classified as popular.
We found that @multiformats/uri-to-multiaddr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.