pub struct DnsDiscovery { /* private fields */ }wasm_browser only.Expand description
DNS endpoint discovery
When asked to resolve a EndpointId, this service performs a lookup in the Domain Name System (DNS).
It uses the Endpoint’s DNS resolver to query for TXT records under the domain
_iroh.<z32-endpoint-id>.<origin-domain>:
_iroh: is the record name<z32-endpoint-id>is theEndpointIdencoded inz-base-32format<origin-domain>is the endpoint origin domain as set inDnsDiscovery::builder.
Each TXT record returned from the query is expected to contain a string in the format <name>=<value>.
If a TXT record contains multiple character strings, they are concatenated first.
The supported attributes are:
relay=<url>: The URL of the home relay server of the endpoint
The DNS resolver defaults to using the nameservers configured on the host system, but can be changed
with crate::endpoint::Builder::dns_resolver.
Implementations§
Source§impl DnsDiscovery
impl DnsDiscovery
Sourcepub fn builder(origin_domain: String) -> DnsDiscoveryBuilder
pub fn builder(origin_domain: String) -> DnsDiscoveryBuilder
Creates a DnsDiscoveryBuilder that implements IntoDiscovery.
Sourcepub fn n0_dns() -> DnsDiscoveryBuilder
pub fn n0_dns() -> DnsDiscoveryBuilder
Creates a new DNS discovery using the iroh.link domain.
This uses the N0_DNS_ENDPOINT_ORIGIN_PROD domain.
§Usage during tests
For testing it is possible to use the N0_DNS_ENDPOINT_ORIGIN_STAGING domain
with DnsDiscovery::builder. This would then use a hosted staging discovery
service for testing purposes.
Trait Implementations§
Source§impl Debug for DnsDiscovery
impl Debug for DnsDiscovery
Source§impl Discovery for DnsDiscovery
impl Discovery for DnsDiscovery
Source§fn resolve(
&self,
endpoint_id: EndpointId,
) -> Option<BoxStream<Result<DiscoveryItem, DiscoveryError>>>
fn resolve( &self, endpoint_id: EndpointId, ) -> Option<BoxStream<Result<DiscoveryItem, DiscoveryError>>>
Source§fn publish(&self, _data: &EndpointData)
fn publish(&self, _data: &EndpointData)
EndpointData to the discovery mechanism. Read more