maurl

package
v0.6.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: Apache-2.0, MIT Imports: 6 Imported by: 11

Documentation

Overview

Package maurl converts between multiaddrs and URLs.

Importing this package registers a new multiaddr protocol named "httppath" that allows the path part of a URL to be encoded into a multiaddr as a url.PathEscape encoded string.

Representing a URL as a mutliaddr may be necessary when announcing content advertisement publishers that publish via HTTP, or when advertising content providers that have HTTP addresses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromURL

func FromURL(u *url.URL) (multiaddr.Multiaddr, error)

FromURL takes a URL and converts it into a multiaddr.

converts scheme://host:port/path -> /ip/host/tcp/port/scheme/urlescape{path}

func ToURL

func ToURL(ma multiaddr.Multiaddr) (*url.URL, error)

ToURL converts to a URL when given a multiaddr of the one of the forms:

/dns/thing.com/http/urlescape<path/to/root>
/ip/192.168.0.1/tcp/80/http

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL