go-multiaddr icon indicating copy to clipboard operation
go-multiaddr copied to clipboard

encode unknown protocol addresses as strings

Open gaboose opened this issue 10 years ago • 1 comments

I can add new protocols from outside of this library with a line like

ma.AddProtocol(ma.Protocol{42, -1, "dns", ma.CodeToVarint(42)})

But it fails when I call NewMultiaddr("/dns/google.com"), because it doesn't know how to encode "google.com". What if you encode unknown protocol addresses of variable length as bare strings?

This change makes this library work.

gaboose avatar Feb 05 '16 17:02 gaboose

we'd have to length prefix them, see how i proposed unix recently

jbenet avatar Sep 16 '16 23:09 jbenet