for libp2p.A Transport
is an address-rewriting libp2p_core::Transport
an inner Transport
. The composed transport behaves like the inner
transport, except that libp2p_core::Transport::dial
components of the given Multiaddr
a DNS, replacing them with the resolved protocols (typically TCP/IP).
feature and hence the async_std::Transport
enabled by default. Tokio users can furthermore opt-in
to the tokio-dns-over-rustls
features. For more information about these features, please
refer to the documentation of trust-dns-resolver.
On Unix systems, if no custom configuration is given, trust-dns-resolver
will try to parse the /etc/resolv.conf
file. This approach comes with a
few caveats to be aware of:
This fails (panics even!) if /etc/resolv.conf
does not exist. This is the case on all versions of Android.
DNS configuration is only evaluated during startup. Runtime changes are thus ignored.
DNS resolution is obviously done in process and consequently not using
any system APIs (like libc’s gethostbyname
). Again this is problematic on platforms like Android, where there’s a lot of complexity hidden behind the system APIs. If the implementation requires different characteristics, one should consider providing their own implementation ofTransport
or use platform specific APIs to extract the host’s DNS configuration (if possible) and provide a customResolverConfig
The error type for errors that get returned in the crate
Configuration for the upstream nameservers to use for resolution
Configuration for the Resolver
The possible errors of aTransport
The error kind for errors that get returned in the crate