go-multiaddr
go-multiaddr copied to clipboard
encode unknown protocol addresses as strings
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.
we'd have to length prefix them, see how i proposed unix recently