diff --git a/pr/4036/docs/iroh/address_lookup/dns/index.html b/pr/4036/docs/iroh/address_lookup/dns/index.html index a3b1e9a890..bf801bcc80 100644 --- a/pr/4036/docs/iroh/address_lookup/dns/index.html +++ b/pr/4036/docs/iroh/address_lookup/dns/index.html @@ -1,2 +1,2 @@ -iroh::address_lookup::dns - Rust

Module dns

Module dns 

Source
Available on non-wasm_browser only.
Expand description

DNS endpoint discovery for iroh

+iroh::address_lookup::dns - Rust

Module dns

Module dns 

Source
Available on non-wasm_browser only.
Expand description

DNS endpoint discovery for iroh

Structs§

DnsAddressLookup
DNS endpoint discovery
DnsAddressLookupBuilder
Builder for DnsAddressLookup.

Constants§

N0_DNS_ENDPOINT_ORIGIN_PROD
The n0 address lookup DNS origin, for production.
N0_DNS_ENDPOINT_ORIGIN_STAGING
The n0 address lookup DNS origin, for testing.
\ No newline at end of file diff --git a/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookup.html b/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookup.html index b7ac7c645b..5a511f5073 100644 --- a/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookup.html +++ b/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookup.html @@ -15,14 +15,13 @@ The supported attributes are:

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 DnsAddressLookup

Source

pub fn builder(origin_domain: String) -> DnsAddressLookupBuilder

Creates a DnsAddressLookupBuilder that implements AddressLookupBuilder.

-
Source

pub fn n0_dns() -> DnsAddressLookupBuilder

Creates a new DNS discovery using the iroh.link domain.

+

Implementations§

Source§

impl DnsAddressLookup

Source

pub fn builder(origin_domain: String) -> DnsAddressLookupBuilder

Creates a DnsAddressLookupBuilder that implements AddressLookupBuilder.

+
Source

pub fn n0_dns() -> DnsAddressLookupBuilder

Creates a new DNS address lookup 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 DnsAddressLookup::builder. This would then use a hosted staging discovery -service for testing purposes.

-

Trait Implementations§

Source§

impl AddressLookup for DnsAddressLookup

Source§

fn resolve( +

When running with the environment variable IROH_FORCE_STAGING_RELAYS +set to any non empty value the N0_DNS_ENDPOINT_ORIGIN_STAGING domain +is used instead.

+

Trait Implementations§

Source§

impl AddressLookup for DnsAddressLookup

Source§

fn resolve( &self, endpoint_id: EndpointId, ) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>

Resolves the Item for the given EndpointId. Read more
Source§

fn publish(&self, _data: &EndpointData)

Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§

impl Debug for DnsAddressLookup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AddressLookupBuilder for T
where diff --git a/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html index a433686831..40aa0b221c 100644 --- a/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html +++ b/pr/4036/docs/iroh/address_lookup/dns/struct.DnsAddressLookupBuilder.html @@ -2,7 +2,7 @@

See DnsAddressLookup::builder.

Implementations§

Source§

impl DnsAddressLookupBuilder

Source

pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self

Sets the DNS resolver to use.

Source

pub fn build(self) -> DnsAddressLookup

Builds a DnsAddressLookup with the passed DnsResolver.

-

Trait Implementations§

Trait Implementations§

Source§

impl AddressLookupBuilder for DnsAddressLookupBuilder

Source§

fn into_address_lookup( self, endpoint: &Endpoint, ) -> Result<impl AddressLookup, AddressLookupBuilderError>

Turns this builder into a ready-to-use AddressLookup. Read more
Source§

impl Debug for DnsAddressLookupBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where diff --git a/pr/4036/docs/iroh/address_lookup/index.html b/pr/4036/docs/iroh/address_lookup/index.html index cbef5f5fbd..032f4526c7 100644 --- a/pr/4036/docs/iroh/address_lookup/index.html +++ b/pr/4036/docs/iroh/address_lookup/index.html @@ -1,9 +1,9 @@ iroh::address_lookup - Rust

Module address_lookup

Module address_lookup 

Source
Expand description

Lookup the address of an Endpoint ID.

To connect to an iroh endpoint a EndpointAddr is needed, which may contain a RelayUrl or one or more direct addresses in addition to the EndpointId.

-

Since there is a conversion from EndpointId to EndpointAddr, you can also use +

Since there is a conversion from EndpointId to EndpointAddr, you can also connect directly with a EndpointId.

-

For this to work however, the endpoint has to get the addressing information by +

For this to work however, the endpoint has to get the addressing information by other means.

AddressLookup is an automated system for an Endpoint to retrieve this addressing information. Each iroh endpoint will automatically publish their own addressing @@ -42,16 +42,16 @@ using HTTP.

mDNS-based and Mainline-DHT-based Address Lookup services live in separate crates: iroh-mdns-address-lookup and iroh-mainline-address-lookup.

-

To use multiple Address Lookup’ssimultaneously you can call Builder::address_lookup. +

To use multiple Address Lookups simultaneously you can call Builder::address_lookup. This will use AddressLookupServices under the hood, which performs lookups to all -Address Lookupsystems at the same time.

+Address Lookup systems at the same time.

Builder::address_lookup takes any type that implements AddressLookupBuilder. You can implement that trait on a builder struct if your Address Lookup needs information from the endpoint it is mounted on. After endpoint construction, your Address Lookup is built by calling AddressLookupBuilder::into_address_lookup, passing the finished Endpoint to your builder.

-

If your Address Lookupdoes not need any information from its endpoint, you can -pass the Address Lookupservice directly to Builder::address_lookup: All types that +

If your Address Lookup does not need any information from its endpoint, you can +pass the Address Lookup service directly to Builder::address_lookup: All types that implement AddressLookup also have a blanket implementation of AddressLookupBuilder.

§Examples

A very common setup is to enable DNS Address Lookup, which needs to be done in two parts as a @@ -69,4 +69,4 @@ implement await?;

Re-exports§

pub use dns::*;Non-wasm_browser
pub use memory::*;
pub use pkarr::*;

Modules§

dnsNon-wasm_browser
DNS endpoint discovery for iroh
memory
An in-memory address lookup system to manually add endpoint addressing information.
pkarr
An address lookup service which publishes and resolves endpoint information using a pkarr relay.

Structs§

AddrFilter
A filter and/or reordering function applied to transport addresses, -typically used by AddressLookup services in iroh before publishing.
AddressLookupServices
Registry for address lookup services for an Endpoint.
EndpointData
Data about an endpoint that may be published to and resolved from discovery services.
EndpointInfo
Information about an endpoint that may be published to and resolved from discovery services.
Error
Error returned by address lookup services when failing to perform the lookup.
FilteredAddressLookup
An AddressLookup wrapper that filters addresses before publishing.
Item
Address lookup results from AddressLookups.
UserData
Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

Enums§

AddressLookupBuilderError
AddressLookupBuilder errors
AddressLookupFailed
AddressLookup errors
ParseError

Traits§

AddressLookup
AddressLookup system for super::Endpoint.
AddressLookupBuilder
Trait for structs that can be converted into AddressLookups.
\ No newline at end of file +typically used by AddressLookup services in iroh before publishing.
AddressLookupServices
Registry for address lookup services for an Endpoint.
EndpointData
Data about an endpoint that may be published to and resolved from discovery services.
EndpointInfo
Information about an endpoint that may be published to and resolved from discovery services.
Error
Error returned by address lookup services when failing to perform the lookup.
FilteredAddressLookup
An AddressLookup wrapper that filters addresses before publishing.
Item
Address lookup results from AddressLookups.
UserData
User-defined data that can be published and resolved through endpoint discovery.

Enums§

AddressLookupBuilderError
AddressLookupBuilder errors
AddressLookupFailed
AddressLookup errors
ParseError

Traits§

AddressLookup
AddressLookup system for super::Endpoint.
AddressLookupBuilder
Trait for structs that can be converted into AddressLookups.
\ No newline at end of file diff --git a/pr/4036/docs/iroh/address_lookup/memory/index.html b/pr/4036/docs/iroh/address_lookup/memory/index.html index 190ac87b20..02f89e2301 100644 --- a/pr/4036/docs/iroh/address_lookup/memory/index.html +++ b/pr/4036/docs/iroh/address_lookup/memory/index.html @@ -1,8 +1,8 @@ -iroh::address_lookup::memory - Rust

Module memory

Module memory 

Source
Expand description

An in-memory address lookup system to manually add endpoint addressing information.

+iroh::address_lookup::memory - Rust

Module memory

Module memory 

Source
Expand description

An in-memory address lookup system to manually add endpoint addressing information.

Often an application might get endpoint addressing information out-of-band in an application-specific way. EndpointTicket’s are one common way used to achieve this. This addressing information is often only usable for a limited time so needs to -be able to be removed again once know it is no longer useful.

+be able to be removed again once you know it is no longer useful.

This is where the MemoryLookup is useful: it allows applications to add and retract endpoint addressing information that is otherwise out-of-band to iroh.

Structs§

MemoryLookup
An in-memory address lookup system to manually add endpoint addressing information.
\ No newline at end of file diff --git a/pr/4036/docs/iroh/address_lookup/memory/struct.MemoryLookup.html b/pr/4036/docs/iroh/address_lookup/memory/struct.MemoryLookup.html index 53f54024a3..3d544895e4 100644 --- a/pr/4036/docs/iroh/address_lookup/memory/struct.MemoryLookup.html +++ b/pr/4036/docs/iroh/address_lookup/memory/struct.MemoryLookup.html @@ -1,8 +1,8 @@ -MemoryLookup in iroh::address_lookup::memory - Rust

MemoryLookup

Struct MemoryLookup 

Source
pub struct MemoryLookup { /* private fields */ }
Expand description

An in-memory address lookup system to manually add endpoint addressing information.

+MemoryLookup in iroh::address_lookup::memory - Rust

MemoryLookup

Struct MemoryLookup 

Source
pub struct MemoryLookup { /* private fields */ }
Expand description

An in-memory address lookup system to manually add endpoint addressing information.

Often an application might get endpoint addressing information out-of-band in an application-specific way. EndpointTicket’s are one common way used to achieve this. This addressing information is often only usable for a limited time so needs to -be able to be removed again once know it is no longer useful.

+be able to be removed again once you know it is no longer useful.

This is where the MemoryLookup is useful: it allows applications to add and retract endpoint addressing information that is otherwise out-of-band to iroh.

§Examples

@@ -29,15 +29,15 @@ retract endpoint addressing information that is otherwise out-of-band to iroh.

Implementations§

Source§

impl MemoryLookup

Source

pub const PROVENANCE: &'static str = "memory_lookup"

The provenance string for this Address Lookup implementation.

+

Implementations§

Source§

impl MemoryLookup

Source

pub const PROVENANCE: &'static str = "memory_lookup"

The provenance string for this Address Lookup implementation.

This is mostly used for debugging information and allows understanding the origin of addressing information used by an iroh Endpoint.

-
Source

pub fn new() -> Self

Creates a new static Address Lookup instance.

-
Source

pub fn with_provenance(provenance: &'static str) -> Self

Creates a new Memory Lookup instance with the provided provenance.

+
Source

pub fn new() -> Self

Creates a new empty Memory Lookup instance.

+
Source

pub fn with_provenance(provenance: &'static str) -> Self

Creates a new Memory Lookup instance with the provided provenance.

The provenance is part of address_lookup::Items returned from Self::resolve. It is mostly used for debugging information and allows understanding the origin of addressing information used by an iroh Endpoint.

-
Source

pub fn from_endpoint_info( +

Source

pub fn from_endpoint_info( infos: impl IntoIterator<Item = impl Into<EndpointInfo>>, ) -> Self

Creates a Memory Lookup instance from endpoint addresses.

§Examples
@@ -54,27 +54,27 @@ addressing information used by an iroh let endpoint = Endpoint::builder(presets::N0) .address_lookup(address_lookup) .bind() - .await?;
Source

pub fn set_endpoint_info( + .await?;

Source

pub fn set_endpoint_info( &self, endpoint_info: impl Into<EndpointInfo>, ) -> Option<EndpointData>

Sets endpoint addressing information for the given endpoint ID.

This will completely overwrite any existing info for the endpoint.

Returns the EndpointData of the previous entry, or None if there was no previous entry for this endpoint ID.

-
Source

pub fn add_endpoint_info(&self, endpoint_info: impl Into<EndpointInfo>)

Augments endpoint addressing information for the given endpoint ID.

+
Source

pub fn add_endpoint_info(&self, endpoint_info: impl Into<EndpointInfo>)

Augments endpoint addressing information for the given endpoint ID.

The provided addressing information is combined with the existing info in the memory lookup. Any new direct addresses are added to those already present while the relay URL is overwritten.

-
Source

pub fn get_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo>

Returns endpoint addressing information for the given endpoint ID.

-
Source

pub fn remove_endpoint_info( +

Source

pub fn get_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo>

Returns endpoint addressing information for the given endpoint ID.

+
Source

pub fn remove_endpoint_info( &self, endpoint_id: EndpointId, ) -> Option<EndpointInfo>

Removes all endpoint addressing information for the given endpoint ID.

Any removed information is returned.

-

Trait Implementations§

Source§

impl AddressLookup for MemoryLookup

Source§

fn publish(&self, _data: &EndpointData)

Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§

fn resolve( +

Trait Implementations§

Source§

impl AddressLookup for MemoryLookup

Source§

fn publish(&self, _data: &EndpointData)

Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§

fn resolve( &self, endpoint_id: EndpointId, -) -> Option<BoxStream<Result<Item, Error>>>

Resolves the Item for the given EndpointId. Read more
Source§

impl Clone for MemoryLookup

Source§

fn clone(&self) -> MemoryLookup

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MemoryLookup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MemoryLookup

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for MemoryLookup

§

impl RefUnwindSafe for MemoryLookup

§

impl Send for MemoryLookup

§

impl Sync for MemoryLookup

§

impl Unpin for MemoryLookup

§

impl UnwindSafe for MemoryLookup

Blanket Implementations§

Source§

impl<T> AddressLookupBuilder for T
where +) -> Option<BoxStream<Result<Item, Error>>>

Resolves the Item for the given EndpointId. Read more
Source§

impl Clone for MemoryLookup

Source§

fn clone(&self) -> MemoryLookup

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MemoryLookup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MemoryLookup

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for MemoryLookup

§

impl RefUnwindSafe for MemoryLookup

§

impl Send for MemoryLookup

§

impl Sync for MemoryLookup

§

impl Unpin for MemoryLookup

§

impl UnwindSafe for MemoryLookup

Blanket Implementations§

Source§

impl<T> AddressLookupBuilder for T
where T: AddressLookup,

Source§

fn into_address_lookup( self, _endpoint: &Endpoint, diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/index.html b/pr/4036/docs/iroh/address_lookup/pkarr/index.html index 25f896e3a3..38c973b4c9 100644 --- a/pr/4036/docs/iroh/address_lookup/pkarr/index.html +++ b/pr/4036/docs/iroh/address_lookup/pkarr/index.html @@ -1,4 +1,4 @@ -iroh::address_lookup::pkarr - Rust

Module pkarr

Module pkarr 

Source
Expand description

An address lookup service which publishes and resolves endpoint information using a pkarr relay.

+iroh::address_lookup::pkarr - Rust

Module pkarr

Module pkarr 

Source
Expand description

An address lookup service which publishes and resolves endpoint information using a pkarr relay.

Public-Key Addressable Resource Records, pkarr, is a system which allows publishing DNS Resource Records owned by a particular SecretKey under a name derived from its corresponding PublicKey, also known as the EndpointId. Additionally this pkarr diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html index 0244bdd3e4..10f952f4f3 100644 --- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html +++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrPublisher.html @@ -1,28 +1,30 @@ -PkarrPublisher in iroh::address_lookup::pkarr - Rust

PkarrPublisher

Struct PkarrPublisher 

Source
pub struct PkarrPublisher { /* private fields */ }
Expand description

Publisher of address lookup information to a pkarr relay.

+PkarrPublisher in iroh::address_lookup::pkarr - Rust

PkarrPublisher

Struct PkarrPublisher 

Source
pub struct PkarrPublisher { /* private fields */ }
Expand description

Publisher of address lookup information to a pkarr relay.

This publisher uses HTTP to publish address lookup information to a pkarr relay server, see the module docs for details.

This implements the AddressLookup trait to be used as an address lookup service. Note that it only publishes address lookup information, for the corresponding resolver use the PkarrResolver together with AddressLookupServices.

-

This publisher will only publish the RelayUrl if it is set, otherwise the direct addresses are published instead.

-

Implementations§

Source§

impl PkarrPublisher

Source

pub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder

Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.

-

If no further options are set, the pkarr publisher will use DEFAULT_PKARR_TTL as the +

By default this publisher only publishes the RelayUrl, to avoid leaking IP addresses to +the public pkarr server. Which addresses are published is controlled by the AddrFilter +set via PkarrPublisherBuilder::addr_filter.

+

Implementations§

Source§

impl PkarrPublisher

Source

pub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder

Returns a PkarrPublisherBuilder that publishes endpoint info to a pkarr relay at pkarr_relay.

+

If no further options are set, the pkarr publisher will use DEFAULT_PKARR_TTL as the time-to-live value for the published packets, and it will republish Address Lookup information every DEFAULT_REPUBLISH_INTERVAL, even if the information is unchanged.

PkarrPublisherBuilder implements AddressLookupBuilder, so it can be passed to address_lookup. It will then use the endpoint’s secret key to sign published packets.

-
Source

pub fn n0_dns() -> PkarrPublisherBuilder

Creates a pkarr publisher which uses the number 0 pkarr relay server.

+
Source

pub fn n0_dns() -> PkarrPublisherBuilder

Creates a pkarr publisher which uses the number 0 pkarr relay server.

This uses the pkarr relay server operated by number 0, at N0_DNS_PKARR_RELAY_PROD.

When running with the environment variable IROH_FORCE_STAGING_RELAYS set to any non empty value N0_DNS_PKARR_RELAY_STAGING server is used instead.

-
Source

pub fn update_endpoint_data(&self, data: &EndpointData)

Publishes the addressing information about this endpoint to a pkarr relay.

+
Source

pub fn update_endpoint_data(&self, data: &EndpointData)

Publishes the addressing information about this endpoint to a pkarr relay.

This is a nonblocking function, the actual update is performed in the background.

-

Trait Implementations§

Source§

impl AddressLookup for PkarrPublisher

Source§

fn publish(&self, data: &EndpointData)

Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§

fn resolve( +

Trait Implementations§

Source§

impl AddressLookup for PkarrPublisher

Source§

fn publish(&self, data: &EndpointData)

Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§

fn resolve( &self, _endpoint_id: EndpointId, -) -> Option<BoxStream<Result<Item, Error>>>

Resolves the Item for the given EndpointId. Read more
Source§

impl Clone for PkarrPublisher

Source§

fn clone(&self) -> PkarrPublisher

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PkarrPublisher

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AddressLookupBuilder for T
where +) -> Option<BoxStream<Result<Item, Error>>>

Resolves the Item for the given EndpointId. Read more
Source§

impl Clone for PkarrPublisher

Source§

fn clone(&self) -> PkarrPublisher

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PkarrPublisher

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AddressLookupBuilder for T
where T: AddressLookup,

Source§

fn into_address_lookup( self, _endpoint: &Endpoint, diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html index aca2855501..bdab189c43 100644 --- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html +++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClient.html @@ -1,18 +1,18 @@ -PkarrRelayClient in iroh::address_lookup::pkarr - Rust

PkarrRelayClient

Struct PkarrRelayClient 

Source
pub struct PkarrRelayClient { /* private fields */ }
Expand description

A pkarr client to publish SignedPackets to a pkarr relay.

-

Implementations§

Source§

impl PkarrRelayClient

Source

pub fn new( +PkarrRelayClient in iroh::address_lookup::pkarr - Rust

PkarrRelayClient

Struct PkarrRelayClient 

Source
pub struct PkarrRelayClient { /* private fields */ }
Expand description

A pkarr client to publish SignedPackets to a pkarr relay.

+

Implementations§

Source§

impl PkarrRelayClient

Source

pub fn new( pkarr_relay_url: Url, tls_config: ClientConfig, dns_resolver: DnsResolver, ) -> Self

Available on non-wasm_browser only.

Creates a PkarrRelayClient.

-
Source

pub async fn resolve( +

Source

pub async fn resolve( &self, endpoint_id: EndpointId, ) -> Result<SignedPacket, AddressLookupError>

Resolves a SignedPacket for the given EndpointId.

-
Source

pub async fn publish( +

Source

pub async fn publish( &self, signed_packet: &SignedPacket, ) -> Result<(), PkarrError>

Publishes a SignedPacket.

-

Trait Implementations§

Source§

impl Clone for PkarrRelayClient

Source§

fn clone(&self) -> PkarrRelayClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PkarrRelayClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +

Trait Implementations§

Source§

impl Clone for PkarrRelayClient

Source§

fn clone(&self) -> PkarrRelayClient

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PkarrRelayClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html index 79d8b2e2a8..0c08b03913 100644 --- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html +++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrRelayClientBuilder.html @@ -1,6 +1,6 @@ -PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust

PkarrRelayClientBuilder

Struct PkarrRelayClientBuilder 

Source
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description

A builder for the PkarrRelayClient

-

Implementations§

Trait Implementations§

Source§

impl Clone for PkarrRelayClientBuilder

Source§

fn clone(&self) -> PkarrRelayClientBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PkarrRelayClientBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +PkarrRelayClientBuilder in iroh::address_lookup::pkarr - Rust

PkarrRelayClientBuilder

Struct PkarrRelayClientBuilder 

Source
pub struct PkarrRelayClientBuilder { /* private fields */ }
Expand description

A builder for the PkarrRelayClient

+

Implementations§

Trait Implementations§

Source§

impl Clone for PkarrRelayClientBuilder

Source§

fn clone(&self) -> PkarrRelayClientBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PkarrRelayClientBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html index 13e12a4b01..1f7723299d 100644 --- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html +++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolver.html @@ -1,21 +1,21 @@ -PkarrResolver in iroh::address_lookup::pkarr - Rust

PkarrResolver

Struct PkarrResolver 

Source
pub struct PkarrResolver { /* private fields */ }
Expand description

Resolver of address lookup information from a pkarr relay.

+PkarrResolver in iroh::address_lookup::pkarr - Rust

PkarrResolver

Struct PkarrResolver 

Source
pub struct PkarrResolver { /* private fields */ }
Expand description

Resolver of address lookup information from a pkarr relay.

The resolver uses HTTP to query address lookup information from a pkarr relay server, see the module docs for details.

This implements the AddressLookup trait to be used as an address lookup service. Note that it only resolves address lookup information, for the corresponding publisher use the PkarrPublisher together with AddressLookupServices.

-

Implementations§

Source§

impl PkarrResolver

Source

pub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder

Creates a new resolver builder using the pkarr relay server at the URL.

+

Implementations§

Source§

impl PkarrResolver

Source

pub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder

Creates a new resolver builder using the pkarr relay server at the URL.

The builder implements AddressLookupBuilder.

-
Source

pub fn n0_dns() -> PkarrResolverBuilder

Creates a pkarr resolver builder which uses the number 0 pkarr relay server.

+
Source

pub fn n0_dns() -> PkarrResolverBuilder

Creates a pkarr resolver builder which uses the number 0 pkarr relay server.

This uses the pkarr relay server operated by number 0 at N0_DNS_PKARR_RELAY_PROD.

When running with the environment variable IROH_FORCE_STAGING_RELAYS set to any non empty value N0_DNS_PKARR_RELAY_STAGING server is used instead.

-

Trait Implementations§

Trait Implementations§

Source§

impl AddressLookup for PkarrResolver

Source§

fn resolve( &self, endpoint_id: EndpointId, -) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>>

Resolves the Item for the given EndpointId. Read more
Source§

fn publish(&self, _data: &EndpointData)

Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§

impl Clone for PkarrResolver

Source§

fn clone(&self) -> PkarrResolver

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PkarrResolver

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AddressLookupBuilder for T

Resolves the Item for the given EndpointId. Read more
Source§

fn publish(&self, _data: &EndpointData)

Publishes the given EndpointData to the Address Lookup mechanism. Read more
Source§

impl Clone for PkarrResolver

Source§

fn clone(&self) -> PkarrResolver

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PkarrResolver

Source§

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AddressLookupBuilder for T
where T: AddressLookup,

Source§

fn into_address_lookup( self, _endpoint: &Endpoint, diff --git a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html index cfd47f28e6..e549ec9d07 100644 --- a/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html +++ b/pr/4036/docs/iroh/address_lookup/pkarr/struct.PkarrResolverBuilder.html @@ -1,11 +1,11 @@ -PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust

PkarrResolverBuilder

Struct PkarrResolverBuilder 

Source
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description

Builder for PkarrResolver.

+PkarrResolverBuilder in iroh::address_lookup::pkarr - Rust

PkarrResolverBuilder

Struct PkarrResolverBuilder 

Source
pub struct PkarrResolverBuilder { /* private fields */ }
Expand description

Implementations§

Source§

impl PkarrResolverBuilder

Source

pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self

Available on non-wasm_browser only.

Sets the DNS resolver to use for resolving the pkarr relay URL.

-
Source

pub fn build(self, tls_config: ClientConfig) -> PkarrResolver

Creates a PkarrResolver from this builder.

-

Trait Implementations§

Source§

impl AddressLookupBuilder for PkarrResolverBuilder

Implementations§

Source§

impl PkarrResolverBuilder

Source

pub fn dns_resolver(self, dns_resolver: DnsResolver) -> Self

Available on non-wasm_browser only.

Sets the DNS resolver to use for resolving the pkarr relay URL.

+
Source

pub fn build(self, tls_config: ClientConfig) -> PkarrResolver

Creates a PkarrResolver from this builder.

+

Trait Implementations§

Source§

impl AddressLookupBuilder for PkarrResolverBuilder

Source§

fn into_address_lookup( self, endpoint: &Endpoint, -) -> Result<impl AddressLookup, AddressLookupBuilderError>

Turns this builder into a ready-to-use AddressLookup. Read more
Source§

impl Debug for PkarrResolverBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T

Turns this builder into a ready-to-use AddressLookup. Read more
Source§

impl Debug for PkarrResolverBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html index 1ea4773718..7de6a2dd89 100644 --- a/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html +++ b/pr/4036/docs/iroh/address_lookup/struct.EndpointData.html @@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.

See also Self::set_user_data.

Source

pub fn add_relay_url(&mut self, relay_url: RelayUrl)

Adds the relay URL to the end of the endpoint data, unless it already existed.

Source

pub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)

Adds addresses in order with duplicates or already existing addresses filtered out.

-
Source

pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.

-
Source

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data and returns the updated endpoint data.

+
Source

pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

Adds addresses to the endpoint data in the given order, but with duplicates filtered.

+
Source

pub fn set_user_data(&mut self, user_data: Option<UserData>)

Sets the user-defined data.

Source

pub fn clear_ip_addrs(&mut self)

Removes all direct addresses from the endpoint data.

-
Source

pub fn clear_relay_urls(&mut self)

Removes all direct addresses from the endpoint data.

+
Source

pub fn clear_relay_urls(&mut self)

Removes all relay URLs from the endpoint data.

Source

pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

Returns the relay URL of the endpoint.

Source

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the endpoint.

Source

pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of the endpoint.

-
Source

pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

Returns the full list of all known addresses

-
Source

pub fn has_addrs(&self) -> bool

Does this have any addresses?

+
Source

pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

Returns the full list of all known addresses.

+
Source

pub fn has_addrs(&self) -> bool

Returns whether this has any addresses.

Source

pub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>

Apply the given filter to the current addresses.

Returns a vec to allow re-ordering of addresses.

Source

pub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>

Returns the EndpointData with given filter applied.

diff --git a/pr/4036/docs/iroh/address_lookup/struct.Item.html b/pr/4036/docs/iroh/address_lookup/struct.Item.html index 9e63b37130..28d59f6feb 100644 --- a/pr/4036/docs/iroh/address_lookup/struct.Item.html +++ b/pr/4036/docs/iroh/address_lookup/struct.Item.html @@ -16,14 +16,14 @@ directly from
Source

pub fn last_updated(&self) -> Option<u64>

Returns the optional timestamp when this endpoint info was last updated.

The value is microseconds since the unix epoch.

-
Source

pub fn to_endpoint_addr(&self) -> EndpointAddr

Converts into a EndpointAddr by cloning the needed fields.

-
Source

pub fn into_endpoint_addr(self) -> EndpointAddr

Converts into a EndpointAddr without cloning.

+
Source

pub fn to_endpoint_addr(&self) -> EndpointAddr

Returns an EndpointAddr by cloning the needed fields.

+
Source

pub fn into_endpoint_addr(self) -> EndpointAddr

Converts into an EndpointAddr without cloning.

Source

pub fn user_data(&self) -> Option<UserData>

Returns any user-defined data.

Methods from Deref<Target = EndpointData>§

Source

pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

Returns the relay URL of the endpoint.

Source

pub fn user_data(&self) -> Option<&UserData>

Returns the optional user-defined data of the endpoint.

Source

pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

Returns the direct addresses of the endpoint.

-
Source

pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

Returns the full list of all known addresses

-
Source

pub fn has_addrs(&self) -> bool

Does this have any addresses?

+
Source

pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

Returns the full list of all known addresses.

+
Source

pub fn has_addrs(&self) -> bool

Returns whether this has any addresses.

Source

pub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>

Apply the given filter to the current addresses.

Returns a vec to allow re-ordering of addresses.

Source

pub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>

Returns the EndpointData with given filter applied.

diff --git a/pr/4036/docs/iroh/address_lookup/struct.UserData.html b/pr/4036/docs/iroh/address_lookup/struct.UserData.html index 49c2183d40..5ae8665e57 100644 --- a/pr/4036/docs/iroh/address_lookup/struct.UserData.html +++ b/pr/4036/docs/iroh/address_lookup/struct.UserData.html @@ -1,4 +1,5 @@ -UserData in iroh::address_lookup - Rust

UserData

Struct UserData 

Source
pub struct UserData(/* private fields */);
Expand description

Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

+UserData in iroh::address_lookup - Rust

UserData

Struct UserData 

Source
pub struct UserData(/* private fields */);
Expand description

User-defined data that can be published and resolved through endpoint discovery.

+

Under the hood this is a UTF-8 string no longer than UserData::MAX_LENGTH bytes.

Iroh does not keep track of or examine the user-defined data.

UserData implements FromStr and TryFrom<String>, so you can convert &str and String into UserData easily.

diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html index 1be6efa3e6..79a8044def 100644 --- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html +++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookup.html @@ -22,7 +22,7 @@ Address Lookup information changes. If an Address Lookup mechanism requires a pe refresh, it should start its own task.

Provided Methods§

Source

fn publish(&self, _data: &EndpointData)

Publishes the given EndpointData to the Address Lookup mechanism.

This is fire and forget, since the Endpoint can not wait for successful -publishing. If publishing is async, the implementation should start it’s own task.

+publishing. If publishing is async, the implementation should start its own task.

This will be called from a tokio task, so it is safe to spawn new tasks. These tasks will be run on the runtime of the super::Endpoint.

Source

fn resolve( @@ -34,4 +34,4 @@ work.

Implementations on Foreign Types§

Source§

impl<T: AddressLookup> AddressLookup for Arc<T>

Source§

fn publish(&self, data: &EndpointData)

Source§

fn resolve( &self, endpoint_id: EndpointId, -) -> Option<BoxStream<Result<Item, Error>>>

Implementors§

\ No newline at end of file +) -> Option<BoxStream<Result<Item, Error>>>

Implementors§

\ No newline at end of file diff --git a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html index 35aadc4338..edc4dff899 100644 --- a/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html +++ b/pr/4036/docs/iroh/address_lookup/trait.AddressLookupBuilder.html @@ -20,5 +20,5 @@ endpoint to Endpoint, ) -> Result<impl AddressLookup, AddressLookupBuilderError>

Turns this builder into a ready-to-use AddressLookup.

If an error is returned, building the endpoint will fail with this error.

-

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl AddressLookupBuilder for DnsAddressLookupBuilder

Available on non-wasm_browser only.
Source§

impl AddressLookupBuilder for PkarrPublisherBuilder

Source§

impl AddressLookupBuilder for PkarrResolverBuilder

Source§

impl<T: AddressLookup> AddressLookupBuilder for T

Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.

+

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl AddressLookupBuilder for DnsAddressLookupBuilder

Available on non-wasm_browser only.
Source§

impl AddressLookupBuilder for PkarrPublisherBuilder

Source§

impl AddressLookupBuilder for PkarrResolverBuilder

Source§

impl<T: AddressLookup> AddressLookupBuilder for T

Blanket no-op impl of AddressLookupBuilder for T: AddressLookup.

\ No newline at end of file diff --git a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html index 5961b7d1ab..3a67b98b91 100644 --- a/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html +++ b/pr/4036/docs/iroh/defaults/prod/fn.default_ap_relay.html @@ -1,2 +1,2 @@ -default_ap_relay in iroh::defaults::prod - Rust

default_ap_relay

Function default_ap_relay 

Source
pub fn default_ap_relay() -> RelayConfig
Expand description

Get the default RelayConfig for Asia-Pacific

+default_ap_relay in iroh::defaults::prod - Rust

default_ap_relay

Function default_ap_relay 

Source
pub fn default_ap_relay() -> RelayConfig
Expand description

Get the default RelayConfig for Asia-Pacific.

\ No newline at end of file diff --git a/pr/4036/docs/iroh/defaults/prod/index.html b/pr/4036/docs/iroh/defaults/prod/index.html index 8981fb6be4..b076bc3ce3 100644 --- a/pr/4036/docs/iroh/defaults/prod/index.html +++ b/pr/4036/docs/iroh/defaults/prod/index.html @@ -1,2 +1,2 @@ iroh::defaults::prod - Rust

Module prod

Module prod 

Source
Expand description

Production configuration.

-

Constants§

AP_RELAY_HOSTNAME
Hostname of the default Asia-Pacific relay.
EU_RELAY_HOSTNAME
Hostname of the default EU relay.
NA_EAST_RELAY_HOSTNAME
Hostname of the default NA east relay.
NA_WEST_RELAY_HOSTNAME
Hostname of the default NA west relay.

Functions§

default_ap_relay
Get the default RelayConfig for Asia-Pacific
default_eu_relay
Get the default RelayConfig for EU.
default_na_east_relay
Get the default RelayConfig for NA east.
default_na_west_relay
Get the default RelayConfig for NA west.
default_relay_map
Get the default RelayMap.
\ No newline at end of file +

Constants§

AP_RELAY_HOSTNAME
Hostname of the default Asia-Pacific relay.
EU_RELAY_HOSTNAME
Hostname of the default EU relay.
NA_EAST_RELAY_HOSTNAME
Hostname of the default NA east relay.
NA_WEST_RELAY_HOSTNAME
Hostname of the default NA west relay.

Functions§

default_ap_relay
Get the default RelayConfig for Asia-Pacific.
default_eu_relay
Get the default RelayConfig for EU.
default_na_east_relay
Get the default RelayConfig for NA east.
default_na_west_relay
Get the default RelayConfig for NA west.
default_relay_map
Get the default RelayMap.
\ No newline at end of file diff --git a/pr/4036/docs/iroh/dns/struct.DnsResolver.html b/pr/4036/docs/iroh/dns/struct.DnsResolver.html index 754fa26465..3f8c6e27b6 100644 --- a/pr/4036/docs/iroh/dns/struct.DnsResolver.html +++ b/pr/4036/docs/iroh/dns/struct.DnsResolver.html @@ -15,7 +15,7 @@ public DNS.

Implementations§

Source§

impl DnsResolver

Source

pub fn new() -> DnsResolver

Creates a new DNS resolver with sensible cross-platform defaults.

We first try to read the system’s resolver from /etc/resolv.conf. This does not work at least on some Androids, therefore we fallback -to the default ResolverConfig which uses eg. to google’s 8.8.8.8 or 8.8.4.4.

+to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.

Source

pub fn with_nameserver(nameserver: SocketAddr) -> DnsResolver

Creates a new DNS resolver configured with a single UDP DNS nameserver.

Source

pub fn builder() -> Builder

Creates a builder to construct a DNS resolver with custom options.

Source

pub fn custom(resolver: impl Resolver) -> DnsResolver

Creates a new DnsResolver from a struct that implements Resolver.

diff --git a/pr/4036/docs/iroh/dns/trait.Resolver.html b/pr/4036/docs/iroh/dns/trait.Resolver.html index 4aaa7642fd..3ebf87a01f 100644 --- a/pr/4036/docs/iroh/dns/trait.Resolver.html +++ b/pr/4036/docs/iroh/dns/trait.Resolver.html @@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver configuration rather than mutating in place. Must not perform IO: defer DNS queries and socket binds until the new resolver is first used. May be called concurrently, in which case all but one allocated replacement is dropped unused.

-

Implementations on Foreign Types§

Source§

impl Resolver for Arc<SimpleDnsResolver>

Implementations on Foreign Types§

Source§

impl Resolver for Arc<SimpleDnsResolver>

Source§

fn lookup_ipv4( &self, host: String, -) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>

Source§

fn lookup_ipv6( +) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv4Addr> + Send>, DnsError>> + Send>>

Source§

fn lookup_ipv6( &self, host: String, -) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>

Source§

fn lookup_txt( +) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = Ipv6Addr> + Send>, DnsError>> + Send>>

Source§

fn lookup_txt( &self, host: String, -) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>

Source§

fn clear_cache(&self)

Source§

fn reset(&self) -> Box<dyn Resolver>

Implementors§

\ No newline at end of file +) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = TxtRecordData> + Send>, DnsError>> + Send>>
Source§

fn clear_cache(&self)

Source§

fn reset(&self) -> Box<dyn Resolver>

Implementors§

\ No newline at end of file diff --git a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html index 0a8e0c05eb..cc00fac5e1 100644 --- a/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html +++ b/pr/4036/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html @@ -1,2 +1,2 @@ -ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust

ENV_FORCE_STAGING_RELAYS

Constant ENV_FORCE_STAGING_RELAYS 

Source
pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS";
Expand description

Environment variable to force the use of staging relays.

+ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust

ENV_FORCE_STAGING_RELAYS

Constant ENV_FORCE_STAGING_RELAYS 

Source
pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS";
Expand description

Environment variable to force the use of staging relays.

\ No newline at end of file diff --git a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html index 326aae7405..0d7b755897 100644 --- a/pr/4036/docs/iroh/endpoint/enum.RelayMode.html +++ b/pr/4036/docs/iroh/endpoint/enum.RelayMode.html @@ -1,4 +1,4 @@ -RelayMode in iroh::endpoint - Rust

RelayMode

Enum RelayMode 

Source
pub enum RelayMode {
+RelayMode in iroh::endpoint - Rust

RelayMode

Enum RelayMode 

Source
pub enum RelayMode {
     Disabled,
     Default,
     Staging,
@@ -10,14 +10,14 @@ This means that neither listening nor dialing relays will be available.

See crate::defaults::prod for the severs used.

§

Staging

Use the staging relay servers from n0.

§

Custom(RelayMap)

Use a custom relay map.

-

Implementations§

Source§

impl RelayMode

Source

pub fn relay_map(&self) -> RelayMap

Returns the relay map for this mode.

-
Source

pub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self

Create a custom relay mode from a list of RelayUrls.

+

Implementations§

Source§

impl RelayMode

Source

pub fn relay_map(&self) -> RelayMap

Returns the relay map for this mode.

+
Source

pub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self

Create a custom relay mode from a list of RelayUrls.

§Example
RelayMode::custom([
     "https://use1-1.relay.n0.iroh-canary.iroh.link.".parse()?,
     "https://euw-1.relay.n0.iroh-canary.iroh.link.".parse()?,
-]);

Trait Implementations§

Source§

impl Clone for RelayMode

Source§

fn clone(&self) -> RelayMode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RelayMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<RelayMode> for Option<TransportConfig>

Source§

fn from(mode: RelayMode) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for RelayMode

Source§

fn eq(&self, other: &RelayMode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
Source§

impl Eq for RelayMode

Source§

impl StructuralPartialEq for RelayMode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +]);

Trait Implementations§

Source§

impl Clone for RelayMode

Source§

fn clone(&self) -> RelayMode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RelayMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<RelayMode> for Option<TransportConfig>

Source§

fn from(mode: RelayMode) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for RelayMode

Source§

fn eq(&self, other: &RelayMode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
Source§

impl Eq for RelayMode

Source§

impl StructuralPartialEq for RelayMode

Auto Trait Implementations§

§

impl Freeze for RelayMode

§

impl RefUnwindSafe for RelayMode

§

impl Send for RelayMode

§

impl Sync for RelayMode

§

impl Unpin for RelayMode

§

impl UnwindSafe for RelayMode

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( diff --git a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html index d716677abc..98ff3579ee 100644 --- a/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html +++ b/pr/4036/docs/iroh/endpoint/fn.default_relay_mode.html @@ -1,4 +1,4 @@ -default_relay_mode in iroh::endpoint - Rust

default_relay_mode

Function default_relay_mode 

Source
pub fn default_relay_mode() -> RelayMode
Expand description

Returns the default relay mode.

+default_relay_mode in iroh::endpoint - Rust

default_relay_mode

Function default_relay_mode 

Source
pub fn default_relay_mode() -> RelayMode
Expand description

Returns the default relay mode.

If the IROH_FORCE_STAGING_RELAYS environment variable is non empty, it will return RelayMode::Staging. Otherwise, it will return RelayMode::Default.

\ No newline at end of file diff --git a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html index ff8dda7e69..b444491b3e 100644 --- a/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html +++ b/pr/4036/docs/iroh/endpoint/fn.force_staging_infra.html @@ -1,2 +1,2 @@ -force_staging_infra in iroh::endpoint - Rust

force_staging_infra

Function force_staging_infra 

Source
pub fn force_staging_infra() -> bool
Expand description

Returns true if the use of staging relays is forced.

+force_staging_infra in iroh::endpoint - Rust

force_staging_infra

Function force_staging_infra 

Source
pub fn force_staging_infra() -> bool
Expand description

Returns true if the use of staging relays is forced.

\ No newline at end of file diff --git a/pr/4036/docs/iroh/endpoint/index.html b/pr/4036/docs/iroh/endpoint/index.html index 2efb803d4c..f3a98d45f2 100644 --- a/pr/4036/docs/iroh/endpoint/index.html +++ b/pr/4036/docs/iroh/endpoint/index.html @@ -1,4 +1,4 @@ -iroh::endpoint - Rust

Module endpoint

Module endpoint 

Source
Expand description

The Endpoint allows establishing connections to other iroh endpoints.

+iroh::endpoint - Rust

Module endpoint

Module endpoint 

Source
Expand description

The Endpoint allows establishing connections to other iroh endpoints.

The Endpoint is the main API interface to manage a local iroh endpoint. It allows connecting to and accepting connections from other endpoints. See the module docs for more details on how iroh connections work.

diff --git a/pr/4036/docs/iroh/endpoint/presets/index.html b/pr/4036/docs/iroh/endpoint/presets/index.html index 37b792c03d..a454626701 100644 --- a/pr/4036/docs/iroh/endpoint/presets/index.html +++ b/pr/4036/docs/iroh/endpoint/presets/index.html @@ -2,4 +2,4 @@

§Example

use iroh::{Endpoint, RelayMode, Watcher, endpoint::presets};
 
-let endpoint = Endpoint::builder(presets::N0).bind().await?;

Structs§

Empty
An empty preset that doesn’t set anything on the builder.
Minimalwith_crypto_provider
A preset that is almost empty, besides setting mandatory options.
N0with_crypto_provider
Configures the endpoint to use the n0 defaults
N0DisableRelaywith_crypto_provider
Configures the endpoint to use the n0 defaults, but with relay mode disabled.

Traits§

Preset
Defines a preset
\ No newline at end of file +let endpoint = Endpoint::builder(presets::N0).bind().await?;

Structs§

Empty
An empty preset that doesn’t set anything on the builder.
Minimalwith_crypto_provider
A preset that is almost empty, besides setting mandatory options.
N0with_crypto_provider
Configures the endpoint to use the n0 defaults
N0DisableRelaywith_crypto_provider
Configures the endpoint to use the n0 defaults, but with relay mode disabled.

Traits§

Preset
A reusable bundle of endpoint Builder configuration.
\ No newline at end of file diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html index 41c532b301..cf9fb0156e 100644 --- a/pr/4036/docs/iroh/endpoint/presets/struct.N0.html +++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0.html @@ -6,8 +6,8 @@
  • setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending on which feature is enabled in iroh (preferring ring if both are enabled).
  • -

    Due to the last point, this preset is only available with the ring or -aws-lc-rs preset installed. +

    Due to the last point, this preset is only available with the tls-ring or +tls-aws-lc-rs feature enabled. If you want to set your own crypto provider, we recommend copying the implementation of this preset into your own and setting the appropriate crypto provider there.

    diff --git a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html index dd14c88ba9..29795833c9 100644 --- a/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html +++ b/pr/4036/docs/iroh/endpoint/presets/struct.N0DisableRelay.html @@ -7,8 +7,8 @@ relay urls.
  • setting the [rustls::crypto::CryptoProvider] to ring or aws-lc-rs, depending on which feature is enabled in iroh (preferring ring if both are enabled).
  • -

    Due to the last point, this preset is only available with the ring or -aws-lc-rs preset installed. +

    Due to the last point, this preset is only available with the tls-ring or +tls-aws-lc-rs feature enabled. If you want to set your own crypto provider, we recommend copying the implementation of this preset into your own and setting the appropriate crypto provider there.

    diff --git a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html index 59a71a95da..7e6f4bbcac 100644 --- a/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html +++ b/pr/4036/docs/iroh/endpoint/presets/trait.Preset.html @@ -1,7 +1,7 @@ -Preset in iroh::endpoint::presets - Rust

    Preset

    Trait Preset 

    Source
    pub trait Preset {
    +Preset in iroh::endpoint::presets - Rust

    Preset

    Trait Preset 

    Source
    pub trait Preset {
         // Required method
         fn apply(self, builder: Builder) -> Builder;
    -}
    Expand description

    Defines a preset

    +}
    Expand description

    A reusable bundle of endpoint Builder configuration.

    Required Methods§

    Source

    fn apply(self, builder: Builder) -> Builder

    Applies the configuration to the passed in Builder.

    Implementations on Foreign Types§

    Source§

    impl Preset for Arc<TestTransport>

    Available on crate feature unstable-custom-transports and (crate features test-utils) only.
    Source§

    fn apply(self, builder: Builder) -> Builder

    Configures the builder with this transport and the network’s address lookup.

    §Example
    diff --git a/pr/4036/docs/iroh/endpoint/struct.Builder.html b/pr/4036/docs/iroh/endpoint/struct.Builder.html index 79894b8924..7cbb050d5e 100644 --- a/pr/4036/docs/iroh/endpoint/struct.Builder.html +++ b/pr/4036/docs/iroh/endpoint/struct.Builder.html @@ -92,7 +92,7 @@ is set to false explicitly.

    destination addresses. It is valid to configure this, but no more than one such socket should be bound or the routing will be non-deterministic.

    To use a subnet with a non-zero prefix length as the default route in addition to -being routed when its prefix matches, use `BindOpts::set_is_default_route. +being routed when its prefix matches, use BindOpts::set_is_default_route. Subnets with a prefix length of zero are always marked as default routes.

    Finally note that most outgoing datagrams are part of an existing network flow. That is, they are in response to an incoming datagram. In this case the outgoing datagram @@ -142,7 +142,7 @@ direct addresses or relay URLs will fail.

    Source

    pub fn addr_filter(self, filter: AddrFilter) -> Self

    Sets the address filter applied to all address data before publishing.

    This filter is applied once, at the AddressLookupServices level, before distributing data to any individual address lookup service. This ensures -consistent filtering regardless of how the services configured.

    +consistent filtering regardless of how the services are configured.

    Source

    pub fn clear_addr_filter(self) -> Self

    Clears the address filter, allowing all addresses to be published.

    This removes any filter previously set via Self::addr_filter, including filters set by presets.

    diff --git a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html index 30bf2e329e..3834b0244e 100644 --- a/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html +++ b/pr/4036/docs/iroh/endpoint/struct.ConnectOptions.html @@ -1,12 +1,12 @@ -ConnectOptions in iroh::endpoint - Rust

    ConnectOptions

    Struct ConnectOptions 

    Source
    pub struct ConnectOptions { /* private fields */ }
    Expand description

    Options for the Endpoint::connect_with_opts function.

    -

    Implementations§

    Source§

    impl ConnectOptions

    Source

    pub fn new() -> Self

    Initializes new connection options.

    +ConnectOptions in iroh::endpoint - Rust

    ConnectOptions

    Struct ConnectOptions 

    Source
    pub struct ConnectOptions { /* private fields */ }
    Expand description

    Options for the Endpoint::connect_with_opts function.

    +

    Implementations§

    Source§

    impl ConnectOptions

    Source

    pub fn new() -> Self

    Initializes new connection options.

    By default, the connection will use the same options as Endpoint::connect, e.g. a default QuicTransportConfig.

    -
    Source

    pub fn with_transport_config( +

    Source

    pub fn with_transport_config( self, transport_config: QuicTransportConfig, ) -> Self

    Sets the QUIC transport config options for this connection.

    -
    Source

    pub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self

    Sets ALPN identifiers that should be signaled as supported on connection, in +

    Source

    pub fn with_additional_alpns(self, alpns: Vec<Vec<u8>>) -> Self

    Sets ALPN identifiers that should be signaled as supported on connection, in addition to the main ALPN identifier used in Endpoint::connect_with_opts.

    This allows connecting to servers that may only support older versions of your protocol. In this case, you would add the older ALPN identifiers with this @@ -20,7 +20,7 @@ list or the main ALPN identifiers on the accept side, see the endpoint builder’s Builder::alpns function.

    -

    Trait Implementations§

    Source§

    impl Clone for ConnectOptions

    Source§

    fn clone(&self) -> ConnectOptions

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for ConnectOptions

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for ConnectOptions

    Source§

    fn default() -> ConnectOptions

    Returns the “default value” for a type. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Clone for ConnectOptions

    Source§

    fn clone(&self) -> ConnectOptions

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for ConnectOptions

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for ConnectOptions

    Source§

    fn default() -> ConnectOptions

    Returns the “default value” for a type. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh/endpoint/struct.Connection.html b/pr/4036/docs/iroh/endpoint/struct.Connection.html index ffc93497ee..74f53832af 100644 --- a/pr/4036/docs/iroh/endpoint/struct.Connection.html +++ b/pr/4036/docs/iroh/endpoint/struct.Connection.html @@ -8,7 +8,7 @@ receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered t application. Connection::close describes in more detail how to gracefully close a connection without losing application data.

    May be cloned to obtain another handle to the same connection.

    -

    Implementations§

    Source§

    impl<T: ConnectionState> Connection<T>

    Source

    pub fn open_uni(&self) -> OpenUni<'_> ⓘ

    Initiates a new outgoing unidirectional stream.

    +

    Implementations§

    Source§

    impl<T: ConnectionState> Connection<T>

    Source

    pub fn open_uni(&self) -> OpenUni<'_> ⓘ

    Initiates a new outgoing unidirectional stream.

    Streams are cheap and instantaneous to open unless blocked by flow control. As a consequence, the peer won’t be notified that a stream has been opened until the stream is actually used.

    @@ -18,13 +18,13 @@ consequence, the peer won’t be notified that a stream has been opened until th stream is actually used. Calling open_bi then waiting on the RecvStream without writing anything to SendStream will never succeed.

    Source

    pub fn accept_uni(&self) -> AcceptUni<'_> ⓘ

    Accepts the next incoming uni-directional stream.

    -
    Source

    pub fn accept_bi(&self) -> AcceptBi<'_> ⓘ

    Accept the next incoming bidirectional stream.

    +
    Source

    pub fn accept_bi(&self) -> AcceptBi<'_> ⓘ

    Accepts the next incoming bidirectional stream.

    Important Note: The peer that calls open_bi must write to its SendStream before the peer Connection is able to accept the stream using accept_bi(). Calling open_bi then waiting on the RecvStream without writing anything to the connected SendStream will never succeed.

    Source

    pub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ

    Receives an application datagram.

    -
    Source

    pub async fn closed(&self) -> ConnectionError

    Wait for the connection to be closed for any reason.

    +
    Source

    pub async fn closed(&self) -> ConnectionError

    Waits for the connection to be closed for any reason.

    Despite the return type’s name, closed connections are often not an error condition at the application layer. Cases that might be routine include ConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.

    @@ -97,17 +97,18 @@ strong and pseudorandom, and are suitable for use as keying material.

    Source

    pub fn set_max_concurrent_uni_streams(&self, count: VarInt)

    Modifies the number of unidirectional streams that may be concurrently opened.

    No streams may be opened by the peer unless fewer than count are already open. Large counts increase both minimum and worst-case memory consumption.

    -
    Source

    pub fn set_receive_window(&self, receive_window: VarInt)

    See [noq_proto::TransportConfig::receive_window].

    -
    Source

    pub fn set_max_concurrent_bi_streams(&self, count: VarInt)

    Modifies the number of bidirectional streams that may be concurrently opened.

    +
    Source

    pub fn set_receive_window(&self, receive_window: VarInt)

    Sets the connection-level flow control receive window.

    +

    See [noq_proto::TransportConfig::receive_window].

    +
    Source

    pub fn set_max_concurrent_bi_streams(&self, count: VarInt)

    Modifies the number of bidirectional streams that may be concurrently opened.

    No streams may be opened by the peer unless fewer than count are already open. Large counts increase both minimum and worst-case memory consumption.

    -
    Source§

    impl Connection<HandshakeCompleted>

    Source

    pub fn alpn(&self) -> &[u8] ⓘ

    Extracts the ALPN protocol from the peer’s handshake data.

    -
    Source

    pub fn remote_id(&self) -> EndpointId

    Returns the EndpointId from the peer’s TLS certificate.

    +
    Source§

    impl Connection<HandshakeCompleted>

    Source

    pub fn alpn(&self) -> &[u8] ⓘ

    Extracts the ALPN protocol from the peer’s handshake data.

    +
    Source

    pub fn remote_id(&self) -> EndpointId

    Returns the EndpointId from the peer’s TLS certificate.

    The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is included in the TLS certificate presented during the handshake when connecting. This function allows you to get the EndpointId of the remote endpoint of this connection.

    -
    Source

    pub fn paths(&self) -> PathList<'_>

    Returns the currently open network paths for this connection.

    +
    Source

    pub fn paths(&self) -> PathList<'_>

    Returns the currently open network paths for this connection.

    A connection typically has one path via the relay server and, once holepunching succeeds, a direct path. The returned PathList is a snapshot taken at call time: it does not @@ -116,14 +117,14 @@ already closed.

    To observe changes over time, see Connection::paths_stream for a stream of PathList snapshots and Connection::path_events for individual PathEvents.

    -
    Source

    pub fn paths_stream(&self) -> PathListStream<'_>

    Returns a stream of PathList snapshots for this connection.

    +
    Source

    pub fn paths_stream(&self) -> PathListStream<'_>

    Returns a stream of PathList snapshots for this connection.

    Yields the current snapshot on the first poll, and a fresh snapshot whenever the open paths or the selected path change. Ends when the connection closes.

    The stream borrows this Connection. To consume it from a spawned task, move a Connection clone into the task and call this method inside.

    -
    Source

    pub fn path_events(&self) -> PathEventStream

    Returns a stream of PathEvents for this connection.

    +
    Source

    pub fn path_events(&self) -> PathEventStream

    Returns a stream of PathEvents for this connection.

    Each event reports one of: a path opened, a path closed (with final per-path statistics), the selected transmission path changed, or the consumer fell behind. The stream ends when the @@ -133,14 +134,14 @@ may be moved into a spawned task.

    single PathEvent::Lagged; the current state of the open paths and the selected path remains recoverable via Connection::paths.

    -
    Source

    pub fn side(&self) -> Side

    Returns the side of the connection (client or server).

    -
    Source

    pub fn weak_handle(&self) -> WeakConnectionHandle

    Returns a WeakConnectionHandle for this connection.

    +
    Source

    pub fn side(&self) -> Side

    Returns the side of the connection (client or server).

    +
    Source

    pub fn weak_handle(&self) -> WeakConnectionHandle

    Returns a WeakConnectionHandle for this connection.

    A WeakConnectionHandle does not keep the connection alive. It can be used to wait for the connection to be closed via WeakConnectionHandle::closed and to attempt to upgrade back to a strong Connection via WeakConnectionHandle::upgrade.

    -
    Source§

    impl Connection<IncomingZeroRtt>

    Source

    pub fn alpn(&self) -> Option<Vec<u8>>

    Extracts the ALPN protocol from the peer’s handshake data.

    -
    Source

    pub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>

    Waits until the full handshake occurs and then returns a Connection.

    +
    Source§

    impl Connection<IncomingZeroRtt>

    Source

    pub fn alpn(&self) -> Option<Vec<u8>>

    Extracts the ALPN protocol from the peer’s handshake data.

    +
    Source

    pub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>

    Waits until the full handshake occurs and then returns a Connection.

    This may fail with ConnectingError::ConnectionError, if there was some general failure with the connection, such as a network timeout since we accepted the connection.

    @@ -149,18 +150,18 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint uses and requires.

    Thus, those errors should only occur if someone connects to you with a modified iroh endpoint or with a plain QUIC client.

    -
    Source

    pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>

    Returns the EndpointId from the peer’s TLS certificate.

    +
    Source

    pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>

    Returns the EndpointId from the peer’s TLS certificate.

    The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is included in the TLS certificate presented during the handshake when connecting. This function allows you to get the EndpointId of the remote endpoint of this connection.

    -
    Source§

    impl Connection<OutgoingZeroRtt>

    Source

    pub fn alpn(&self) -> Option<Vec<u8>>

    Extracts the ALPN protocol from the peer’s handshake data.

    -
    Source

    pub async fn handshake_completed( +

    Source§

    impl Connection<OutgoingZeroRtt>

    Source

    pub fn alpn(&self) -> Option<Vec<u8>>

    Extracts the ALPN protocol from the peer’s handshake data.

    +
    Source

    pub async fn handshake_completed( &self, ) -> Result<ZeroRttStatus, ConnectingError>

    Waits until the full handshake occurs and returns a ZeroRttStatus.

    -

    If ZeroRttStatus::Accepted is returned, than any streams created before +

    If ZeroRttStatus::Accepted is returned, then any streams created before the handshake has completed can still be used.

    -

    If ZeroRttStatus::Rejected is returned, than any streams created before +

    If ZeroRttStatus::Rejected is returned, then any streams created before the handshake will error and any data sent should be re-sent on a new stream.

    This may fail with ConnectingError::ConnectionError, if there was @@ -171,7 +172,7 @@ doesn’t use the right TLS authentication, which usually every iroh endpoint uses and requires.

    Thus, those errors should only occur if someone connects to you with a modified iroh endpoint or with a plain QUIC client.

    -
    Source

    pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>

    Returns the EndpointId from the peer’s TLS certificate.

    +
    Source

    pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>

    Returns the EndpointId from the peer’s TLS certificate.

    The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is included in the TLS certificate presented during the handshake when connecting. This function allows you to get the EndpointId of the remote endpoint of this diff --git a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html index cfd63c979e..0c6c2630b7 100644 --- a/pr/4036/docs/iroh/endpoint/struct.Endpoint.html +++ b/pr/4036/docs/iroh/endpoint/struct.Endpoint.html @@ -13,7 +13,7 @@ behaviour.

    Endpoint::connect and Endpoint::accept methods. Once established, the Connection gives access to most QUIC features. Individual streams to send data to the peer are created using the Connection::open_bi, Connection::accept_bi, -Connection::open_uni and Connection::open_bi functions.

    +Connection::open_uni and Connection::accept_uni functions.

    Note that due to the light-weight properties of streams a stream will only be accepted once the initiating peer has sent some data on it.

    §Usage on Android

    @@ -22,7 +22,7 @@ through JNI, which needs a JVM context published to DnsResolver for the supported initialization paths.

    -

    Implementations§

    Source§

    impl Endpoint

    Source

    pub fn builder(preset: impl Preset) -> Builder

    Returns the builder for an Endpoint, with the given Preset configuration.

    +

    Implementations§

    Source§

    impl Endpoint

    Source

    pub fn builder(preset: impl Preset) -> Builder

    Returns the builder for an Endpoint, with the given Preset configuration.

    Source

    pub async fn bind(preset: impl Preset) -> Result<Self, BindError>

    Constructs a default Endpoint using the provided Preset and binds it immediately.

    Source

    pub fn set_alpns(&self, alpns: Vec<Vec<u8>>)

    Sets the list of accepted ALPN protocols.

    This will only affect new incoming connections. @@ -117,8 +117,8 @@ changes.

    understand if the endpoint has ever been considered “online”. But after that initial call to Endpoint::online, to understand if your endpoint is no longer able to be connected to by endpoints outside -of the private or local network, watch for changes in it’s EndpointAddr. -If there are no addrsin the EndpointAddr, you may not be dialable by other endpoints +of the private or local network, watch for changes in its EndpointAddr. +If there are no addrs in the EndpointAddr, you may not be dialable by other endpoints on the internet.

    The EndpointAddr will change as:

      @@ -146,7 +146,7 @@ tokio::spawn(endpoint_closed.run_until(async move { })); // Do fancy things, then close the endpoint. // Our task above will stop even if there are still clones of `Endpoint` alive somewhere. -endpoint.close().await;
    Source

    pub async fn online(&self)

    A convenience method that waits for the endpoint to be considered “online”.

    +endpoint.close().await;
    Source

    pub async fn online(&self)

    A convenience method that waits for the endpoint to be considered “online”.

    This currently means at least one relay server has completed its connection handshake (i.e. the endpoint is registered and reachable via that relay). Merely selecting a relay URL is not sufficient.

    @@ -167,49 +167,45 @@ entirely.

    The online method does not interact with crate::address_lookup::AddressLookup services, which means that any Address Lookup that relies on a WAN connection is independent of the endpoint’s online status.

    -
    §Examples
    use iroh::Endpoint;
    -
    -#[tokio::main]
    -async fn main() {
    -// After this await returns, the endpoint is bound to a local socket.
    -// It can be dialed, but almost certainly hasn't finished picking a
    +
    §Examples
    +
    // After this await returns, the endpoint is bound to a local socket.
    +// It can be dialed, but almost certainly hasn't finished picking a
     // relay.
    -let endpoint = Endpoint::bind().await;
    +let endpoint = Endpoint::bind(presets::N0).await?;
     
    -// After this await returns we have a connection to at least one relay
    +// After this await returns we have a connection to at least one relay
     // and holepunching should work as expected.
    -endpoint.online().await;
    -}
    Source

    pub fn home_relay_status( +endpoint.online().await;

    Source

    pub fn home_relay_status( &self, ) -> impl Watcher<Value = Vec<RelayStatus>> + use<>

    Returns a Watcher over the connection status of the endpoint’s home relays.

    The watched value has one entry per home relay whose URL is known, and is empty when no relays are configured or before the endpoint has -selected one the home relay from the list of configured relays. +selected a home relay from the list of configured relays. The watcher updates whenever any home relay’s connection status changes. See RelayStatus for the information available on each entry.

    The returned watcher only becomes disconnected once the last clone of the Endpoint is dropped. Closing the endpoint does not disconnect the watcher. To stop a task once the endpoint stops, combine with Self::closed.

    -
    Source

    pub fn bound_sockets(&self) -> Vec<SocketAddr>

    Available on non-wasm_browser only.

    Returns the local socket addresses on which the underlying sockets are bound.

    +
    Source

    pub fn bound_sockets(&self) -> Vec<SocketAddr>

    Available on non-wasm_browser only.

    Returns the local socket addresses on which the underlying sockets are bound.

    The Endpoint always binds on an IPv4 address and also tries to bind on an IPv6 address if available.

    -
    Source

    pub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>

    Available on non-wasm_browser only.

    Returns the DNS resolver used in this Endpoint.

    +
    Source

    pub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError>

    Available on non-wasm_browser only.

    Returns the DNS resolver used in this Endpoint.

    §Errors

    Returns an EndpointError::Closed error if the endpoint is closed.

    See Builder::dns_resolver.

    -
    Source

    pub fn tls_config(&self) -> &ClientConfig

    Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.

    +
    Source

    pub fn tls_config(&self) -> &ClientConfig

    Returns the [rustls::ClientConfig] used by the endpoint for connecting to external services.

    This might be useful for address lookup services or other functions that want to use the same trust anchors as iroh does for verifying the validity of TLS certificates presented by external services.

    Note that this TLS config is unrelated to how iroh validates the authenticity of iroh connections itself.

    The config is based on the trust anchors set via Builder::ca_tls_config.

    -
    Source

    pub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>

    Returns the Address Lookup service, if configured.

    +
    Source

    pub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError>

    Returns the Address Lookup service, if configured.

    §Errors

    Returns a EndpointError::Closed error if the endpoint is closed.

    See Builder::address_lookup.

    -
    Source

    pub fn metrics(&self) -> &EndpointMetrics

    Available on crate feature metrics only.

    Returns metrics collected for this endpoint.

    +
    Source

    pub fn metrics(&self) -> &EndpointMetrics

    Available on crate feature metrics only.

    Returns metrics collected for this endpoint.

    The endpoint internally collects various metrics about its operation. The returned EndpointMetrics struct contains all of these metrics.

    You can access individual metrics directly by using the public fields:

    @@ -275,13 +271,13 @@ registry.write().unwrap().register_all(endpoint.metrics()); .std_context("text")?; assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#)); -assert!(res.contains(r#"socket_recv_datagrams_total 0"#));
    Source

    pub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>

    Returns addressing information about a recently used remote endpoint.

    +assert!(res.contains(r#"socket_recv_datagrams_total 0"#));
    Source

    pub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo>

    Returns addressing information about a recently used remote endpoint.

    The returned RemoteInfo contains a list of all transport addresses for the remote that we know about. This is a snapshot in time and not a watcher.

    Returns None if the endpoint doesn’t have information about the remote or if the endpoint is closed. When remote endpoints are no longer used, our endpoint will keep information around for a little while, and then drop it. Afterwards, this will return None.

    -
    Source

    pub async fn network_change(&self)

    Notifies the system of potential network changes.

    +
    Source

    pub async fn network_change(&self)

    Notifies the system of potential network changes.

    On many systems iroh is able to detect network changes by itself, however some systems like android do not expose this functionality to native code. Android does however provide this functionality to Java code. This @@ -290,14 +286,14 @@ this.

    Even when the network did not change, or iroh was already able to detect the network change itself, there is no harm in calling this function.

    If the endpoint is closed, this method will log a warning and ignore the request.

    -
    Source

    pub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)

    Sets the initial user-defined data to be published in Address Lookups for this endpoint.

    +
    Source

    pub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>)

    Sets the initial user-defined data to be published in Address Lookups for this endpoint.

    If the user-defined data passed to this function is different to the previous one, the endpoint will republish its endpoint info to the configured Address Lookups.

    See also Builder::user_data_for_address_lookup for setting an initial value when building the endpoint.

    If the endpoint is closed, this method will log a warning and ignore the request.

    -
    Source

    pub async fn close(&self)

    Closes the QUIC endpoint and the socket.

    +
    Source

    pub async fn close(&self)

    Closes the QUIC endpoint and the socket.

    This will close any remaining open Connections with an error code of 0 and an empty reason. Though it is best practice to close those explicitly before with a custom error code and reason.

    @@ -322,9 +318,9 @@ sockets. This is due to QUIC and its acknowledgments being implemented in user-l while TCP sockets usually get closed and drained by the operating system in the kernel during the “Time-Wait” period of the TCP socket.

    Be aware however that the underlying UDP sockets are only closed once all clones of -the the respective Endpoint are dropped.

    -
    Source

    pub fn is_closed(&self) -> bool

    Check if this endpoint is still alive, or already closed.

    -
    Source

    pub fn closed(&self) -> EndpointClosed ⓘ

    Returns a future that resolves once the endpoint closes.

    +the respective Endpoint are dropped.

    +
    Source

    pub fn is_closed(&self) -> bool

    Check if this endpoint is still alive, or already closed.

    +
    Source

    pub fn closed(&self) -> EndpointClosed ⓘ

    Returns a future that resolves once the endpoint closes.

    The returned future does not contain a clone or reference to the Endpoint, so keeping the returned future alive does not prevent the endpoint from being dropped.

    To run a task and stop it once the endpoint closes, you can use @@ -333,7 +329,7 @@ so keeping the returned future alive does not prevent the endpoint from being dr

    let endpoint = Endpoint::bind(presets::N0).await?;
     tokio::spawn(endpoint.closed().run_until(async move {
         // the future will be aborted once the endpoint closes.
    -}));
    Source

    pub fn create_server_config_builder( +}));

    Source

    pub fn create_server_config_builder( &self, alpns: Vec<Vec<u8>>, ) -> ServerConfigBuilder

    Create a ServerConfigBuilder for this endpoint that includes the given alpns.

    diff --git a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html index 85b8fd921b..1a2b9e3683 100644 --- a/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html +++ b/pr/4036/docs/iroh/endpoint/struct.EndpointClosed.html @@ -1,9 +1,9 @@ -EndpointClosed in iroh::endpoint - Rust

    EndpointClosed

    Struct EndpointClosed 

    Source
    pub struct EndpointClosed { /* private fields */ }
    Expand description

    Future returned from Endpoint::closed.

    -

    Implementations§

    Source§

    impl EndpointClosed

    Source

    pub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>

    Runs a future to completion, or until the Endpoint is closed.

    +EndpointClosed in iroh::endpoint - Rust

    EndpointClosed

    Struct EndpointClosed 

    Source
    pub struct EndpointClosed { /* private fields */ }
    Expand description

    Future returned from Endpoint::closed.

    +

    Implementations§

    Source§

    impl EndpointClosed

    Source

    pub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output>

    Runs a future to completion, or until the Endpoint is closed.

    Returns the output of fut if it completes before the endpoint closes, or None otherwise.

    -

    Trait Implementations§

    Source§

    impl Debug for EndpointClosed

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Future for EndpointClosed

    Source§

    type Output = ()

    The type of value produced on completion.
    Source§

    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

    Attempts to resolve the future to a final value, registering -the current task for wakeup if the value is not yet available. Read more
    Source§

    impl<'pin> Unpin for EndpointClosed
    where +

    Trait Implementations§

    Source§

    impl Debug for EndpointClosed

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Future for EndpointClosed

    Source§

    type Output = ()

    The type of value produced on completion.
    Source§

    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

    Attempts to resolve the future to a final value, registering +the current task for wakeup if the value is not yet available. Read more
    Source§

    impl<'pin> Unpin for EndpointClosed
    where PinnedFieldsOf<__EndpointClosed<'pin>>: Unpin,

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where diff --git a/pr/4036/docs/iroh/endpoint/struct.Incoming.html b/pr/4036/docs/iroh/endpoint/struct.Incoming.html index d0a2c29af8..eca1097eca 100644 --- a/pr/4036/docs/iroh/endpoint/struct.Incoming.html +++ b/pr/4036/docs/iroh/endpoint/struct.Incoming.html @@ -24,7 +24,7 @@ to customize a
    Source

    pub fn remote_addr_validated(&self) -> bool

    Whether the socket address that is initiating this connection has been validated.

    This means that the sender of the initial packet has proved that they can receive traffic sent to self.remote_addr().

    -

    Source

    pub fn decrypt(&self) -> Option<DecryptedInitial>

    Decrypt the Initial packet payload

    +
    Source

    pub fn decrypt(&self) -> Option<DecryptedInitial>

    Decrypts the Initial packet payload.

    This clones and decrypts the packet payload (~1200 bytes). Can be used to extract information from the TLS ClientHello without completing the handshake.

    Trait Implementations§

    Source§

    impl Debug for Incoming

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl IntoFuture for Incoming

    Source§

    type Output = Result<Connection, ConnectingError>

    The output that the future will produce on completion.
    Source§

    type IntoFuture = IncomingFuture

    Which kind of future are we turning this into?
    Source§

    fn into_future(self) -> Self::IntoFuture

    Creates a future from a value. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where diff --git a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html index 3a193bd40a..5189f21509 100644 --- a/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html +++ b/pr/4036/docs/iroh/endpoint/struct.QuicTransportConfigBuilder.html @@ -136,7 +136,7 @@ enable multipath as well.

    If the path is idle for this long the path will be abandoned. Bear in mind this will interact with the QuicTransportConfigBuilder::max_idle_timeout, if the last path is abandoned the entire connection will be closed.

    -

    Note: values higher than [PATH_MAX_IDLE_TIMEOUT] are clamped and a warning is logged.

    +

    Note: values higher than PATH_MAX_IDLE_TIMEOUT (15 seconds) are clamped and a warning is logged.

    Source

    pub fn default_path_keep_alive_interval(self, interval: Duration) -> Self

    Sets a default per-path keep alive interval.

    Note that this does not interact with the connection-wide QuicTransportConfigBuilder::keep_alive_interval. This setting will keep this path active, diff --git a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html index 175b637f76..a1abba7e98 100644 --- a/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html +++ b/pr/4036/docs/iroh/endpoint/struct.RelayStatus.html @@ -1,13 +1,13 @@ -RelayStatus in iroh::endpoint - Rust

    RelayStatus

    Struct RelayStatus 

    Source
    pub struct RelayStatus { /* private fields */ }
    Expand description

    Connection status of a single home relay.

    +RelayStatus in iroh::endpoint - Rust

    RelayStatus

    Struct RelayStatus 

    Source
    pub struct RelayStatus { /* private fields */ }
    Expand description

    Connection status of a single home relay.

    Observed via Endpoint::home_relay_status.

    -

    Implementations§

    Source§

    impl RelayStatus

    Source

    pub fn url(&self) -> &RelayUrl

    Returns the URL of the home relay.

    -
    Source

    pub fn is_connected(&self) -> bool

    Returns true if the endpoint is connected to the relay.

    -
    Source

    pub fn last_error(&self) -> Option<&AnyError>

    Returns the most recent connection error, if the relay is currently +

    Implementations§

    Source§

    impl RelayStatus

    Source

    pub fn url(&self) -> &RelayUrl

    Returns the URL of the home relay.

    +
    Source

    pub fn is_connected(&self) -> bool

    Returns true if the endpoint is connected to the relay.

    +
    Source

    pub fn last_error(&self) -> Option<&AnyError>

    Returns the most recent connection error, if the relay is currently disconnected.

    Returns None when the relay is connected, or when the endpoint has not yet observed a failed connection attempt.

    -

    Trait Implementations§

    Source§

    impl Clone for RelayStatus

    Source§

    fn clone(&self) -> RelayStatus

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayStatus

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl PartialEq for RelayStatus

    Source§

    fn eq(&self, other: &RelayStatus) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
    Source§

    impl Eq for RelayStatus

    Source§

    impl StructuralPartialEq for RelayStatus

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Clone for RelayStatus

    Source§

    fn clone(&self) -> RelayStatus

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayStatus

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl PartialEq for RelayStatus

    Source§

    fn eq(&self, other: &RelayStatus) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
    Source§

    impl Eq for RelayStatus

    Source§

    impl StructuralPartialEq for RelayStatus

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh/endpoint/struct.VarInt.html b/pr/4036/docs/iroh/endpoint/struct.VarInt.html index 0acf99654d..007540d1af 100644 --- a/pr/4036/docs/iroh/endpoint/struct.VarInt.html +++ b/pr/4036/docs/iroh/endpoint/struct.VarInt.html @@ -13,7 +13,7 @@ An integer less than 2^62

    of overflowing.

    Trait Implementations§

    §

    impl Clone for VarInt

    §

    fn clone(&self) -> VarInt

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    §

    impl Debug for VarInt

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Decodable for VarInt

    §

    fn decode<B>(r: &mut B) -> Result<VarInt, UnexpectedEnd>
    where B: Buf,

    Decode a Self from the provided buffer, if the buffer is large enough
    §

    impl Default for VarInt

    §

    fn default() -> VarInt

    Returns the “default value” for a type. Read more
    §

    impl Display for VarInt

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    §

    impl Encodable for VarInt

    §

    fn encode<B>(&self, w: &mut B)
    where - B: BufMut,

    Append the encoding of self to the provided buffer.
    Source§

    impl From<FrameType> for VarInt

    Source§

    fn from(value: FrameType) -> VarInt

    Converts to this type from the input type.
    §

    impl From<StreamId> for VarInt

    §

    fn from(x: StreamId) -> VarInt

    Converts to this type from the input type.
    §

    impl From<Code> for VarInt

    §

    fn from(value: Code) -> VarInt

    Converts to this type from the input type.
    §

    impl From<VarInt> for IdleTimeout

    §

    fn from(inner: VarInt) -> IdleTimeout

    Converts to this type from the input type.
    §

    impl From<VarInt> for StreamId

    §

    fn from(v: VarInt) -> StreamId

    Converts to this type from the input type.
    §

    impl From<VarInt> for Code

    §

    fn from(value: VarInt) -> Code

    Converts to this type from the input type.
    §

    impl From<u16> for VarInt

    §

    fn from(x: u16) -> VarInt

    Converts to this type from the input type.
    §

    impl From<u32> for VarInt

    §

    fn from(x: u32) -> VarInt

    Converts to this type from the input type.
    §

    impl From<u8> for VarInt

    §

    fn from(x: u8) -> VarInt

    Converts to this type from the input type.
    §

    impl Hash for VarInt

    §

    fn hash<__H>(&self, state: &mut __H)
    where + B: BufMut,

    Append the encoding of self to the provided buffer.
    Source§

    impl From<FrameType> for VarInt

    Source§

    fn from(value: FrameType) -> VarInt

    Converts to this type from the input type.
    §

    impl From<StreamId> for VarInt

    §

    fn from(x: StreamId) -> VarInt

    Converts to this type from the input type.
    §

    impl From<Code> for VarInt

    §

    fn from(value: Code) -> VarInt

    Converts to this type from the input type.
    §

    impl From<VarInt> for IdleTimeout

    §

    fn from(inner: VarInt) -> IdleTimeout

    Converts to this type from the input type.
    §

    impl From<VarInt> for StreamId

    §

    fn from(v: VarInt) -> StreamId

    Converts to this type from the input type.
    §

    impl From<VarInt> for Code

    §

    fn from(value: VarInt) -> Code

    Converts to this type from the input type.
    §

    impl From<u16> for VarInt

    §

    fn from(x: u16) -> VarInt

    Converts to this type from the input type.
    §

    impl From<u32> for VarInt

    §

    fn from(x: u32) -> VarInt

    Converts to this type from the input type.
    §

    impl From<u8> for VarInt

    §

    fn from(x: u8) -> VarInt

    Converts to this type from the input type.
    §

    impl Hash for VarInt

    §

    fn hash<__H>(&self, state: &mut __H)
    where __H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · Source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    §

    impl Ord for VarInt

    §

    fn cmp(&self, other: &VarInt) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · Source§

    fn max(self, other: Self) -> Self
    where diff --git a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html index 47f6c23610..07bad208d7 100644 --- a/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html +++ b/pr/4036/docs/iroh/endpoint/struct.WeakConnectionHandle.html @@ -1,18 +1,18 @@ -WeakConnectionHandle in iroh::endpoint - Rust

    WeakConnectionHandle

    Struct WeakConnectionHandle 

    Source
    pub struct WeakConnectionHandle { /* private fields */ }
    Expand description

    A weak handle to a Connection.

    +WeakConnectionHandle in iroh::endpoint - Rust

    WeakConnectionHandle

    Struct WeakConnectionHandle 

    Source
    pub struct WeakConnectionHandle { /* private fields */ }
    Expand description

    A weak handle to a Connection.

    A WeakConnectionHandle does not keep the connection alive: holding one will not prevent the connection from being closed when the last Connection handle is dropped.

    Use upgrade to obtain a strong Connection, and closed to wait for the connection to be closed without keeping it alive.

    -

    Implementations§

    Source§

    impl WeakConnectionHandle

    Source

    pub fn upgrade(&self) -> Option<Connection>

    Attempts to upgrade this weak handle to a strong Connection.

    +

    Implementations§

    Source§

    impl WeakConnectionHandle

    Source

    pub fn upgrade(&self) -> Option<Connection>

    Attempts to upgrade this weak handle to a strong Connection.

    Returns None if the connection has already been dropped.

    -
    Source

    pub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static

    Returns a future that resolves once the connection has been closed.

    +
    Source

    pub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static

    Returns a future that resolves once the connection has been closed.

    If no strong references to the Connection exist at the time this is called, the future resolves to None. If at least one strong reference still exists at the time of this call, the returned future is guaranteed to receive the close event with the close reason and final connection statistics, even if all strong references are dropped before the future is awaited.

    The future does not keep the connection alive.

    -

    Trait Implementations§

    Source§

    impl Clone for WeakConnectionHandle

    Source§

    fn clone(&self) -> WeakConnectionHandle

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for WeakConnectionHandle

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Clone for WeakConnectionHandle

    Source§

    fn clone(&self) -> WeakConnectionHandle

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for WeakConnectionHandle

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html index 2ac883dd5d..90c7ff04fc 100644 --- a/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html +++ b/pr/4036/docs/iroh/endpoint/trait.EndpointHooks.html @@ -17,7 +17,7 @@

    For each hook, all installed hooks are invoked in the order they were installed on the endpoint builder. If a hook returns Accept, processing continues with the next hook. If a hook returns Reject, processing is aborted and further hooks -are not invoked for this hook.

    +are not invoked for this hook point.

    §Notes to implementers

    As hooks are stored on the endpoint, you must make sure to never store an Endpoint on the hook struct itself, as this would create reference counting loop and cause the diff --git a/pr/4036/docs/iroh/endpoint_info/index.html b/pr/4036/docs/iroh/endpoint_info/index.html index f27fe3b898..4a60b9fd8f 100644 --- a/pr/4036/docs/iroh/endpoint_info/index.html +++ b/pr/4036/docs/iroh/endpoint_info/index.html @@ -1,11 +1,11 @@ iroh::endpoint_info - Rust

    Module endpoint_info

    Module endpoint_info 

    Source
    Expand description

    Support for handling DNS resource records for dialing by EndpointId.

    Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS servers or the Mainline DHT. This module supports creating and parsing these records.

    -

    EndpointInfo combines an iroh_base::EndpointId with EndpointData — +

    EndpointInfo combines an iroh_base::EndpointId with EndpointData: the addressing and metadata that discovery services publish and resolve. Discovery services use AddrFilter to control which addresses are published.

    This module also provides serialization to and from pkarr signed packets and -DNS TXT records. See the [crate::attrs] module for the on-the-wire format.

    +DNS TXT records.

    DNS records are published under the following names:

    _iroh.<z32-endpoint-id>.<origin-domain> TXT

      @@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.

    Structs§

    AddrFilter
    A filter and/or reordering function applied to transport addresses, -typically used by AddressLookup services in iroh before publishing.
    EndpointData
    Data about an endpoint that may be published to and resolved from discovery services.
    EndpointInfo
    Information about an endpoint that may be published to and resolved from discovery services.
    MaxLengthExceededError
    Error returned when an input value is too long for UserData.
    UserData
    Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
    \ No newline at end of file +typically used by AddressLookup services in iroh before publishing.
    EndpointData
    Data about an endpoint that may be published to and resolved from discovery services.
    EndpointInfo
    Information about an endpoint that may be published to and resolved from discovery services.
    MaxLengthExceededError
    Error returned when an input value is too long for UserData.
    UserData
    User-defined data that can be published and resolved through endpoint discovery.
    \ No newline at end of file diff --git a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html index eaf2725892..2c818ea5b4 100644 --- a/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html +++ b/pr/4036/docs/iroh/endpoint_info/struct.EndpointData.html @@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.

    See also Self::set_user_data.

    Source

    pub fn add_relay_url(&mut self, relay_url: RelayUrl)

    Adds the relay URL to the end of the endpoint data, unless it already existed.

    Source

    pub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)

    Adds addresses in order with duplicates or already existing addresses filtered out.

    -
    Source

    pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

    Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.

    -
    Source

    pub fn set_user_data(&mut self, user_data: Option<UserData>)

    Sets the user-defined data and returns the updated endpoint data.

    +
    Source

    pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

    Adds addresses to the endpoint data in the given order, but with duplicates filtered.

    +
    Source

    pub fn set_user_data(&mut self, user_data: Option<UserData>)

    Sets the user-defined data.

    Source

    pub fn clear_ip_addrs(&mut self)

    Removes all direct addresses from the endpoint data.

    -
    Source

    pub fn clear_relay_urls(&mut self)

    Removes all direct addresses from the endpoint data.

    +
    Source

    pub fn clear_relay_urls(&mut self)

    Removes all relay URLs from the endpoint data.

    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns the relay URL of the endpoint.

    Source

    pub fn user_data(&self) -> Option<&UserData>

    Returns the optional user-defined data of the endpoint.

    Source

    pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

    Returns the direct addresses of the endpoint.

    -
    Source

    pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

    Returns the full list of all known addresses

    -
    Source

    pub fn has_addrs(&self) -> bool

    Does this have any addresses?

    +
    Source

    pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

    Returns the full list of all known addresses.

    +
    Source

    pub fn has_addrs(&self) -> bool

    Returns whether this has any addresses.

    Source

    pub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>

    Apply the given filter to the current addresses.

    Returns a vec to allow re-ordering of addresses.

    Source

    pub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, EndpointData>

    Returns the EndpointData with given filter applied.

    diff --git a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html index 3352480631..e73207e05e 100644 --- a/pr/4036/docs/iroh/endpoint_info/struct.UserData.html +++ b/pr/4036/docs/iroh/endpoint_info/struct.UserData.html @@ -1,4 +1,5 @@ -UserData in iroh::endpoint_info - Rust

    UserData

    Struct UserData 

    Source
    pub struct UserData(/* private fields */);
    Expand description

    Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

    +UserData in iroh::endpoint_info - Rust

    UserData

    Struct UserData 

    Source
    pub struct UserData(/* private fields */);
    Expand description

    User-defined data that can be published and resolved through endpoint discovery.

    +

    Under the hood this is a UTF-8 string no longer than UserData::MAX_LENGTH bytes.

    Iroh does not keep track of or examine the user-defined data.

    UserData implements FromStr and TryFrom<String>, so you can convert &str and String into UserData easily.

    diff --git a/pr/4036/docs/iroh/enum.KeyParsingError.html b/pr/4036/docs/iroh/enum.KeyParsingError.html index 765ac27ad2..146ec05698 100644 --- a/pr/4036/docs/iroh/enum.KeyParsingError.html +++ b/pr/4036/docs/iroh/enum.KeyParsingError.html @@ -1,4 +1,4 @@ -KeyParsingError in iroh - Rust

    KeyParsingError

    Enum KeyParsingError 

    Source
    #[non_exhaustive]
    pub enum KeyParsingError { +KeyParsingError in iroh - Rust

    KeyParsingError

    Enum KeyParsingError 

    Source
    #[non_exhaustive]
    pub enum KeyParsingError { FailedToDecodeHex { meta: Meta, }, @@ -11,14 +11,14 @@ InvalidKeyData { meta: Meta, }, -}
    Expand description

    Error when deserialising a PublicKey or a SecretKey.

    +}
    Expand description

    Error returned when parsing a PublicKey or a SecretKey.

    Variants (Non-exhaustive)§

    This enum is marked as non-exhaustive
    Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
    §

    FailedToDecodeHex

    The input string could not be decoded as hex.

    Fields

    §meta: Meta

    Captured call-site metadata

    §

    FailedToDecodeBase32

    The input string could not be decoded as base32.

    Fields

    §meta: Meta

    Captured call-site metadata

    §

    InvalidLength

    The input has invalid length.

    Fields

    §meta: Meta

    Captured call-site metadata

    -
    §

    InvalidKeyData

    The decoded data is not a valid Ed25591 public key.

    +
    §

    InvalidKeyData

    The decoded data is not a valid Ed25519 public key.

    Fields

    §meta: Meta

    Captured call-site metadata

    Trait Implementations§

    Source§

    impl Debug for KeyParsingError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    Source§

    impl Display for KeyParsingError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    Source§

    impl Error for KeyParsingError

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<KeyParsingError> for ParseError

    Source§

    fn from(source: KeyParsingError) -> ParseError

    Converts to this type from the input type.
    Source§

    impl StackError for KeyParsingError

    Source§

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    Source§

    fn into_std(self: Box<KeyParsingError>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    Source§

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where diff --git a/pr/4036/docs/iroh/enum.TransportAddr.html b/pr/4036/docs/iroh/enum.TransportAddr.html index df614a51ee..0e5f31d772 100644 --- a/pr/4036/docs/iroh/enum.TransportAddr.html +++ b/pr/4036/docs/iroh/enum.TransportAddr.html @@ -3,8 +3,8 @@ Ip(SocketAddr), Custom(CustomAddr), }
    Expand description

    Available address types.

    -

    Variants (Non-exhaustive)§

    This enum is marked as non-exhaustive
    Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
    §

    Relay(RelayUrl)

    Relays

    -
    §

    Ip(SocketAddr)

    IP based addresses

    +

    Variants (Non-exhaustive)§

    This enum is marked as non-exhaustive
    Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
    §

    Relay(RelayUrl)

    A relay server address.

    +
    §

    Ip(SocketAddr)

    An IP based address.

    §

    Custom(CustomAddr)

    Custom transport address

    Implementations§

    Source§

    impl TransportAddr

    Source

    pub fn is_relay(&self) -> bool

    Whether this is a transport address via a relay server.

    Source

    pub fn is_ip(&self) -> bool

    Whether this is an IP transport address.

    diff --git a/pr/4036/docs/iroh/index.html b/pr/4036/docs/iroh/index.html index a2ddd5617a..8c7bddcb16 100644 --- a/pr/4036/docs/iroh/index.html +++ b/pr/4036/docs/iroh/index.html @@ -1,5 +1,5 @@ iroh - Rust

    Crate iroh

    Crate iroh 

    Source
    Expand description

    Peer-to-peer QUIC connections.

    -

    iroh is a library to establish direct connectivity between peers. It exposes an +

    iroh is a library to establish direct connectivity between peers. It exposes an interface to QUIC connections and streams to the user, while implementing direct connectivity using hole punching complemented by relay servers under the hood.

    An iroh endpoint is created and controlled by the Endpoint, e.g. connecting to @@ -44,7 +44,7 @@ punching if needed. Once the direct connection is established the relay ser longer involved in the connection.

    If one of the iroh endpoints can be reached directly, connectivity can also be established without involving a Relay server. This is done by using the endpoint’s -listening addresses in the connection establishement instead of the RelayUrl which +listening addresses in the connection establishment instead of the RelayUrl which is used to identify a Relay server. Of course it is also possible to use both a RelayUrl and direct addresses at the same time to connect.

    §Encryption

    @@ -179,4 +179,4 @@ connecting using only the Ok(()) }

    Please see the examples directory for more nuanced examples.

    -

    Re-exports§

    pub use endpoint::Endpoint;
    pub use endpoint::RelayMode;

    Modules§

    address_lookup
    Lookup the address of an Endpoint ID.
    defaults
    Default values used in iroh
    dnsNon-wasm_browser
    Configurable DNS resolver.
    endpoint
    The Endpoint allows establishing connections to other iroh endpoints.
    endpoint_info
    Support for handling DNS resource records for dialing by EndpointId.
    metrics
    Co-locating all of the iroh metrics structs
    protocol
    Tools for spawning an accept loop that routes incoming requests to the right protocol.
    test_utilstest-utils
    Internal utilities to support testing.
    tls
    TLS configuration for iroh.

    Structs§

    EndpointAddr
    Network-level addressing information for an iroh endpoint.
    NetReport
    A net_report report.
    NetReportConfig
    Configuration for the net report component.
    PublicKey
    A public key.
    RelayConfig
    Information on a specific relay server.
    RelayMap
    List of relay server configurations to be used in an iroh endpoint.
    RelayUrl
    A URL identifying a relay server.
    RelayUrlParseError
    Can occur when parsing a string into a RelayUrl.
    SecretKey
    A secret key.
    Signature
    Ed25519 signature.
    SignatureError
    Verification of a signature failed.

    Enums§

    KeyParsingError
    Error when deserialising a PublicKey or a SecretKey.
    TransportAddr
    Available address types.

    Constants§

    NET_REPORT_TIMEOUT
    The maximum amount of time, in seconds, the net_report will spend gathering a single report.

    Traits§

    Watcher
    A handle to a value that’s represented by one or more underlying [Watchable]s.

    Type Aliases§

    EndpointId
    The identifier for an endpoint in the (iroh) network.
    \ No newline at end of file +

    Re-exports§

    pub use endpoint::Endpoint;
    pub use endpoint::RelayMode;

    Modules§

    address_lookup
    Lookup the address of an Endpoint ID.
    defaults
    Default values used in iroh
    dnsNon-wasm_browser
    Configurable DNS resolver.
    endpoint
    The Endpoint allows establishing connections to other iroh endpoints.
    endpoint_info
    Support for handling DNS resource records for dialing by EndpointId.
    metrics
    Co-locating all of the iroh metrics structs
    protocol
    Tools for spawning an accept loop that routes incoming requests to the right protocol.
    test_utilstest-utils
    Internal utilities to support testing.
    tls
    TLS configuration for iroh.

    Structs§

    EndpointAddr
    Network-level addressing information for an iroh endpoint.
    NetReport
    A net_report report.
    NetReportConfig
    Configuration for the net report component.
    PublicKey
    A public key.
    RelayConfig
    Information on a specific relay server.
    RelayMap
    List of relay server configurations to be used in an iroh endpoint.
    RelayUrl
    A URL identifying a relay server.
    RelayUrlParseError
    Can occur when parsing a string into a RelayUrl.
    SecretKey
    A secret key.
    Signature
    Ed25519 signature.
    SignatureError
    Verification of a signature failed.

    Enums§

    KeyParsingError
    Error returned when parsing a PublicKey or a SecretKey.
    TransportAddr
    Available address types.

    Constants§

    NET_REPORT_TIMEOUT
    The maximum amount of time, in seconds, the net_report will spend gathering a single report.

    Traits§

    Watcher
    A handle to a value that’s represented by one or more underlying [Watchable]s.

    Type Aliases§

    EndpointId
    The identifier for an endpoint in the (iroh) network.
    \ No newline at end of file diff --git a/pr/4036/docs/iroh/metrics/index.html b/pr/4036/docs/iroh/metrics/index.html index da53db7d6a..00f2275127 100644 --- a/pr/4036/docs/iroh/metrics/index.html +++ b/pr/4036/docs/iroh/metrics/index.html @@ -1,2 +1,2 @@ iroh::metrics - Rust

    Module metrics

    Module metrics 

    Source
    Expand description

    Co-locating all of the iroh metrics structs

    -

    Structs§

    EndpointMetrics
    Metrics collected by an crate::endpoint::Endpoint.
    NetReportMetrics
    Enum of metrics for the module
    RelayMetricstest-utils
    Metrics tracked for the relay server
    SocketMetrics
    Enum of metrics for the module
    \ No newline at end of file +

    Structs§

    EndpointMetrics
    Metrics collected by an crate::endpoint::Endpoint.
    NetReportMetrics
    Enum of metrics for the module
    RelayMetricstest-utils
    Metrics tracked for the relay server
    SocketMetrics
    Metrics collected by the iroh socket.
    \ No newline at end of file diff --git a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html index f8768e50a1..da2588f738 100644 --- a/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html +++ b/pr/4036/docs/iroh/metrics/struct.RelayMetrics.html @@ -26,21 +26,26 @@ pub http_connections_closed: Counter, pub http_connections_errored: Counter,

    }
    Available on crate feature test-utils only.
    Expand description

    Metrics tracked for the relay server

    -

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §bytes_sent: Counter

    Bytes sent from a FrameType::SendPacket

    -
    §bytes_recv: Counter

    Bytes received from a FrameType::SendPacket

    -
    §send_packets_sent: Counter

    FrameType::SendPacket sent

    -
    §send_packets_recv: Counter

    FrameType::SendPacket received

    -
    §send_packets_dropped: Counter

    FrameType::SendPacket dropped

    -
    §other_packets_sent: Counter

    Packets of other FrameTypes sent

    -
    §other_packets_recv: Counter

    Packets of other FrameTypes received

    -
    §other_packets_dropped: Counter

    Packets of other FrameTypes dropped

    -
    §got_ping: Counter

    Number of FrameType::Pings received

    -
    §sent_pong: Counter

    Number of FrameType::Pongs sent

    -
    §unknown_frames: Counter

    Number of FrameType::Unknown received

    +

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §bytes_sent: Counter

    Bytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.

    +
    §bytes_recv: Counter

    Bytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.

    +
    §send_packets_sent: Counter§send_packets_recv: Counter

    ClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.

    +
    §send_packets_dropped: Counter

    RelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being +delivered to a client, because the recipient is not connected or writing to its stream failed.

    +

    Note that frames dropped because the recipient’s send queue is full or closed are not counted +here.

    +
    §other_packets_sent: Counter

    Intended to count sent frames other than datagrams, but currently unused (never incremented).

    +
    §other_packets_recv: Counter

    Intended to count received frames other than datagrams, but currently unused (never incremented).

    +
    §other_packets_dropped: Counter

    Intended to count dropped frames other than datagrams, but currently unused (never incremented).

    +
    §got_ping: Counter

    Number of FrameType::Ping frames received from a client.

    +
    §sent_pong: Counter

    Number of FrameType::Pong frames sent to a client.

    +
    §unknown_frames: Counter

    Intended to count received frames with an unrecognized FrameType, +but currently unused (never incremented).

    §bytes_rx_ratelimited_total: Counter

    Number of bytes received from client connection which have been rate-limited.

    §conns_rx_ratelimited_total: Counter

    Number of client connections which have had any frames rate-limited.

    §accepts: Counter

    Number of times this server has accepted a connection.

    -
    §disconnects: Counter

    Number of connections we have removed because of an error

    +
    §disconnects: Counter

    Number of times a client connection was disconnected.

    +

    Incremented once per connection, paired with Self::accepts.

    §unique_client_keys: Counter

    Number of unique client keys per day

    §clients_inactive_added: Counter

    Number of times a client was moved into the inactive state.

    A client becomes inactive when a new client connects with the same endpoint id. An inactive diff --git a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html index 2291657920..f61d3786bb 100644 --- a/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html +++ b/pr/4036/docs/iroh/metrics/struct.SocketMetrics.html @@ -1,4 +1,4 @@ -SocketMetrics in iroh::metrics - Rust

    SocketMetrics

    Struct SocketMetrics 

    Source
    #[non_exhaustive]
    pub struct SocketMetrics {
    Show 31 fields +SocketMetrics in iroh::metrics - Rust

    SocketMetrics

    Struct SocketMetrics 

    Source
    #[non_exhaustive]
    pub struct SocketMetrics {
    Show 31 fields pub update_direct_addrs: Counter, pub send_ipv4: Counter, pub send_ipv6: Counter, @@ -30,10 +30,23 @@ pub actor_tick_direct_addr_heartbeat: Counter, pub actor_link_change: Counter, pub actor_tick_other: Counter, -
    }
    Expand description

    Enum of metrics for the module

    -

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §update_direct_addrs: Counter§send_ipv4: Counter§send_ipv6: Counter§send_relay: Counter§recv_data_relay: Counter§recv_data_custom: Counter§recv_data_ipv4: Counter§recv_data_ipv6: Counter§recv_datagrams: Counter

    Number of QUIC datagrams received.

    -
    §recv_gro_datagrams: Counter

    Number of datagrams received using GRO

    -
    §relay_home_change: Counter§holepunch_attempts: Counter

    The number of times holepunching is initiated on a connection.

    +
    }
    Expand description

    Metrics collected by the iroh socket.

    +

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §update_direct_addrs: Counter

    Intended to count updates to the local direct address set, but currently unused +(never incremented).

    +
    §send_ipv4: Counter

    Number of bytes sent over IPv4.

    +
    §send_ipv6: Counter

    Number of bytes sent over IPv6.

    +
    §send_relay: Counter

    Number of bytes sent over the relay transport.

    +
    §recv_data_relay: Counter

    Number of data bytes received over the relay transport.

    +
    §recv_data_custom: Counter

    Number of data bytes received over any custom transport.

    +
    §recv_data_ipv4: Counter

    Number of data bytes received over IPv4.

    +
    §recv_data_ipv6: Counter

    Number of data bytes received over IPv6.

    +
    §recv_datagrams: Counter

    Number of QUIC datagrams received.

    +
    §recv_gro_datagrams: Counter

    Number of receive events that used GRO (coalesced datagram batches).

    +

    This counts batches, not the individual datagrams within them. See +Self::recv_datagrams for the datagram count.

    +
    §relay_home_change: Counter

    Number of times the home relay changed to a different relay.

    +

    This includes the initial assignment from no home relay to a home relay.

    +
    §holepunch_attempts: Counter

    The number of times holepunching is initiated on a connection.

    This can be incremented multiple times for a single connection. Note that only the client-side of a connection will increment this counter.

    §paths_direct: Counter

    The number of network paths to peers that are direct.

    @@ -53,8 +66,15 @@ the number of opened connections.

    §transport_relay_paths_removed: Counter

    Number of relay transport paths closed.

    §transport_custom_paths_added: Counter

    Number of custom transport paths opened.

    §transport_custom_paths_removed: Counter

    Number of custom transport paths closed.

    -
    §actor_tick_main: Counter§actor_tick_msg: Counter§actor_tick_re_stun: Counter§actor_tick_portmap_changed: Counter§actor_tick_direct_addr_heartbeat: Counter§actor_link_change: Counter§actor_tick_other: Counter

    Trait Implementations§

    Source§

    impl Debug for Metrics

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for Metrics

    Source§

    fn default() -> Self

    Returns the “default value” for a type. Read more
    Source§

    impl<'de> Deserialize<'de> for Metrics

    Source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Iterable for Metrics

    Source§

    fn metric_field_count(&self) -> usize

    Returns the number of metric fields in the struct.
    Source§

    fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>

    Returns the metric field at the given index.
    §

    fn family_field_count(&self) -> usize

    Returns the number of Family fields in the struct.
    §

    fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>

    Returns the Family field at the given index.
    Source§

    impl MetricsGroup for Metrics

    Source§

    fn name(&self) -> &'static str

    Returns the name of this metrics group.
    §

    fn iter(&self) -> FieldIter<'_>

    Returns an iterator over all metric items with their values and helps.
    Source§

    impl Serialize for Metrics

    Source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where +
    §actor_tick_main: Counter

    Number of iterations of the main socket actor loop.

    +
    §actor_tick_msg: Counter

    Number of actor messages processed by the socket actor loop.

    +
    §actor_tick_re_stun: Counter

    Number of periodic re-STUN timer ticks handled by the socket actor loop.

    +
    §actor_tick_portmap_changed: Counter

    Number of port-mapping change events handled by the socket actor loop.

    +
    §actor_tick_direct_addr_heartbeat: Counter

    Intended to count direct address heartbeat ticks, but currently unused (never incremented).

    +
    §actor_link_change: Counter

    Number of local network interface (link) change events handled by the socket actor loop.

    +
    §actor_tick_other: Counter

    Number of times an input watcher or receiver closed in the socket actor loop.

    +

    Trait Implementations§

    Source§

    impl Debug for Metrics

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for Metrics

    Source§

    fn default() -> Self

    Returns the “default value” for a type. Read more
    Source§

    impl<'de> Deserialize<'de> for Metrics

    Source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Iterable for Metrics

    Source§

    fn metric_field_count(&self) -> usize

    Returns the number of metric fields in the struct.
    Source§

    fn metric_field_ref(&self, n: usize) -> Option<MetricItem<'_>>

    Returns the metric field at the given index.
    §

    fn family_field_count(&self) -> usize

    Returns the number of Family fields in the struct.
    §

    fn family_field_ref(&self, _n: usize) -> Option<FamilyItem<'_>>

    Returns the Family field at the given index.
    Source§

    impl MetricsGroup for Metrics

    Source§

    fn name(&self) -> &'static str

    Returns the name of this metrics group.
    §

    fn iter(&self) -> FieldIter<'_>

    Returns an iterator over all metric items with their values and helps.
    Source§

    impl Serialize for Metrics

    Source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where diff --git a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html index e11345eddc..4577fe8eaf 100644 --- a/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html +++ b/pr/4036/docs/iroh/protocol/enum.IncomingFilterOutcome.html @@ -11,7 +11,7 @@ the source address, actively refuse the connection, or silently drop it.

    What this does depends on the connection type:

    Source

    pub fn endpoint(&self) -> &Endpoint

    Returns the Endpoint of the endpoint.

    +
    Source

    pub fn endpoint(&self) -> &Endpoint

    Returns the Endpoint stored in this builder.

    Source

    pub fn spawn(self) -> Router

    Spawns an accept loop and returns a handle to it encapsulated as the Router.

    Trait Implementations§

    Source§

    impl Debug for RouterBuilder

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where diff --git a/pr/4036/docs/iroh/struct.EndpointAddr.html b/pr/4036/docs/iroh/struct.EndpointAddr.html index 0aa53df633..867818d655 100644 --- a/pr/4036/docs/iroh/struct.EndpointAddr.html +++ b/pr/4036/docs/iroh/struct.EndpointAddr.html @@ -5,7 +5,7 @@

    This combines an endpoint’s identifier with network-level addressing information of how to contact the endpoint.

    To establish a network connection to an endpoint both the EndpointId and one or more network -paths are needed. The network paths can come from various sources, current sources can come from

    +paths are needed. The network paths can come from various sources:

    §id: PublicKey

    The endpoint’s identifier.

    -
    §addrs: BTreeSet<TransportAddr>

    The endpoint’s addresses

    +
    §addrs: BTreeSet<TransportAddr>

    The endpoint’s addresses.

    Implementations§

    Source§

    impl EndpointAddr

    Source

    pub fn new(id: PublicKey) -> EndpointAddr

    Creates a new EndpointAddr with no network level addresses.

    This still is usable with e.g. an address lookup service to establish a connection, depending on the situation.

    @@ -38,9 +38,9 @@ depending on the situation.

    self, addrs: impl IntoIterator<Item = TransportAddr>, ) -> EndpointAddr

    Adds a list of addresses.

    -
    Source

    pub fn is_empty(&self) -> bool

    Returns true, if only a EndpointId is present.

    -
    Source

    pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

    Returns a list of IP addresses of this peer.

    -
    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns a list of relay urls of this peer.

    +
    Source

    pub fn is_empty(&self) -> bool

    Returns true if only an EndpointId is present.

    +
    Source

    pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

    Returns an iterator over the IP addresses of this endpoint address.

    +
    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns an iterator over the relay URLs of this endpoint address.

    In practice this is expected to be zero or one home relay for all known cases currently.

    Trait Implementations§

    Source§

    impl Clone for EndpointAddr

    Source§

    fn clone(&self) -> EndpointAddr

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointAddr

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    Source§

    impl<'de> Deserialize<'de> for EndpointAddr

    Source§

    fn deserialize<__D>( __deserializer: __D, diff --git a/pr/4036/docs/iroh/struct.NetReport.html b/pr/4036/docs/iroh/struct.NetReport.html index 693c855529..8b8ec1aed1 100644 --- a/pr/4036/docs/iroh/struct.NetReport.html +++ b/pr/4036/docs/iroh/struct.NetReport.html @@ -1,4 +1,4 @@ -NetReport in iroh - Rust

    NetReport

    Struct NetReport 

    Source
    pub struct NetReport {
    +NetReport in iroh - Rust

    NetReport

    Struct NetReport 

    Source
    pub struct NetReport {
         pub udp_v4: bool,
         pub udp_v6: bool,
         pub mapping_varies_by_dest_ipv4: Option<bool>,
    @@ -13,17 +13,16 @@
     
    §udp_v6: bool

    A QAD IPv6 round trip completed.

    §mapping_varies_by_dest_ipv4: Option<bool>

    Whether the reported public address differs when probing different servers (on IPv4).

    §mapping_varies_by_dest_ipv6: Option<bool>

    Whether the reported public address differs when probing different servers (on IPv6).

    -
    §preferred_relay: Option<RelayUrl>

    Probe indicating the presence of port mapping protocols on the LAN. -None for unknown

    -
    §relay_latency: RelayLatencies

    keyed by relay Url

    -
    §global_v4: Option<SocketAddrV4>

    ip:port of global IPv4

    -
    §global_v6: Option<SocketAddrV6>

    [ip]:port of global IPv6

    +
    §preferred_relay: Option<RelayUrl>

    The relay server with the lowest latency, if any.

    +
    §relay_latency: RelayLatencies

    The measured latency to each relay, keyed by relay URL.

    +
    §global_v4: Option<SocketAddrV4>

    The discovered global IPv4 address and port, if any.

    +
    §global_v6: Option<SocketAddrV6>

    The discovered global IPv6 address and port, if any.

    §captive_portal: Option<bool>

    CaptivePortal is set when we think there’s a captive portal that is intercepting HTTP traffic.

    -

    Implementations§

    Source§

    impl Report

    Source

    pub fn has_udp(&self) -> bool

    Do we have any indication that UDP is working?

    -
    Source

    pub fn mapping_varies_by_dest(&self) -> Option<bool>

    Whether the reported public address differs when probing different servers.

    +

    Implementations§

    Source§

    impl Report

    Source

    pub fn has_udp(&self) -> bool

    Do we have any indication that UDP is working?

    +
    Source

    pub fn mapping_varies_by_dest(&self) -> Option<bool>

    Whether the reported public address differs when probing different servers.

    Trait Implementations§

    Source§

    impl Clone for Report

    Source§

    fn clone(&self) -> Report

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for Report

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for Report

    Source§

    fn default() -> Report

    Returns the “default value” for a type. Read more
    Source§

    impl<'de> Deserialize<'de> for Report

    Source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Display for Report

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl PartialEq for Report

    Source§

    fn eq(&self, other: &Report) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Display for Report

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl PartialEq for Report

    Source§

    fn eq(&self, other: &Report) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    Source§

    impl Serialize for Report

    Source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
    where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    Source§

    impl Eq for Report

    Source§

    impl StructuralPartialEq for Report

    Auto Trait Implementations§

    §

    impl Freeze for Report

    §

    impl RefUnwindSafe for Report

    §

    impl Send for Report

    §

    impl Sync for Report

    §

    impl Unpin for Report

    §

    impl UnwindSafe for Report

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where diff --git a/pr/4036/docs/iroh/struct.PublicKey.html b/pr/4036/docs/iroh/struct.PublicKey.html index f8fb4c5ae2..b725772ddc 100644 --- a/pr/4036/docs/iroh/struct.PublicKey.html +++ b/pr/4036/docs/iroh/struct.PublicKey.html @@ -1,5 +1,5 @@ PublicKey in iroh - Rust

    PublicKey

    Struct PublicKey 

    Source
    pub struct PublicKey(/* private fields */);
    Expand description

    A public key.

    -

    The key itself is stored as the CompressedEdwards y coordinate of the public key +

    The key itself is stored as the CompressedEdwards y-coordinate of the public key. It is verified to decompress into a valid key when created.

    Implementations§

    Source§

    impl PublicKey

    Source

    pub const LENGTH: usize = 32usize

    The length of an ed25519 PublicKey, in bytes.

    Source

    pub fn as_bytes(&self) -> &[u8; 32]

    Get this public key as a byte array.

    @@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.

    &self, message: &[u8], signature: &Signature, -) -> Result<(), SignatureError>

    Verify a signature on a message with this secret key’s public key.

    +) -> Result<(), SignatureError>

    Verify a signature on a message with this public key.

    §Return

    Returns Ok(()) if the signature is valid, and Err otherwise.

    Source

    pub fn fmt_short(&self) -> impl Display + Copy + 'static

    Convert to a hex string limited to the first 5 bytes for a friendly string @@ -23,8 +23,8 @@ the encoding used by pkarr domain names.

    Trait Implementations§

    Source§

    impl AsRef<[u8]> for PublicKey

    Source§

    fn as_ref(&self) -> &[u8] ⓘ

    Converts this type into a shared reference of the (usually inferred) input type.
    Source§

    impl Borrow<[u8; 32]> for PublicKey

    Source§

    fn borrow(&self) -> &[u8; 32]

    Immutably borrows from an owned value. Read more
    Source§

    impl Clone for PublicKey

    Source§

    fn clone(&self) -> PublicKey

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    Source§

    impl Deref for PublicKey

    Source§

    type Target = [u8; 32]

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &<PublicKey as Deref>::Target

    Dereferences the value.
    Source§

    impl<'de> Deserialize<'de> for PublicKey

    Source§

    fn deserialize<D>( deserializer: D, ) -> Result<PublicKey, <D as Deserializer<'de>>::Error>
    where - D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Display for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    Source§

    impl From<PublicKey> for EndpointAddr

    Source§

    fn from(endpoint_id: PublicKey) -> EndpointAddr

    Converts to this type from the input type.
    Source§

    impl FromStr for PublicKey

    Deserialises the PublicKey from it’s base32 encoding.

    -

    Display is capable of serialising this format.

    + D: Deserializer<'de>,
    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Display for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    Source§

    impl From<PublicKey> for EndpointAddr

    Source§

    fn from(endpoint_id: PublicKey) -> EndpointAddr

    Converts to this type from the input type.
    Source§

    impl FromStr for PublicKey

    Parses a PublicKey from its hex or base32 encoding.

    +

    Display produces the hex encoding.

    Source§

    type Err = KeyParsingError

    The associated error which can be returned from parsing.
    Source§

    fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

    Parses a string s to return a value of this type. Read more
    Source§

    impl Hash for PublicKey

    Source§

    fn hash<H>(&self, state: &mut H)
    where H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · Source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, diff --git a/pr/4036/docs/iroh/tls/index.html b/pr/4036/docs/iroh/tls/index.html index 3c1d92cf2a..16f63b088e 100644 --- a/pr/4036/docs/iroh/tls/index.html +++ b/pr/4036/docs/iroh/tls/index.html @@ -1,5 +1,5 @@ iroh::tls - Rust

    Module tls

    Module tls 

    Source
    Expand description

    TLS configuration for iroh.

    -

    Currently there is one mechanisms available

    +

    Currently there is one mechanism available:

    • Raw Public Keys, using the TLS extension described in RFC 7250
    diff --git a/pr/4036/docs/iroh_base/enum.KeyParsingError.html b/pr/4036/docs/iroh_base/enum.KeyParsingError.html index d0668a511c..7c849cddf2 100644 --- a/pr/4036/docs/iroh_base/enum.KeyParsingError.html +++ b/pr/4036/docs/iroh_base/enum.KeyParsingError.html @@ -1,4 +1,4 @@ -KeyParsingError in iroh_base - Rust

    KeyParsingError

    Enum KeyParsingError 

    Source
    #[non_exhaustive]
    pub enum KeyParsingError { +KeyParsingError in iroh_base - Rust

    KeyParsingError

    Enum KeyParsingError 

    Source
    #[non_exhaustive]
    pub enum KeyParsingError { FailedToDecodeHex { meta: Meta, }, @@ -11,14 +11,14 @@ InvalidKeyData { meta: Meta, }, -}
    Available on crate feature key only.
    Expand description

    Error when deserialising a PublicKey or a SecretKey.

    +}
    Available on crate feature key only.
    Expand description

    Error returned when parsing a PublicKey or a SecretKey.

    Variants (Non-exhaustive)§

    This enum is marked as non-exhaustive
    Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
    §

    FailedToDecodeHex

    The input string could not be decoded as hex.

    Fields

    §meta: Meta

    Captured call-site metadata

    §

    FailedToDecodeBase32

    The input string could not be decoded as base32.

    Fields

    §meta: Meta

    Captured call-site metadata

    §

    InvalidLength

    The input has invalid length.

    Fields

    §meta: Meta

    Captured call-site metadata

    -
    §

    InvalidKeyData

    The decoded data is not a valid Ed25591 public key.

    +
    §

    InvalidKeyData

    The decoded data is not a valid Ed25519 public key.

    Fields

    §meta: Meta

    Captured call-site metadata

    Trait Implementations§

    Source§

    impl Debug for KeyParsingError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for KeyParsingError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Error for KeyParsingError

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<KeyParsingError> for AnyError

    Source§

    fn from(value: KeyParsingError) -> AnyError

    Converts to this type from the input type.
    Source§

    impl StackError for KeyParsingError

    Source§

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    Source§

    fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    Source§

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    Source§

    impl<T> Borrow<T> for T
    where diff --git a/pr/4036/docs/iroh_base/enum.TransportAddr.html b/pr/4036/docs/iroh_base/enum.TransportAddr.html index ec9989aea4..a55428eb22 100644 --- a/pr/4036/docs/iroh_base/enum.TransportAddr.html +++ b/pr/4036/docs/iroh_base/enum.TransportAddr.html @@ -3,8 +3,8 @@ Ip(SocketAddr), Custom(CustomAddr), }
    Available on crate feature key only.
    Expand description

    Available address types.

    -

    Variants (Non-exhaustive)§

    This enum is marked as non-exhaustive
    Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
    §

    Relay(RelayUrl)

    Relays

    -
    §

    Ip(SocketAddr)

    IP based addresses

    +

    Variants (Non-exhaustive)§

    This enum is marked as non-exhaustive
    Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
    §

    Relay(RelayUrl)

    A relay server address.

    +
    §

    Ip(SocketAddr)

    An IP based address.

    §

    Custom(CustomAddr)

    Custom transport address

    Implementations§

    Source§

    impl TransportAddr

    Source

    pub fn is_relay(&self) -> bool

    Whether this is a transport address via a relay server.

    Source

    pub fn is_ip(&self) -> bool

    Whether this is an IP transport address.

    diff --git a/pr/4036/docs/iroh_base/index.html b/pr/4036/docs/iroh_base/index.html index fbea68af94..91f1b70a95 100644 --- a/pr/4036/docs/iroh_base/index.html +++ b/pr/4036/docs/iroh_base/index.html @@ -1,2 +1,2 @@ iroh_base - Rust

    Crate iroh_base

    Crate iroh_base 

    Source
    Expand description

    Base types and utilities for Iroh

    -

    Structs§

    CustomAddrkey
    A custom transport address consisting of a transport id and opaque address data.
    EndpointAddrkey
    Network-level addressing information for an iroh endpoint.
    PublicKeykey
    A public key.
    RelayUrlrelay
    A URL identifying a relay server.
    RelayUrlParseErrorrelay
    Can occur when parsing a string into a RelayUrl.
    SecretKeykey
    A secret key.
    Signaturekey
    Ed25519 signature.
    SignatureErrorkey
    Verification of a signature failed.
    SignatureParsingErrorkey
    Error generated when failed to parse an ED25519 signature.

    Enums§

    KeyParsingErrorkey
    Error when deserialising a PublicKey or a SecretKey.
    TransportAddrkey
    Available address types.

    Type Aliases§

    EndpointIdkey
    The identifier for an endpoint in the (iroh) network.
    \ No newline at end of file +

    Structs§

    CustomAddrkey
    A custom transport address consisting of a transport id and opaque address data.
    EndpointAddrkey
    Network-level addressing information for an iroh endpoint.
    PublicKeykey
    A public key.
    RelayUrlrelay
    A URL identifying a relay server.
    RelayUrlParseErrorrelay
    Can occur when parsing a string into a RelayUrl.
    SecretKeykey
    A secret key.
    Signaturekey
    Ed25519 signature.
    SignatureErrorkey
    Verification of a signature failed.
    SignatureParsingErrorkey
    Error generated when failed to parse an ED25519 signature.

    Enums§

    KeyParsingErrorkey
    Error returned when parsing a PublicKey or a SecretKey.
    TransportAddrkey
    Available address types.

    Type Aliases§

    EndpointIdkey
    The identifier for an endpoint in the (iroh) network.
    \ No newline at end of file diff --git a/pr/4036/docs/iroh_base/struct.EndpointAddr.html b/pr/4036/docs/iroh_base/struct.EndpointAddr.html index 4b06f57119..622cd86fc3 100644 --- a/pr/4036/docs/iroh_base/struct.EndpointAddr.html +++ b/pr/4036/docs/iroh_base/struct.EndpointAddr.html @@ -5,7 +5,7 @@

    This combines an endpoint’s identifier with network-level addressing information of how to contact the endpoint.

    To establish a network connection to an endpoint both the EndpointId and one or more network -paths are needed. The network paths can come from various sources, current sources can come from

    +paths are needed. The network paths can come from various sources:

    §id: EndpointId

    The endpoint’s identifier.

    -
    §addrs: BTreeSet<TransportAddr>

    The endpoint’s addresses

    +
    §addrs: BTreeSet<TransportAddr>

    The endpoint’s addresses.

    Implementations§

    Source§

    impl EndpointAddr

    Source

    pub fn new(id: PublicKey) -> Self

    Creates a new EndpointAddr with no network level addresses.

    This still is usable with e.g. an address lookup service to establish a connection, depending on the situation.

    @@ -35,9 +35,9 @@ depending on the situation.

    Source

    pub fn with_relay_url(self, relay_url: RelayUrl) -> Self

    Adds a RelayUrl address.

    Source

    pub fn with_ip_addr(self, addr: SocketAddr) -> Self

    Adds an IP based address.

    Source

    pub fn with_addrs(self, addrs: impl IntoIterator<Item = TransportAddr>) -> Self

    Adds a list of addresses.

    -
    Source

    pub fn is_empty(&self) -> bool

    Returns true, if only a EndpointId is present.

    -
    Source

    pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

    Returns a list of IP addresses of this peer.

    -
    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns a list of relay urls of this peer.

    +
    Source

    pub fn is_empty(&self) -> bool

    Returns true if only an EndpointId is present.

    +
    Source

    pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

    Returns an iterator over the IP addresses of this endpoint address.

    +
    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns an iterator over the relay URLs of this endpoint address.

    In practice this is expected to be zero or one home relay for all known cases currently.

    Trait Implementations§

    Source§

    impl Clone for EndpointAddr

    Source§

    fn clone(&self) -> EndpointAddr

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointAddr

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl<'de> Deserialize<'de> for EndpointAddr

    Source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
    where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl From<PublicKey> for EndpointAddr

    Source§

    fn from(endpoint_id: EndpointId) -> Self

    Converts to this type from the input type.
    Source§

    impl Hash for EndpointAddr

    Source§

    fn hash<__H: Hasher>(&self, state: &mut __H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · Source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where diff --git a/pr/4036/docs/iroh_base/struct.PublicKey.html b/pr/4036/docs/iroh_base/struct.PublicKey.html index 19b67a7f7f..c5a227c658 100644 --- a/pr/4036/docs/iroh_base/struct.PublicKey.html +++ b/pr/4036/docs/iroh_base/struct.PublicKey.html @@ -1,5 +1,5 @@ PublicKey in iroh_base - Rust

    PublicKey

    Struct PublicKey 

    Source
    pub struct PublicKey(/* private fields */);
    Available on crate feature key only.
    Expand description

    A public key.

    -

    The key itself is stored as the CompressedEdwards y coordinate of the public key +

    The key itself is stored as the CompressedEdwards y-coordinate of the public key. It is verified to decompress into a valid key when created.

    Implementations§

    Source§

    impl PublicKey

    Source

    pub const LENGTH: usize = 32usize

    The length of an ed25519 PublicKey, in bytes.

    Source

    pub fn as_bytes(&self) -> &[u8; 32]

    Get this public key as a byte array.

    @@ -12,7 +12,7 @@ See [VerifyingKey::from_bytes] for details.

    &self, message: &[u8], signature: &Signature, -) -> Result<(), SignatureError>

    Verify a signature on a message with this secret key’s public key.

    +) -> Result<(), SignatureError>

    Verify a signature on a message with this public key.

    §Return

    Returns Ok(()) if the signature is valid, and Err otherwise.

    Source

    pub fn fmt_short(&self) -> impl Display + Copy + 'static

    Convert to a hex string limited to the first 5 bytes for a friendly string @@ -21,8 +21,8 @@ representation of the key.

    the encoding used by pkarr domain names.

    Source

    pub fn from_z32(s: &str) -> Result<Self, KeyParsingError>

    Parses a key from its z-base-32 encoding.

    Trait Implementations§

    Source§

    impl AsRef<[u8]> for PublicKey

    Source§

    fn as_ref(&self) -> &[u8] ⓘ

    Converts this type into a shared reference of the (usually inferred) input type.
    Source§

    impl Borrow<[u8; 32]> for PublicKey

    Source§

    fn borrow(&self) -> &[u8; 32]

    Immutably borrows from an owned value. Read more
    Source§

    impl Clone for PublicKey

    Source§

    fn clone(&self) -> PublicKey

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Deref for PublicKey

    Source§

    type Target = [u8; 32]

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    Source§

    impl<'de> Deserialize<'de> for PublicKey

    Source§

    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where - D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Display for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl From<PublicKey> for EndpointAddr

    Source§

    fn from(endpoint_id: EndpointId) -> Self

    Converts to this type from the input type.
    Source§

    impl FromStr for PublicKey

    Deserialises the PublicKey from it’s base32 encoding.

    -

    Display is capable of serialising this format.

    + D: Deserializer<'de>,
    Deserialize this value from the given Serde deserializer. Read more
    Source§

    impl Display for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl From<PublicKey> for EndpointAddr

    Source§

    fn from(endpoint_id: EndpointId) -> Self

    Converts to this type from the input type.
    Source§

    impl FromStr for PublicKey

    Parses a PublicKey from its hex or base32 encoding.

    +

    Display produces the hex encoding.

    Source§

    type Err = KeyParsingError

    The associated error which can be returned from parsing.
    Source§

    fn from_str(s: &str) -> Result<Self, Self::Err>

    Parses a string s to return a value of this type. Read more
    Source§

    impl Hash for PublicKey

    Source§

    fn hash<H: Hasher>(&self, state: &mut H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · Source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where H: Hasher, Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    Source§

    impl Ord for PublicKey

    Source§

    fn cmp(&self, other: &Self) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · Source§

    fn max(self, other: Self) -> Self
    where diff --git a/pr/4036/docs/iroh_dns/dns/struct.DnsResolver.html b/pr/4036/docs/iroh_dns/dns/struct.DnsResolver.html index 1c0f3cab3a..01a6baff99 100644 --- a/pr/4036/docs/iroh_dns/dns/struct.DnsResolver.html +++ b/pr/4036/docs/iroh_dns/dns/struct.DnsResolver.html @@ -15,7 +15,7 @@ public DNS.

    Implementations§

    Source§

    impl DnsResolver

    Source

    pub fn new() -> Self

    Creates a new DNS resolver with sensible cross-platform defaults.

    We first try to read the system’s resolver from /etc/resolv.conf. This does not work at least on some Androids, therefore we fallback -to the default ResolverConfig which uses eg. to google’s 8.8.8.8 or 8.8.4.4.

    +to the default ResolverConfig which uses e.g. Google’s 8.8.8.8 or 8.8.4.4.

    Source

    pub fn with_nameserver(nameserver: SocketAddr) -> Self

    Creates a new DNS resolver configured with a single UDP DNS nameserver.

    Source

    pub fn builder() -> Builder

    Creates a builder to construct a DNS resolver with custom options.

    Source

    pub fn custom(resolver: impl Resolver) -> Self

    Creates a new DnsResolver from a struct that implements Resolver.

    diff --git a/pr/4036/docs/iroh_dns/dns/trait.Resolver.html b/pr/4036/docs/iroh_dns/dns/trait.Resolver.html index af7adee5cd..f4ba49f933 100644 --- a/pr/4036/docs/iroh_dns/dns/trait.Resolver.html +++ b/pr/4036/docs/iroh_dns/dns/trait.Resolver.html @@ -38,13 +38,13 @@ atomic swap. Build a new instance with re-bound sockets and re-read nameserver configuration rather than mutating in place. Must not perform IO: defer DNS queries and socket binds until the new resolver is first used. May be called concurrently, in which case all but one allocated replacement is dropped unused.

    -

    Implementations on Foreign Types§

    Source§

    impl Resolver for Arc<SimpleDnsResolver>

    Implementations on Foreign Types§

    Source§

    impl Resolver for Arc<SimpleDnsResolver>

    Source§

    fn lookup_ipv4( &self, host: String, -) -> BoxFuture<Result<BoxIter<Ipv4Addr>, DnsError>>

    Source§

    fn lookup_ipv6( +) -> BoxFuture<Result<BoxIter<Ipv4Addr>, DnsError>>

    Source§

    fn lookup_ipv6( &self, host: String, -) -> BoxFuture<Result<BoxIter<Ipv6Addr>, DnsError>>

    Source§

    fn lookup_txt( +) -> BoxFuture<Result<BoxIter<Ipv6Addr>, DnsError>>

    Source§

    fn lookup_txt( &self, host: String, -) -> BoxFuture<Result<BoxIter<TxtRecordData>, DnsError>>

    Source§

    fn clear_cache(&self)

    Source§

    fn reset(&self) -> Box<dyn Resolver>

    Implementors§

    \ No newline at end of file +) -> BoxFuture<Result<BoxIter<TxtRecordData>, DnsError>>
    Source§

    fn clear_cache(&self)

    Source§

    fn reset(&self) -> Box<dyn Resolver>

    Implementors§

    \ No newline at end of file diff --git a/pr/4036/docs/iroh_dns/endpoint_info/index.html b/pr/4036/docs/iroh_dns/endpoint_info/index.html index 1014c90ea1..593da17b3b 100644 --- a/pr/4036/docs/iroh_dns/endpoint_info/index.html +++ b/pr/4036/docs/iroh_dns/endpoint_info/index.html @@ -1,11 +1,11 @@ iroh_dns::endpoint_info - Rust

    Module endpoint_info

    Module endpoint_info 

    Source
    Expand description

    Support for handling DNS resource records for dialing by EndpointId.

    Dialing by EndpointId is supported by iroh endpoints publishing Pkarr records to DNS servers or the Mainline DHT. This module supports creating and parsing these records.

    -

    EndpointInfo combines an iroh_base::EndpointId with EndpointData — +

    EndpointInfo combines an iroh_base::EndpointId with EndpointData: the addressing and metadata that discovery services publish and resolve. Discovery services use AddrFilter to control which addresses are published.

    This module also provides serialization to and from pkarr signed packets and -DNS TXT records. See the [crate::attrs] module for the on-the-wire format.

    +DNS TXT records.

    DNS records are published under the following names:

    _iroh.<z32-endpoint-id>.<origin-domain> TXT

      @@ -36,4 +36,4 @@ Each address is an IPv4 or IPv6 address with a port.

    Structs§

    AddrFilter
    A filter and/or reordering function applied to transport addresses, -typically used by AddressLookup services in iroh before publishing.
    EndpointData
    Data about an endpoint that may be published to and resolved from discovery services.
    EndpointInfo
    Information about an endpoint that may be published to and resolved from discovery services.
    MaxLengthExceededError
    Error returned when an input value is too long for UserData.
    UserData
    Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.
    \ No newline at end of file +typically used by AddressLookup services in iroh before publishing.
    EndpointData
    Data about an endpoint that may be published to and resolved from discovery services.
    EndpointInfo
    Information about an endpoint that may be published to and resolved from discovery services.
    MaxLengthExceededError
    Error returned when an input value is too long for UserData.
    UserData
    User-defined data that can be published and resolved through endpoint discovery.
    \ No newline at end of file diff --git a/pr/4036/docs/iroh_dns/endpoint_info/struct.EndpointData.html b/pr/4036/docs/iroh_dns/endpoint_info/struct.EndpointData.html index 2b3ae792b6..e443ea6257 100644 --- a/pr/4036/docs/iroh_dns/endpoint_info/struct.EndpointData.html +++ b/pr/4036/docs/iroh_dns/endpoint_info/struct.EndpointData.html @@ -13,15 +13,15 @@ services, should they not fit into e.g. a single DNS packet otherwise.

    See also Self::set_user_data.

    Source

    pub fn add_relay_url(&mut self, relay_url: RelayUrl)

    Adds the relay URL to the end of the endpoint data, unless it already existed.

    Source

    pub fn add_ip_addrs(&mut self, addresses: Vec<SocketAddr>)

    Adds addresses in order with duplicates or already existing addresses filtered out.

    -
    Source

    pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

    Adds addresses to the endpoint data in the given ordered, but with duplicates filtered.

    -
    Source

    pub fn set_user_data(&mut self, user_data: Option<UserData>)

    Sets the user-defined data and returns the updated endpoint data.

    +
    Source

    pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)

    Adds addresses to the endpoint data in the given order, but with duplicates filtered.

    +
    Source

    pub fn set_user_data(&mut self, user_data: Option<UserData>)

    Sets the user-defined data.

    Source

    pub fn clear_ip_addrs(&mut self)

    Removes all direct addresses from the endpoint data.

    -
    Source

    pub fn clear_relay_urls(&mut self)

    Removes all direct addresses from the endpoint data.

    +
    Source

    pub fn clear_relay_urls(&mut self)

    Removes all relay URLs from the endpoint data.

    Source

    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>

    Returns the relay URL of the endpoint.

    Source

    pub fn user_data(&self) -> Option<&UserData>

    Returns the optional user-defined data of the endpoint.

    Source

    pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>

    Returns the direct addresses of the endpoint.

    -
    Source

    pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

    Returns the full list of all known addresses

    -
    Source

    pub fn has_addrs(&self) -> bool

    Does this have any addresses?

    +
    Source

    pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>

    Returns the full list of all known addresses.

    +
    Source

    pub fn has_addrs(&self) -> bool

    Returns whether this has any addresses.

    Source

    pub fn filtered_addrs(&self, filter: &AddrFilter) -> Cow<'_, Vec<TransportAddr>>

    Apply the given filter to the current addresses.

    Returns a vec to allow re-ordering of addresses.

    Source

    pub fn apply_filter(&self, filter: &AddrFilter) -> Cow<'_, Self>

    Returns the EndpointData with given filter applied.

    diff --git a/pr/4036/docs/iroh_dns/endpoint_info/struct.UserData.html b/pr/4036/docs/iroh_dns/endpoint_info/struct.UserData.html index 01a04c7dd6..29fa32150b 100644 --- a/pr/4036/docs/iroh_dns/endpoint_info/struct.UserData.html +++ b/pr/4036/docs/iroh_dns/endpoint_info/struct.UserData.html @@ -1,4 +1,5 @@ -UserData in iroh_dns::endpoint_info - Rust

    UserData

    Struct UserData 

    Source
    pub struct UserData(/* private fields */);
    Expand description

    Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

    +UserData in iroh_dns::endpoint_info - Rust

    UserData

    Struct UserData 

    Source
    pub struct UserData(/* private fields */);
    Expand description

    User-defined data that can be published and resolved through endpoint discovery.

    +

    Under the hood this is a UTF-8 string no longer than UserData::MAX_LENGTH bytes.

    Iroh does not keep track of or examine the user-defined data.

    UserData implements FromStr and TryFrom<String>, so you can convert &str and String into UserData easily.

    diff --git a/pr/4036/docs/iroh_dns_server/struct.Metrics.html b/pr/4036/docs/iroh_dns_server/struct.Metrics.html index 2c64a238a3..2e4ce7e604 100644 --- a/pr/4036/docs/iroh_dns_server/struct.Metrics.html +++ b/pr/4036/docs/iroh_dns_server/struct.Metrics.html @@ -1,4 +1,4 @@ -Metrics in iroh_dns_server - Rust

    Metrics

    Struct Metrics 

    Source
    #[non_exhaustive]
    pub struct Metrics {
    Show 18 fields +Metrics in iroh_dns_server - Rust

    Metrics

    Struct Metrics 

    Source
    #[non_exhaustive]
    pub struct Metrics {
    Show 18 fields pub pkarr_publish_update: Counter, pub pkarr_publish_noop: Counter, pub dns_requests: Counter, @@ -21,7 +21,7 @@

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §pkarr_publish_update: Counter

    Number of pkarr relay puts that updated the stored packet.

    §pkarr_publish_noop: Counter

    Number of pkarr relay puts that did not change the stored packet.

    §dns_requests: Counter

    Total number of DNS requests across all transports.

    -
    §dns_requests_udp: Counter

    Number of DNS requests received over UDP or TCP.

    +
    §dns_requests_udp: Counter

    Number of DNS requests received over UDP.

    §dns_requests_https: Counter

    Number of DNS requests received over HTTPS (DoH).

    §dns_lookup_success: Counter

    Number of DNS lookups that returned at least one answer.

    §dns_lookup_notfound: Counter

    Number of DNS lookups that returned no answers.

    @@ -32,6 +32,7 @@
    §http_requests_duration_ms: Counter

    Cumulative duration of all HTTP requests, in milliseconds.

    §store_packets_inserted: Counter

    Number of signed packets newly inserted into the store.

    §store_packets_removed: Counter

    Number of signed packets removed from the store.

    +

    Currently always at 0 because the removal API is not used.

    §store_packets_updated: Counter

    Number of times an existing signed packet was replaced by a newer one.

    §store_packets_expired: Counter

    Number of signed packets removed by the eviction task.

    §cache_zones: Gauge

    Current number of zones in the main cache

    diff --git a/pr/4036/docs/iroh_relay/http/enum.ProtocolVersion.html b/pr/4036/docs/iroh_relay/http/enum.ProtocolVersion.html index 653240303a..89b2947932 100644 --- a/pr/4036/docs/iroh_relay/http/enum.ProtocolVersion.html +++ b/pr/4036/docs/iroh_relay/http/enum.ProtocolVersion.html @@ -15,7 +15,7 @@ can be used during negotiation to pick the best version.

    Implementations§

    Source§

    impl ProtocolVersion

    Source

    pub const ALL: &'static [Self]

    All supported protocol versions, in order of preference (newest first).

    Source

    pub fn all() -> impl Iterator<Item = &'static str>

    Returns an iterator of all supported protocol version identifiers, in order of preference.

    Source

    pub fn all_joined() -> String

    Returns a comma-separated string of all supported protocol version identifiers.

    -
    Source

    pub fn all_as_header_value() -> HeaderValue

    Returns all supported protocol versions in a comma-seperated string as an HTTP header value.

    +
    Source

    pub fn all_as_header_value() -> HeaderValue

    Returns all supported protocol versions in a comma-separated string as an HTTP header value.

    Source

    pub fn to_str(&self) -> &'static str

    Returns the protocol version identifier string.

    Source

    pub fn match_from_str(s: &str) -> Option<Self>

    Tries to parse a ProtocolVersion from s.

    Returns None if s is not a valid protocol version string.

    diff --git a/pr/4036/docs/iroh_relay/index.html b/pr/4036/docs/iroh_relay/index.html index 3f9c444230..84e146c5b2 100644 --- a/pr/4036/docs/iroh_relay/index.html +++ b/pr/4036/docs/iroh_relay/index.html @@ -1,4 +1,4 @@ -iroh_relay - Rust

    Crate iroh_relay

    Crate iroh_relay 

    Source
    Expand description

    Iroh’s relay is a feature within iroh, a peer-to-peer +iroh_relay - Rust

    Crate iroh_relay

    Crate iroh_relay 

    Source
    Expand description

    Iroh’s relay is a feature within iroh, a peer-to-peer networking system designed to facilitate direct, encrypted connections between devices. Iroh aims to simplify decentralized communication by automatically handling connections through “relays” when direct connections aren’t immediately possible. The relay server helps establish @@ -27,6 +27,4 @@ QAD support and expose metrics.

    Re-exports§

    pub use crate::protos::relay::MAX_PACKET_SIZE;

    Modules§

    client
    Exposes Client, which allows to establish connections to a relay server.
    defaults
    Default values used in the relay.
    http
    HTTP-specific constants for the relay server and client.
    protos
    Protocols used by the iroh-relay
    quic
    Create a QUIC server that accepts connections for QUIC address discovery.
    serverserver
    A fully-fledged iroh-relay server over HTTP or HTTPS.
    tls
    TLS verification configuration for iroh and iroh-relay.

    Structs§

    KeyCache
    A cache for public keys.
    PingTracker
    Tracks pings on a single relay connection.
    RelayConfig
    Information on a specific relay server.
    RelayMap
    List of relay server configurations to be used in an iroh endpoint.
    RelayQuicConfig
    Configuration for speaking to the QUIC endpoint on the relay -server to do QUIC address discovery.

    Traits§

    ExportKeyingMaterial
    This trait allows anything that ends up potentially -wrapping a TLS stream use the underlying export_keying_material -function.
    \ No newline at end of file +server to do QUIC address discovery.

    Traits§

    ExportKeyingMaterial
    Trait for extracting keying material from a TLS connection.
    \ No newline at end of file diff --git a/pr/4036/docs/iroh_relay/protos/common/enum.FrameType.html b/pr/4036/docs/iroh_relay/protos/common/enum.FrameType.html index aab4635d95..7a2c9f935f 100644 --- a/pr/4036/docs/iroh_relay/protos/common/enum.FrameType.html +++ b/pr/4036/docs/iroh_relay/protos/common/enum.FrameType.html @@ -1,4 +1,4 @@ -FrameType in iroh_relay::protos::common - Rust

    FrameType

    Enum FrameType 

    Source
    #[non_exhaustive]
    #[repr(u32)]
    pub enum FrameType { +FrameType in iroh_relay::protos::common - Rust

    FrameType

    Enum FrameType 

    Source
    #[non_exhaustive]
    #[repr(u32)]
    pub enum FrameType {
    Show 14 variants ServerChallenge = 0, ClientAuth = 1, ServerConfirmsAuth = 2, @@ -26,8 +26,7 @@

    That is, if A sent to B, and then if A disconnects, the server sends FrameType::PeerGone to B so B can forget that a reverse path exists on that connection to get back to A

    32B pub key of peer that’s gone

    -
    §

    Ping = 9

    Messages with these frames will be ignored. -8 byte ping payload, to be echoed back in FrameType::Pong

    +
    §

    Ping = 9

    8 byte ping payload, to be echoed back in a FrameType::Pong.

    §

    Pong = 10

    8 byte payload, the contents of ping being replied to

    §

    Health = 11

    REMOVED since relay-protocol-v2, use Self::Status instead.

    Sent from server to client to tell the client if their connection is unhealthy somehow. @@ -39,7 +38,7 @@ and how long to try total.

    Added in iroh-relay-v2 protocol. May not be sent to iroh-relay-v1 clients.

    Uses a binary-encoded Status payload.

    Implementations§

    Source§

    impl FrameType

    Source

    pub const fn from_repr(discriminant: u32) -> Option<FrameType>

    Try to create Self from the raw representation

    -

    Trait Implementations§

    Source§

    impl Clone for FrameType

    Source§

    fn clone(&self) -> FrameType

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for FrameType

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl From<FrameType> for VarInt

    Source§

    fn from(value: FrameType) -> Self

    Converts to this type from the input type.
    Source§

    impl From<FrameType> for u32

    Source§

    fn from(enum_value: FrameType) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for FrameType

    Source§

    fn eq(&self, other: &FrameType) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, +

    Trait Implementations§

    Source§

    impl Clone for FrameType

    Source§

    fn clone(&self) -> FrameType

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for FrameType

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl From<FrameType> for VarInt

    Source§

    fn from(value: FrameType) -> Self

    Converts to this type from the input type.
    Source§

    impl From<FrameType> for u32

    Source§

    fn from(enum_value: FrameType) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for FrameType

    Source§

    fn eq(&self, other: &FrameType) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    Source§

    impl Copy for FrameType

    Source§

    impl Eq for FrameType

    Source§

    impl StructuralPartialEq for FrameType

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where diff --git a/pr/4036/docs/iroh_relay/protos/common/enum.FrameTypeError.html b/pr/4036/docs/iroh_relay/protos/common/enum.FrameTypeError.html index b241703d3e..4373808adc 100644 --- a/pr/4036/docs/iroh_relay/protos/common/enum.FrameTypeError.html +++ b/pr/4036/docs/iroh_relay/protos/common/enum.FrameTypeError.html @@ -1,4 +1,4 @@ -FrameTypeError in iroh_relay::protos::common - Rust

    FrameTypeError

    Enum FrameTypeError 

    Source
    #[non_exhaustive]
    pub enum FrameTypeError { +FrameTypeError in iroh_relay::protos::common - Rust

    FrameTypeError

    Enum FrameTypeError 

    Source
    #[non_exhaustive]
    pub enum FrameTypeError { UnexpectedEnd { source: UnexpectedEnd, meta: Meta, @@ -9,7 +9,7 @@ }, }

    Variants (Non-exhaustive)§

    This enum is marked as non-exhaustive
    Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
    §

    UnexpectedEnd

    Fields

    §source: UnexpectedEnd
    §meta: Meta

    Captured call-site metadata

    §

    UnknownFrameType

    Fields

    §tag: VarInt
    §meta: Meta

    Captured call-site metadata

    -

    Trait Implementations§

    Source§

    impl Debug for FrameTypeError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for FrameTypeError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Error for FrameTypeError

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<FrameTypeError> for AnyError

    Source§

    fn from(value: FrameTypeError) -> AnyError

    Converts to this type from the input type.
    Source§

    impl From<FrameTypeError> for Error

    Source§

    fn from(source: FrameTypeError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<FrameTypeError> for Error

    Source§

    fn from(source: FrameTypeError) -> Self

    Converts to this type from the input type.
    Source§

    impl StackError for FrameTypeError

    Source§

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    Source§

    fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    Source§

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Debug for FrameTypeError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for FrameTypeError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Error for FrameTypeError

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<FrameTypeError> for AnyError

    Source§

    fn from(value: FrameTypeError) -> AnyError

    Converts to this type from the input type.
    Source§

    impl From<FrameTypeError> for Error

    Source§

    fn from(source: FrameTypeError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<FrameTypeError> for Error

    Source§

    fn from(source: FrameTypeError) -> Self

    Converts to this type from the input type.
    Source§

    impl StackError for FrameTypeError

    Source§

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    Source§

    fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    Source§

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/protos/common/index.html b/pr/4036/docs/iroh_relay/protos/common/index.html index 4bb2cedb34..1a8f12cb47 100644 --- a/pr/4036/docs/iroh_relay/protos/common/index.html +++ b/pr/4036/docs/iroh_relay/protos/common/index.html @@ -1,4 +1,4 @@ -iroh_relay::protos::common - Rust

    Module common

    Module common 

    Source
    Expand description

    Common types between the super::handshake and super::relay protocols.

    +iroh_relay::protos::common - Rust

    Module common

    Module common 

    Source
    Expand description

    Common types between the super::handshake and super::relay protocols.

    Hosts the FrameType enum to make sure we’re not accidentally reusing frame type integers for different frames.

    Enums§

    FrameType
    Possible frame types during handshaking
    FrameTypeError
    \ No newline at end of file diff --git a/pr/4036/docs/iroh_relay/protos/handshake/enum.Mechanism.html b/pr/4036/docs/iroh_relay/protos/handshake/enum.Mechanism.html index 8a2f2c9daa..c5bc3bbc95 100644 --- a/pr/4036/docs/iroh_relay/protos/handshake/enum.Mechanism.html +++ b/pr/4036/docs/iroh_relay/protos/handshake/enum.Mechanism.html @@ -1,11 +1,11 @@ -Mechanism in iroh_relay::protos::handshake - Rust

    Mechanism

    Enum Mechanism 

    Source
    #[non_exhaustive]
    pub enum Mechanism { +Mechanism in iroh_relay::protos::handshake - Rust

    Mechanism

    Enum Mechanism 

    Source
    #[non_exhaustive]
    pub enum Mechanism { SignedChallenge, SignedKeyMaterial, }
    Available on crate feature server only.
    Expand description

    The mechanism that was used for authentication.

    Variants (Non-exhaustive)§

    This enum is marked as non-exhaustive
    Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
    §

    SignedChallenge

    Authentication was performed by verifying a signature of a challenge we sent

    §

    SignedKeyMaterial

    Authentication was performed by verifying a signature of shared extracted TLS keying material

    -

    Trait Implementations§

    Source§

    impl Clone for Mechanism

    Source§

    fn clone(&self) -> Mechanism

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for Mechanism

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl PartialEq for Mechanism

    Source§

    fn eq(&self, other: &Mechanism) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, -and should not be overridden without very good reason.
    Source§

    impl Copy for Mechanism

    Source§

    impl Eq for Mechanism

    Source§

    impl StructuralPartialEq for Mechanism

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Clone for Mechanism

    Source§

    fn clone(&self) -> Mechanism

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for Mechanism

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl PartialEq for Mechanism

    Source§

    fn eq(&self, other: &Mechanism) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient, +and should not be overridden without very good reason.
    Source§

    impl Copy for Mechanism

    Source§

    impl Eq for Mechanism

    Source§

    impl StructuralPartialEq for Mechanism

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/protos/handshake/fn.serverside.html b/pr/4036/docs/iroh_relay/protos/handshake/fn.serverside.html index a3decde131..be02ff9d51 100644 --- a/pr/4036/docs/iroh_relay/protos/handshake/fn.serverside.html +++ b/pr/4036/docs/iroh_relay/protos/handshake/fn.serverside.html @@ -1,4 +1,4 @@ -serverside in iroh_relay::protos::handshake - Rust

    serverside

    Function serverside 

    Source
    pub async fn serverside(
    +serverside in iroh_relay::protos::handshake - Rust

    serverside

    Function serverside 

    Source
    pub async fn serverside(
         io: &mut (impl BytesStreamSink + ExportKeyingMaterial),
         client_auth_header: Option<HeaderValue>,
     ) -> Result<SuccessfulAuthentication, Error>
    Available on crate feature server only.
    Expand description

    Runs the server side of the handshaking protocol.

    diff --git a/pr/4036/docs/iroh_relay/protos/handshake/index.html b/pr/4036/docs/iroh_relay/protos/handshake/index.html index 24b512fd76..d6179759fb 100644 --- a/pr/4036/docs/iroh_relay/protos/handshake/index.html +++ b/pr/4036/docs/iroh_relay/protos/handshake/index.html @@ -1,4 +1,4 @@ -iroh_relay::protos::handshake - Rust

    Module handshake

    Module handshake 

    Source
    Expand description

    Implements the handshake protocol that authenticates and authorizes clients connecting to the relays.

    +iroh_relay::protos::handshake - Rust

    Module handshake

    Module handshake 

    Source
    Expand description

    Implements the handshake protocol that authenticates and authorizes clients connecting to the relays.

    The purpose of the handshake is to

    1. Inform the relay of the client’s EndpointId
    2. @@ -19,5 +19,4 @@ contains a signature of some shared keying material extracted from TLS ( -

    Structs§

    SuccessfulAuthenticationserver
    This represents successful authentication for the client with the client_key public key -via the authentication Mechanism mechanism.

    Enums§

    Error
    Mechanismserver
    The mechanism that was used for authentication.

    Functions§

    serversideserver
    Runs the server side of the handshaking protocol.
    \ No newline at end of file +

    Structs§

    SuccessfulAuthenticationserver
    Result of a successful authentication handshake.

    Enums§

    Error
    Mechanismserver
    The mechanism that was used for authentication.

    Functions§

    serversideserver
    Runs the server side of the handshaking protocol.
    \ No newline at end of file diff --git a/pr/4036/docs/iroh_relay/protos/handshake/struct.SuccessfulAuthentication.html b/pr/4036/docs/iroh_relay/protos/handshake/struct.SuccessfulAuthentication.html index 95919b564e..0ee9a70184 100644 --- a/pr/4036/docs/iroh_relay/protos/handshake/struct.SuccessfulAuthentication.html +++ b/pr/4036/docs/iroh_relay/protos/handshake/struct.SuccessfulAuthentication.html @@ -1,16 +1,13 @@ -SuccessfulAuthentication in iroh_relay::protos::handshake - Rust

    SuccessfulAuthentication

    Struct SuccessfulAuthentication 

    Source
    pub struct SuccessfulAuthentication {
    +SuccessfulAuthentication in iroh_relay::protos::handshake - Rust

    SuccessfulAuthentication

    Struct SuccessfulAuthentication 

    Source
    pub struct SuccessfulAuthentication {
         pub client_key: PublicKey,
         pub mechanism: Mechanism,
    -}
    Available on crate feature server only.
    Expand description

    This represents successful authentication for the client with the client_key public key -via the authentication Mechanism mechanism.

    -

    You must call SuccessfulAuthentication::authorize_if to finish the protocol. -Result of a successful authentication handshake.

    +}
    Available on crate feature server only.
    Expand description

    Result of a successful authentication handshake.

    This struct represents a client that has successfully authenticated itself to the relay server. The authorization must still be confirmed by calling Self::authorize_if to complete the protocol and notify the client of success or failure.

    Fields§

    §client_key: PublicKey

    The authenticated client’s public key.

    §mechanism: Mechanism

    The authentication mechanism that was used.

    -

    Implementations§

    Source§

    impl SuccessfulAuthentication

    Source

    pub async fn authorize_with( +

    Implementations§

    Source§

    impl SuccessfulAuthentication

    Source

    pub async fn authorize_with( self, request: &ClientRequest, access_control: &Arc<dyn DynAccessControl>, @@ -21,7 +18,7 @@ authorization decision.

    Returns OnDisconnectGuard in case the authorization was successful and the confirmation message was sent to the client. The handshake protocol is now complete.

    Returns an error if the authorization failed or if the confirmation message could not be sent.

    -

    Source

    pub async fn authorize_if( +

    Source

    pub async fn authorize_if( self, access: Access, io: &mut (impl BytesStreamSink + ExportKeyingMaterial), @@ -39,7 +36,7 @@ the authorization decision to the client and completes the handshake protocol.Ok(PublicKey) - The client’s public key if authorization was granted
  • Err(Error) - If authorization was denied or communication failed
  • -

    Trait Implementations§

    Source§

    impl Debug for SuccessfulAuthentication

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Debug for SuccessfulAuthentication

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/server/client/index.html b/pr/4036/docs/iroh_relay/server/client/index.html index f00f76c4b8..7f4c057924 100644 --- a/pr/4036/docs/iroh_relay/server/client/index.html +++ b/pr/4036/docs/iroh_relay/server/client/index.html @@ -1,2 +1,2 @@ iroh_relay::server::client - Rust

    Module client

    Module client 

    Source
    Available on crate feature server only.
    Expand description

    The server-side representation of an ongoing client relaying connection.

    -

    Structs§

    Config
    Configuration for a [Client].
    ForwardPacketError
    Error returned when forwarding a packet to a client fails.

    Enums§

    HandleFrameError
    Error when handling an incoming frame from a client.
    RunError
    Run error
    WriteFrameError
    Error when writing a frame to a client.
    \ No newline at end of file +

    Structs§

    Config
    Configuration for a client connection.
    ForwardPacketError
    Error returned when forwarding a packet to a client fails.

    Enums§

    HandleFrameError
    Error when handling an incoming frame from a client.
    RunError
    Run error
    WriteFrameError
    Error when writing a frame to a client.

    \ No newline at end of file diff --git a/pr/4036/docs/iroh_relay/server/client/struct.Config.html b/pr/4036/docs/iroh_relay/server/client/struct.Config.html index 33f8a16ed3..ec6d7861f4 100644 --- a/pr/4036/docs/iroh_relay/server/client/struct.Config.html +++ b/pr/4036/docs/iroh_relay/server/client/struct.Config.html @@ -1,10 +1,10 @@ -Config in iroh_relay::server::client - Rust

    Config

    Struct Config 

    Source
    #[non_exhaustive]
    pub struct Config<S> { +Config in iroh_relay::server::client - Rust

    Config

    Struct Config 

    Source
    #[non_exhaustive]
    pub struct Config<S> { pub guard: OnDisconnectGuard, pub stream: RelayedStream<S>, pub write_timeout: Duration, pub channel_capacity: usize, pub protocol_version: ProtocolVersion, -}
    Available on crate feature server only.
    Expand description

    Configuration for a [Client].

    +}
    Available on crate feature server only.
    Expand description

    Configuration for a client connection.

    Generic over the stream type to support different WebSocket implementations.

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §guard: OnDisconnectGuard

    Reports the disconnect once the connection ends.

    Also the owner of this connection’s EndpointId and ConnectionId.

    diff --git a/pr/4036/docs/iroh_relay/server/clients/index.html b/pr/4036/docs/iroh_relay/server/clients/index.html index 9c8db9c1ae..18ab5ad92e 100644 --- a/pr/4036/docs/iroh_relay/server/clients/index.html +++ b/pr/4036/docs/iroh_relay/server/clients/index.html @@ -1,3 +1,2 @@ -iroh_relay::server::clients - Rust

    Module clients

    Module clients 

    Source
    Available on crate feature server only.
    Expand description

    The “Server” side of the client. Uses the ClientConnManager.

    -

    Structs§

    Clients
    Manages the connections to all currently connected clients. -Registry of connected relay clients.
    \ No newline at end of file +iroh_relay::server::clients - Rust

    Module clients

    Module clients 

    Source
    Available on crate feature server only.
    Expand description

    The “Server” side of the client. Uses the ClientConnManager.

    +

    Structs§

    Clients
    Registry of connected relay clients.
    \ No newline at end of file diff --git a/pr/4036/docs/iroh_relay/server/clients/struct.Clients.html b/pr/4036/docs/iroh_relay/server/clients/struct.Clients.html index 0bcf3dba7b..b234eb045b 100644 --- a/pr/4036/docs/iroh_relay/server/clients/struct.Clients.html +++ b/pr/4036/docs/iroh_relay/server/clients/struct.Clients.html @@ -1,16 +1,15 @@ -Clients in iroh_relay::server::clients - Rust

    Clients

    Struct Clients 

    Source
    pub struct Clients(/* private fields */);
    Available on crate feature server only.
    Expand description

    Manages the connections to all currently connected clients. -Registry of connected relay clients.

    +Clients in iroh_relay::server::clients - Rust

    Clients

    Struct Clients 

    Source
    pub struct Clients(/* private fields */);
    Available on crate feature server only.
    Expand description

    Registry of connected relay clients.

    This type manages the collection of active client connections and handles routing messages between them.

    -

    Implementations§

    Source§

    impl Clients

    Source

    pub async fn shutdown(&self)

    Shuts down all connected clients.

    +

    Implementations§

    Source§

    impl Clients

    Source

    pub async fn shutdown(&self)

    Shuts down all connected clients.

    This method gracefully disconnects all active client connections managed by this registry. It will wait for all clients to complete their shutdown before returning.

    -
    Source

    pub fn register<S>(&self, client_config: Config<S>, metrics: Arc<Metrics>)
    where +

    Source

    pub fn register<S>(&self, client_config: Config<S>, metrics: Arc<Metrics>)
    where S: BytesStreamSink + Send + 'static,

    Builds the client handler and starts the read & write loops for the connection.

    Once the client disconnects, the OnDisconnectGuard set in config will be dropped, allowing callers to be notified of the disconnect.

    -
    Source

    pub fn disconnect( +

    Source

    pub fn disconnect( &self, endpoint_id: EndpointId, connection_id: Option<ConnectionId>, @@ -21,7 +20,7 @@ endpoint. Returns true if a matching connection was found, or

    Shutdown happens asynchronously: each per-connection actor exits its run loop and unregisters itself after this call returns.

    -

    Trait Implementations§

    Source§

    impl Clone for Clients

    Source§

    fn clone(&self) -> Clients

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for Clients

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for Clients

    Source§

    fn default() -> Clients

    Returns the “default value” for a type. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Clone for Clients

    Source§

    fn clone(&self) -> Clients

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for Clients

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for Clients

    Source§

    fn default() -> Clients

    Returns the “default value” for a type. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/server/enum.CertConfig.html b/pr/4036/docs/iroh_relay/server/enum.CertConfig.html index 8a443363ce..b7cb4ac3cd 100644 --- a/pr/4036/docs/iroh_relay/server/enum.CertConfig.html +++ b/pr/4036/docs/iroh_relay/server/enum.CertConfig.html @@ -1,4 +1,4 @@ -CertConfig in iroh_relay::server - Rust

    CertConfig

    Enum CertConfig 

    Source
    #[non_exhaustive]
    pub enum CertConfig { +CertConfig in iroh_relay::server - Rust

    CertConfig

    Enum CertConfig 

    Source
    #[non_exhaustive]
    pub enum CertConfig { LetsEncrypt { acme_config: AcmeConfig, server_config_builder: ConfigBuilder<ServerConfig, WantsServerCert>, @@ -14,7 +14,7 @@

    §

    Manual

    Use a TLS key and certificate chain that can be reloaded.

    Fields

    §server_config: ServerConfig

    The [rustls::ServerConfig] to use.

    This needs to have the certificates or a certificate loader, it will be used by the server as-is.

    -

    Trait Implementations§

    Source§

    impl Debug for CertConfig

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Debug for CertConfig

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/server/enum.SpawnError.html b/pr/4036/docs/iroh_relay/server/enum.SpawnError.html index 91d754d5ff..d2af0d82ce 100644 --- a/pr/4036/docs/iroh_relay/server/enum.SpawnError.html +++ b/pr/4036/docs/iroh_relay/server/enum.SpawnError.html @@ -1,4 +1,4 @@ -SpawnError in iroh_relay::server - Rust

    SpawnError

    Enum SpawnError 

    Source
    #[non_exhaustive]
    pub enum SpawnError { +SpawnError in iroh_relay::server - Rust

    SpawnError

    Enum SpawnError 

    Source
    #[non_exhaustive]
    pub enum SpawnError { LocalAddr { source: Error, meta: Meta, @@ -36,7 +36,7 @@

    §

    NoLocalAddr

    Fields

    §source: Error
    §meta: Meta

    Captured call-site metadata

    §

    BindTcpListener

    Fields

    §source: Error
    §meta: Meta

    Captured call-site metadata

    §

    Metrics

    Fields

    §source: Error
    §meta: Meta

    Captured call-site metadata

    -

    Trait Implementations§

    Source§

    impl Debug for SpawnError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for SpawnError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Error for SpawnError

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<SpawnError> for AnyError

    Source§

    fn from(value: SpawnError) -> AnyError

    Converts to this type from the input type.
    Source§

    impl StackError for SpawnError

    Source§

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    Source§

    fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    Source§

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Debug for SpawnError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for SpawnError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Error for SpawnError

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<SpawnError> for AnyError

    Source§

    fn from(value: SpawnError) -> AnyError

    Converts to this type from the input type.
    Source§

    impl StackError for SpawnError

    Source§

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    Source§

    fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    Source§

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/server/enum.SupervisorError.html b/pr/4036/docs/iroh_relay/server/enum.SupervisorError.html index bf9b715d2e..e2ff83cab4 100644 --- a/pr/4036/docs/iroh_relay/server/enum.SupervisorError.html +++ b/pr/4036/docs/iroh_relay/server/enum.SupervisorError.html @@ -1,4 +1,4 @@ -SupervisorError in iroh_relay::server - Rust

    SupervisorError

    Enum SupervisorError 

    Source
    #[non_exhaustive]
    pub enum SupervisorError { +SupervisorError in iroh_relay::server - Rust

    SupervisorError

    Enum SupervisorError 

    Source
    #[non_exhaustive]
    pub enum SupervisorError { AcmeEventStreamFinished { meta: Meta, }, @@ -17,7 +17,7 @@

    §

    JoinError

    Fields

    §source: JoinError
    §meta: Meta

    Captured call-site metadata

    §

    NoRelayServicesEnabled

    Fields

    §meta: Meta

    Captured call-site metadata

    §

    TaskCancelled

    Fields

    §meta: Meta

    Captured call-site metadata

    -

    Trait Implementations§

    Source§

    impl Debug for SupervisorError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for SupervisorError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Error for SupervisorError

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<JoinError> for SupervisorError

    Source§

    fn from(source: JoinError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<SupervisorError> for AnyError

    Source§

    fn from(value: SupervisorError) -> AnyError

    Converts to this type from the input type.
    Source§

    impl StackError for SupervisorError

    Source§

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    Source§

    fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    Source§

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Debug for SupervisorError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Display for SupervisorError

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Error for SupervisorError

    Source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    Source§

    impl From<JoinError> for SupervisorError

    Source§

    fn from(source: JoinError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<SupervisorError> for AnyError

    Source§

    fn from(value: SupervisorError) -> AnyError

    Converts to this type from the input type.
    Source§

    impl StackError for SupervisorError

    Source§

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    Source§

    fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result

    Returns the next source in the chain, if any.
    Source§

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    Source§

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    Source§

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref(&self) -> ErrorRef<'_>

    Returns this error as an [ErrorRef]. Read more
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/server/index.html b/pr/4036/docs/iroh_relay/server/index.html index 34a3c7c91d..7f2a951532 100644 --- a/pr/4036/docs/iroh_relay/server/index.html +++ b/pr/4036/docs/iroh_relay/server/index.html @@ -1,4 +1,4 @@ -iroh_relay::server - Rust

    Module server

    Module server 

    Source
    Available on crate feature server only.
    Expand description

    A fully-fledged iroh-relay server over HTTP or HTTPS.

    +iroh_relay::server - Rust

    Module server

    Module server 

    Source
    Available on crate feature server only.
    Expand description

    A fully-fledged iroh-relay server over HTTP or HTTPS.

    This module provides an API to run a full fledged iroh-relay server. It is primarily used by the iroh-relay binary in this crate. It can be used to run a relay server in other locations however.

    diff --git a/pr/4036/docs/iroh_relay/server/struct.AcmeConfig.html b/pr/4036/docs/iroh_relay/server/struct.AcmeConfig.html index b5840262b3..2b79b7b7ca 100644 --- a/pr/4036/docs/iroh_relay/server/struct.AcmeConfig.html +++ b/pr/4036/docs/iroh_relay/server/struct.AcmeConfig.html @@ -1,12 +1,12 @@ -AcmeConfig in iroh_relay::server - Rust

    AcmeConfig

    Struct AcmeConfig 

    Source
    pub struct AcmeConfig { /* private fields */ }
    Available on crate feature server only.
    Expand description

    Configuration for the ACME client.

    -

    Implementations§

    Source§

    impl AcmeConfig

    Source

    pub fn new(directory_url: String) -> Self

    Creates a new AcmeConfig with a ACME directory URL.

    -
    Source

    pub fn letsencrypt(production: bool) -> Self

    Creates a new AcmeConfig with the Let’s Encrypt directory URL.

    -
    Source

    pub fn domains(self, domains: Vec<String>) -> Self

    Provides the list of domains for which certificates should be obtained.

    -
    Source

    pub fn contact(self, contact: Vec<String>) -> Self

    Provides a list of contacts for the account.

    +AcmeConfig in iroh_relay::server - Rust

    AcmeConfig

    Struct AcmeConfig 

    Source
    pub struct AcmeConfig { /* private fields */ }
    Available on crate feature server only.
    Expand description

    Configuration for the ACME client.

    +

    Implementations§

    Source§

    impl AcmeConfig

    Source

    pub fn new(directory_url: String) -> Self

    Creates a new AcmeConfig with a ACME directory URL.

    +
    Source

    pub fn letsencrypt(production: bool) -> Self

    Creates a new AcmeConfig with the Let’s Encrypt directory URL.

    +
    Source

    pub fn domains(self, domains: Vec<String>) -> Self

    Provides the list of domains for which certificates should be obtained.

    +
    Source

    pub fn contact(self, contact: Vec<String>) -> Self

    Provides a list of contacts for the account.

    Note that email addresses must include a mailto: prefix.

    -
    Source

    pub fn cache_path(self, path: PathBuf) -> Self

    Sets the directory where to cache certificates.

    +
    Source

    pub fn cache_path(self, path: PathBuf) -> Self

    Sets the directory where to cache certificates.

    If not called certificates will not be cached.

    -

    Trait Implementations§

    Source§

    impl Clone for AcmeConfig

    Source§

    fn clone(&self) -> AcmeConfig

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for AcmeConfig

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Clone for AcmeConfig

    Source§

    fn clone(&self) -> AcmeConfig

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for AcmeConfig

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/server/struct.ClientRateLimit.html b/pr/4036/docs/iroh_relay/server/struct.ClientRateLimit.html index fe63af43f3..0e09cb9632 100644 --- a/pr/4036/docs/iroh_relay/server/struct.ClientRateLimit.html +++ b/pr/4036/docs/iroh_relay/server/struct.ClientRateLimit.html @@ -1,12 +1,12 @@ -ClientRateLimit in iroh_relay::server - Rust

    ClientRateLimit

    Struct ClientRateLimit 

    Source
    #[non_exhaustive]
    pub struct ClientRateLimit { +ClientRateLimit in iroh_relay::server - Rust

    ClientRateLimit

    Struct ClientRateLimit 

    Source
    #[non_exhaustive]
    pub struct ClientRateLimit { pub bytes_per_second: NonZeroU32, pub max_burst_bytes: Option<NonZeroU32>, }
    Available on crate feature server only.
    Expand description

    Per-client rate limit configuration.

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §bytes_per_second: NonZeroU32

    Max number of bytes per second to read from the client connection.

    §max_burst_bytes: Option<NonZeroU32>

    Max number of bytes to read in a single burst.

    -

    Implementations§

    Source§

    impl ClientRateLimit

    Source

    pub fn new(bytes_per_second: NonZeroU32) -> Self

    Creates a new ClientRateLimit with the given byte rate.

    +

    Implementations§

    Source§

    impl ClientRateLimit

    Source

    pub fn new(bytes_per_second: NonZeroU32) -> Self

    Creates a new ClientRateLimit with the given byte rate.

    max_burst_bytes is left unset; assign it after construction to allow bursting.

    -

    Trait Implementations§

    Source§

    impl Clone for ClientRateLimit

    Source§

    fn clone(&self) -> ClientRateLimit

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for ClientRateLimit

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Copy for ClientRateLimit

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Clone for ClientRateLimit

    Source§

    fn clone(&self) -> ClientRateLimit

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for ClientRateLimit

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Copy for ClientRateLimit

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/server/struct.Limits.html b/pr/4036/docs/iroh_relay/server/struct.Limits.html index 8fa14a37dd..28ecf4fe40 100644 --- a/pr/4036/docs/iroh_relay/server/struct.Limits.html +++ b/pr/4036/docs/iroh_relay/server/struct.Limits.html @@ -1,11 +1,13 @@ -Limits in iroh_relay::server - Rust

    Limits

    Struct Limits 

    Source
    #[non_exhaustive]
    pub struct Limits { +Limits in iroh_relay::server - Rust

    Limits

    Struct Limits 

    Source
    #[non_exhaustive]
    pub struct Limits { + pub client_rx: Option<ClientRateLimit>, pub accept_conn_limit: Option<f64>, pub accept_conn_burst: Option<usize>, - pub client_rx: Option<ClientRateLimit>, }
    Available on crate feature server only.
    Expand description

    Rate limits.

    -

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §accept_conn_limit: Option<f64>

    Rate limit for accepting new connection. Unlimited if not set.

    -
    §accept_conn_burst: Option<usize>

    Burst limit for accepting new connection. Unlimited if not set.

    -
    §client_rx: Option<ClientRateLimit>

    Rate limits for incoming traffic from a client connection.

    +

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §client_rx: Option<ClientRateLimit>

    Rate limits for incoming traffic from a client connection.

    +
    §accept_conn_limit: Option<f64>

    Rate limit for accepting new connections. Unlimited if not set.

    +

    Not currently implemented, setting this has no effect.

    +
    §accept_conn_burst: Option<usize>

    Burst limit for accepting new connections. Unlimited if not set.

    +

    Not currently implemented, setting this has no effect.

    Trait Implementations§

    Source§

    impl Debug for Limits

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for Limits

    Source§

    fn default() -> Limits

    Returns the “default value” for a type. Read more

    Auto Trait Implementations§

    §

    impl Freeze for Limits

    §

    impl RefUnwindSafe for Limits

    §

    impl Send for Limits

    §

    impl Sync for Limits

    §

    impl Unpin for Limits

    §

    impl UnwindSafe for Limits

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where diff --git a/pr/4036/docs/iroh_relay/server/struct.Metrics.html b/pr/4036/docs/iroh_relay/server/struct.Metrics.html index 3d51c3adbd..7eedc1997f 100644 --- a/pr/4036/docs/iroh_relay/server/struct.Metrics.html +++ b/pr/4036/docs/iroh_relay/server/struct.Metrics.html @@ -1,4 +1,4 @@ -Metrics in iroh_relay::server - Rust

    Metrics

    Struct Metrics 

    Source
    #[non_exhaustive]
    pub struct Metrics {
    Show 26 fields +Metrics in iroh_relay::server - Rust

    Metrics

    Struct Metrics 

    Source
    #[non_exhaustive]
    pub struct Metrics {
    Show 26 fields pub bytes_sent: Counter, pub bytes_recv: Counter, pub send_packets_sent: Counter, @@ -26,21 +26,26 @@ pub http_connections_closed: Counter, pub http_connections_errored: Counter,
    }
    Available on crate feature server only.
    Expand description

    Metrics tracked for the relay server

    -

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §bytes_sent: Counter

    Bytes sent from a FrameType::SendPacket

    -
    §bytes_recv: Counter

    Bytes received from a FrameType::SendPacket

    -
    §send_packets_sent: Counter

    FrameType::SendPacket sent

    -
    §send_packets_recv: Counter

    FrameType::SendPacket received

    -
    §send_packets_dropped: Counter

    FrameType::SendPacket dropped

    -
    §other_packets_sent: Counter

    Packets of other FrameTypes sent

    -
    §other_packets_recv: Counter

    Packets of other FrameTypes received

    -
    §other_packets_dropped: Counter

    Packets of other FrameTypes dropped

    -
    §got_ping: Counter

    Number of FrameType::Pings received

    -
    §sent_pong: Counter

    Number of FrameType::Pongs sent

    -
    §unknown_frames: Counter

    Number of FrameType::Unknown received

    +

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §bytes_sent: Counter

    Bytes sent to a client in RelayToClientDatagram or RelayToClientDatagramBatch frames.

    +
    §bytes_recv: Counter

    Bytes received from a client in ClientToRelayDatagram or ClientToRelayDatagramBatch frames.

    +
    §send_packets_sent: Counter§send_packets_recv: Counter

    ClientToRelayDatagram or ClientToRelayDatagramBatch frames received from a client.

    +
    §send_packets_dropped: Counter

    RelayToClientDatagram or RelayToClientDatagramBatch frames dropped instead of being +delivered to a client, because the recipient is not connected or writing to its stream failed.

    +

    Note that frames dropped because the recipient’s send queue is full or closed are not counted +here.

    +
    §other_packets_sent: Counter

    Intended to count sent frames other than datagrams, but currently unused (never incremented).

    +
    §other_packets_recv: Counter

    Intended to count received frames other than datagrams, but currently unused (never incremented).

    +
    §other_packets_dropped: Counter

    Intended to count dropped frames other than datagrams, but currently unused (never incremented).

    +
    §got_ping: Counter

    Number of FrameType::Ping frames received from a client.

    +
    §sent_pong: Counter

    Number of FrameType::Pong frames sent to a client.

    +
    §unknown_frames: Counter

    Intended to count received frames with an unrecognized FrameType, +but currently unused (never incremented).

    §bytes_rx_ratelimited_total: Counter

    Number of bytes received from client connection which have been rate-limited.

    §conns_rx_ratelimited_total: Counter

    Number of client connections which have had any frames rate-limited.

    §accepts: Counter

    Number of times this server has accepted a connection.

    -
    §disconnects: Counter

    Number of connections we have removed because of an error

    +
    §disconnects: Counter

    Number of times a client connection was disconnected.

    +

    Incremented once per connection, paired with Self::accepts.

    §unique_client_keys: Counter

    Number of unique client keys per day

    §clients_inactive_added: Counter

    Number of times a client was moved into the inactive state.

    A client becomes inactive when a new client connects with the same endpoint id. An inactive diff --git a/pr/4036/docs/iroh_relay/server/struct.RelayMetrics.html b/pr/4036/docs/iroh_relay/server/struct.RelayMetrics.html index d2d01600f3..36362bd53a 100644 --- a/pr/4036/docs/iroh_relay/server/struct.RelayMetrics.html +++ b/pr/4036/docs/iroh_relay/server/struct.RelayMetrics.html @@ -1,8 +1,8 @@ -RelayMetrics in iroh_relay::server - Rust

    RelayMetrics

    Struct RelayMetrics 

    Source
    #[non_exhaustive]
    pub struct RelayMetrics { +RelayMetrics in iroh_relay::server - Rust

    RelayMetrics

    Struct RelayMetrics 

    Source
    #[non_exhaustive]
    pub struct RelayMetrics { pub server: Arc<Metrics>, }
    Available on crate feature server only.
    Expand description

    All metrics tracked in the relay server.

    Fields (Non-exhaustive)§

    This struct is marked as non-exhaustive
    Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
    §server: Arc<Metrics>

    Metrics tracked for the relay server.

    -

    Trait Implementations§

    Source§

    impl Clone for RelayMetrics

    Source§

    fn clone(&self) -> RelayMetrics

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayMetrics

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for RelayMetrics

    Source§

    fn default() -> RelayMetrics

    Returns the “default value” for a type. Read more
    Source§

    impl MetricsGroupSet for RelayMetrics

    Source§

    fn name(&self) -> &'static str

    Returns the name of this metrics group set.
    Source§

    fn groups_cloned(&self) -> impl Iterator<Item = Arc<dyn MetricsGroup>>

    Returns an iterator over owned clones of the [MetricsGroup] in this struct.
    Source§

    fn groups(&self) -> impl Iterator<Item = &dyn MetricsGroup>

    Returns an iterator over references to the [MetricsGroup] in this struct.
    §

    fn iter(&self) -> impl Iterator<Item = (&'static str, MetricItem<'_>)>

    Returns an iterator over all metrics in this metrics group set. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Clone for RelayMetrics

    Source§

    fn clone(&self) -> RelayMetrics

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayMetrics

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    Source§

    impl Default for RelayMetrics

    Source§

    fn default() -> RelayMetrics

    Returns the “default value” for a type. Read more
    Source§

    impl MetricsGroupSet for RelayMetrics

    Source§

    fn name(&self) -> &'static str

    Returns the name of this metrics group set.
    Source§

    fn groups_cloned(&self) -> impl Iterator<Item = Arc<dyn MetricsGroup>>

    Returns an iterator over owned clones of the [MetricsGroup] in this struct.
    Source§

    fn groups(&self) -> impl Iterator<Item = &dyn MetricsGroup>

    Returns an iterator over references to the [MetricsGroup] in this struct.
    §

    fn iter(&self) -> impl Iterator<Item = (&'static str, MetricItem<'_>)>

    Returns an iterator over all metrics in this metrics group set. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/server/struct.Server.html b/pr/4036/docs/iroh_relay/server/struct.Server.html index 70270e6cf3..af8fc7d3cb 100644 --- a/pr/4036/docs/iroh_relay/server/struct.Server.html +++ b/pr/4036/docs/iroh_relay/server/struct.Server.html @@ -1,25 +1,25 @@ -Server in iroh_relay::server - Rust

    Server

    Struct Server 

    Source
    pub struct Server { /* private fields */ }
    Available on crate feature server only.
    Expand description

    A running Relay + QAD server.

    +Server in iroh_relay::server - Rust

    Server

    Struct Server 

    Source
    pub struct Server { /* private fields */ }
    Available on crate feature server only.
    Expand description

    A running Relay + QAD server.

    This is a full Relay server, including QAD, Relay and various associated HTTP services.

    Dropping this will stop the server.

    -

    Implementations§

    Source§

    impl Server

    Source

    pub async fn spawn(config: ServerConfig) -> Result<Self, SpawnError>

    Starts the server.

    -
    Source

    pub async fn shutdown(self) -> Result<(), SupervisorError>

    Requests graceful shutdown.

    +

    Implementations§

    Source§

    impl Server

    Source

    pub async fn spawn(config: ServerConfig) -> Result<Self, SpawnError>

    Starts the server.

    +
    Source

    pub async fn shutdown(self) -> Result<(), SupervisorError>

    Requests graceful shutdown.

    Returns once all server tasks have stopped.

    -
    Source

    pub async fn join(&mut self) -> Result<Result<(), SupervisorError>, JoinError>

    Waits for the server’s supervisor task to finish.

    +
    Source

    pub async fn join(&mut self) -> Result<Result<(), SupervisorError>, JoinError>

    Waits for the server’s supervisor task to finish.

    Returns the exit result of the supervisor task. Unlike Self::shutdown, this does not request shutdown, it only waits for the server to terminate on its own (for example, after an internal error or because the supervisor was aborted from elsewhere). The outer [JoinError] is only produced if the supervisor task itself panics or is aborted.

    -
    Source

    pub fn https_addr(&self) -> Option<SocketAddr>

    The socket address the HTTPS server is listening on.

    -
    Source

    pub fn http_addr(&self) -> Option<SocketAddr>

    The socket address the HTTP server is listening on.

    -
    Source

    pub fn quic_addr(&self) -> Option<SocketAddr>

    The socket address the QUIC server is listening on.

    -
    Source

    pub fn https_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s https RelayUrl.

    +
    Source

    pub fn https_addr(&self) -> Option<SocketAddr>

    The socket address the HTTPS server is listening on.

    +
    Source

    pub fn http_addr(&self) -> Option<SocketAddr>

    The socket address the HTTP server is listening on.

    +
    Source

    pub fn quic_addr(&self) -> Option<SocketAddr>

    The socket address the QUIC server is listening on.

    +
    Source

    pub fn https_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s https RelayUrl.

    This uses Self::https_addr so it’s mostly useful for local development.

    -
    Source

    pub fn http_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s http RelayUrl.

    +
    Source

    pub fn http_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s http RelayUrl.

    This uses Self::http_addr so it’s mostly useful for local development.

    -
    Source

    pub fn metrics(&self) -> &RelayMetrics

    Returns the metrics collected in the relay server.

    -
    Source

    pub fn relay_service(&self) -> Option<&RelayService>

    Returns a handle to the embedded RelayService for runtime control.

    -

    Trait Implementations§

    Source§

    impl Debug for Server

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl Freeze for Server

    §

    impl !RefUnwindSafe for Server

    §

    impl Send for Server

    §

    impl Sync for Server

    §

    impl Unpin for Server

    §

    impl !UnwindSafe for Server

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Source

    pub fn metrics(&self) -> &RelayMetrics

    Returns the metrics collected in the relay server.

    +
    Source

    pub fn relay_service(&self) -> Option<&RelayService>

    Returns a handle to the embedded RelayService for runtime control.

    +

    Trait Implementations§

    Source§

    impl Debug for Server

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl Freeze for Server

    §

    impl !RefUnwindSafe for Server

    §

    impl Send for Server

    §

    impl Sync for Server

    §

    impl Unpin for Server

    §

    impl !UnwindSafe for Server

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where T: 'static + ?Sized,

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for T
    where T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where T: 'a,

    §

    fn implicit( diff --git a/pr/4036/docs/iroh_relay/server/struct.TlsConfig.html b/pr/4036/docs/iroh_relay/server/struct.TlsConfig.html index 5baa6f4343..1e0e01c020 100644 --- a/pr/4036/docs/iroh_relay/server/struct.TlsConfig.html +++ b/pr/4036/docs/iroh_relay/server/struct.TlsConfig.html @@ -7,7 +7,7 @@

    Since the captive portal probe has to run over plain text HTTP and TLS is used for the main relay server this has to be on a different port. When TLS is not enabled this is served on the RelayConfig::http_bind_addr socket address.

    -

    Normally you’d choose port 80.

    +

    Normally you’d choose port 443.

    §cert: CertConfig

    Mode for getting a cert.

    Implementations§

    Source§

    impl TlsConfig

    Source

    pub fn new(https_bind_addr: impl Into<SocketAddr>, cert: CertConfig) -> Self

    Creates a new TlsConfig with the given bind address and certificate configuration.

    Trait Implementations§

    Source§

    impl Debug for TlsConfig

    Source§

    fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where diff --git a/pr/4036/docs/iroh_relay/tls/type.ServerCertVerifierBuilder.html b/pr/4036/docs/iroh_relay/tls/type.ServerCertVerifierBuilder.html index 7fa9ac22e1..8088ab8051 100644 --- a/pr/4036/docs/iroh_relay/tls/type.ServerCertVerifierBuilder.html +++ b/pr/4036/docs/iroh_relay/tls/type.ServerCertVerifierBuilder.html @@ -1,3 +1,3 @@ ServerCertVerifierBuilder in iroh_relay::tls - Rust

    ServerCertVerifierBuilder

    Type Alias ServerCertVerifierBuilder 

    Source
    pub type ServerCertVerifierBuilder = Arc<dyn Fn(Arc<CryptoProvider>) -> Result<Arc<dyn ServerCertVerifier>> + Send + Sync + 'static>;
    Expand description

    Function to build a [ServerCertVerifier] from a [CryptoProvider].

    -

    See `CaTlsConfig::custom_server_cert_verifier.

    +

    See CaTlsConfig::custom_server_cert_verifier.

    Aliased Type§

    pub struct ServerCertVerifierBuilder { /* private fields */ }
    \ No newline at end of file diff --git a/pr/4036/docs/iroh_relay/trait.ExportKeyingMaterial.html b/pr/4036/docs/iroh_relay/trait.ExportKeyingMaterial.html index 4421c4461a..3ea949a6ff 100644 --- a/pr/4036/docs/iroh_relay/trait.ExportKeyingMaterial.html +++ b/pr/4036/docs/iroh_relay/trait.ExportKeyingMaterial.html @@ -1,4 +1,4 @@ -ExportKeyingMaterial in iroh_relay - Rust

    ExportKeyingMaterial

    Trait ExportKeyingMaterial 

    Source
    pub trait ExportKeyingMaterial {
    +ExportKeyingMaterial in iroh_relay - Rust

    ExportKeyingMaterial

    Trait ExportKeyingMaterial 

    Source
    pub trait ExportKeyingMaterial {
         // Required method
         fn export_keying_material<T: AsMut<[u8]>>(
             &self,
    @@ -6,13 +6,11 @@
             label: &[u8],
             context: Option<&[u8]>,
         ) -> Option<T>;
    -}
    Expand description

    This trait allows anything that ends up potentially -wrapping a TLS stream use the underlying export_keying_material -function.

    -

    Trait for extracting keying material from a TLS connection.

    -

    This is used during the relay handshake to establish a shared secret -between the client and server for authentication purposes.

    -

    Required Methods§

    Expand description

    Trait for extracting keying material from a TLS connection.

    +

    This allows anything that ends up potentially wrapping a TLS stream to use the +underlying export_keying_material function. It is used during the relay handshake +to establish a shared secret between the client and server for authentication purposes.

    +

    Required Methods§

    Source

    fn export_keying_material<T: AsMut<[u8]>>( &self, output: T, label: &[u8], diff --git a/pr/4036/docs/search.index/desc/090eaf7ab7ca.js b/pr/4036/docs/search.index/desc/090eaf7ab7ca.js deleted file mode 100644 index 48b7d3ff4e..0000000000 --- a/pr/4036/docs/search.index/desc/090eaf7ab7ca.js +++ /dev/null @@ -1 +0,0 @@ -rd_("AmData flows in both directionsAbIP based addressesBdThe local IP, if the OS surfaced it.BgA direct connection from an IP address.CkAn IP address, should always be stored in its canonical \xe2\x80\xa63BnConfigures the endpoint to use the n0 defaultsAjContains the success valueChVersion 1 (the only version supported until iroh 0.98.0)B`Version 2 (added in iroh 0.98.0)AlThe endpoint\xe2\x80\x99s identifier.AoGet the identity of this stream00BiReturns the path\xe2\x80\x99s PathId.BcReturns the remote\xe2\x80\x99s endpoint id.BiReturns the endpoint id of this endpoint.A`Path identifier.0BkPath identifier of the newly selected path.AiReturns the transport id.7CiReturns a watcher that updates every time this or the \xe2\x80\xa6CkAll supported protocol versions, in order of preference \xe2\x80\xa6Djnoq types that are used in the public iroh API. Whether a \xe2\x80\xa6B`Error type on failed conversion.AhContains the error valueAoThe largest representable valueAlThe maximum path ID allowed.BkPublic internet address discovered via QAD.lDNS over TCP0lDNS over TLS0C`A Tls wrapped tokio::net::TcpStreamlDNS over UDP0BmData flows only from the stream\xe2\x80\x99s initiatorBkAdds an AddressLookup service.CiReturns an iterator of all supported protocol version \xe2\x80\xa6AnWhich directions data flows inAjConfigurable DNS resolver.AoDNS endpoint discovery for iroh1BcConfiguration for the DNS listener.BeExplicit congestion notification bitsClUpdates the watcher to the latest value and returns that \xe2\x80\xa6AoReturns the config for a relay.CdReturns the path with the given PathId.B`The current best RTT estimation.2BfThe number of I/O operations executed.BoReturns the number of relays in this relay map.BjReturns the number of services configured.BaReturns the number of open paths.2BbSet a custom TokenLogCiMaps this watcher with a function that transforms the \xe2\x80\xa6CaMinimum RTT registered so far for this estimator.DhCreates a new EndpointAddr with no network level addresses.C`Creates a new SignatureError error.CdCreates a new RelayUrlParseError error.ClCreates a new relay configuration with the given URL and \xe2\x80\xa6DhCreates a new EndpointData with given list of transport \xe2\x80\xa6BdCreate a new AddrFilterE`Creates a new EndpointInfo with an empty EndpointData.BoWraps an address lookup with an address filter.BgCreates a new Error error.DaCreates a new Item from a EndpointInfo.BmCreates a new static Address Lookup instance.BhCreates a PkarrRelayClient.DiCreates a new QlogConfig that writes a qlog trace to the \xe2\x80\xa6CiCreates a new qlog factory that writes files into the \xe2\x80\xa6BlCreates a new RetryError error.CgCreates a new RemoteEndpointIdError error.DgCreates a new Builder using the given Preset.BcInitializes new connection options.BkConstruct an error with a code and a reasonAeCreate a new StreamIdDjCreates a new RecvInfo for an incoming packet on a custom \xe2\x80\xa6CoCreates a new router builder using given Endpoint.C`Creates a new StaggeredError error.CkCreates a new DNS resolver with sensible cross-platform \xe2\x80\xa6ChCreates a new MaxLengthExceededError error.DjCreates a new QlogFileGroup that writes qlog files to the \xe2\x80\xa6BaCreates a new empty test network.DhCreates a new EndpointAddr with no network level addresses.CgCreates a new SignatureParsingError error.C`Creates a new SignatureError error.CdCreates a new RelayUrlParseError error.87DhCreates a new EndpointData with given list of transport \xe2\x80\xa6BdCreate a new AddrFilter8E`Creates a new EndpointInfo with an empty EndpointData.DdCreates a new DnsConfig with the given required fields.BoCreate a new key cache with the given capacity.CjCreates a new ping tracker with the given maximum ping \xe2\x80\xa6ClCreates a new relay configuration with the given URL and \xe2\x80\xa6CkCreates a new QUIC address discovery configuration with \xe2\x80\xa6BgCreate a new ClientBuilderEdCreates a new RelayConfig bound to http_bind_addr with \xe2\x80\xa6EeCreates a new ClientRequest from an EndpointId and HTTP \xe2\x80\xa6DfCreates a new QuicConfig bound to bind_addr.DhCreates a new TlsConfig with the given bind address and \xe2\x80\xa6DdCreates a new ClientRateLimit with the given byte rate.D`Creates a new AcmeConfig with a ACME directory URL.CiCreates a new config with sensible default values for \xe2\x80\xa6CdCreates a new ForwardPacketError error.ClCreates a new RelayedStream from an inner stream and key \xe2\x80\xa6DkCreates a new bucket starting full at max tokens, refilled \xe2\x80\xa6CeCreates a new InvalidBucketConfig error.DmCreates a new TlsConfig from a rustls ServerConfig.AkCreates a new RelayService.BoCreates a new service wrapper for a connection.DaCreates a new UnsupportedRelayProtocolVersion error.CmCreate a new QuicClient to handle the client side of QUIC \xe2\x80\xa6CkGet SystemTime::now() or the mocked equivalentBgReturns a strictly monotonic timestamp.BnReturns the path\xe2\x80\x99s round-trip time estimate.ChCurrent best estimate of this connection\xe2\x80\x99s latency \xe2\x80\xa60BgRun DNS and Pkarr servers on localhost.BcSets the path as the selected path.AkTLS configuration for iroh.CgTLS verification configuration for iroh and iroh-relay.BgTLS configuration for the HTTPS server.CbSets the TTL (time-to-live) for published packets.BbThe origin of this direct address.C`Returns this frame\xe2\x80\x99s corresponding frame type.CmReturns the URI of the HTTP request with which the client \xe2\x80\xa6D`The RelayUrl where this relay server can be dialed.BbReturns the URL of the home relay.AeThe URL of the relay.2AcTransports address.CjState-specific data stored in the Connection.AaAccess is denied.A`An IPv4 address.A`An IPv6 address.ChAddress lookup results from AddressLookups.Dhnoq_proto types that are used in the public iroh API. A \xe2\x80\xa6CfA single path within a PathList snapshot.CkMessages with these frames will be ignored. 8 byte ping \xe2\x80\xa6ClRequest from the relay to reply to the other side with a \xe2\x80\xa6CiRequest from the client to the server to reply to the \xe2\x80\xa6Ce8 byte payload, the contents of ping being replied toDiReply to a ClientToRelayMsg::Ping from a client with the \xe2\x80\xa6DiReply to a RelayToClientMsg::Ping from a server with the \xe2\x80\xa6B`An error occurred during readingDknoq types that are used in the public iroh API. Whether an \xe2\x80\xa6nThe 0 path id.BgReturns the TransportAddr.DjReturns the current EndpointAddr. As long as the endpoint \xe2\x80\xa6lThe address.CjExtracts the ALPN protocol from the peer\xe2\x80\x99s handshake \xe2\x80\xa60000AcBinds the endpoint.EeConstructs a default Endpoint using the provided Preset \xe2\x80\xa6AhCreate a custom endpointCgBinds and spawns the server from a Config.AhMode for getting a cert.mType of errorBlCurrent congestion window of the connection.BmThe information published about the endpoint.0CcReturns the opaque address data for this transport.1AoReturns the argument unchanged.00000000CmCreates a RelayMap from a RelayUrl.111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111111111111111111111111111BdConfiguration for the HTTP listener.ChHTTP-specific constants for the relay server and client.BaCalls U::from(self).0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AnPeer-to-peer QUIC connections.BhReturns an iterator over the open paths.C`Returns an iterator over all encountered errors.ClReturns an iterator over the character strings contained \xe2\x80\xa610BgWaits for the server tasks to complete.CcWaits for the server\xe2\x80\x99s supervisor task to finish.DbLoads a Config from a TOML file at path.AkCaptured call-site metadata000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AcAn empty selection.CoMethod for opening a sealed message data in-place.ClReturns a reference to the value currently stored in the \xe2\x80\xa6CgPort to bind the DNS listener to, for both UDP and TCP.BbPort to bind the HTTP listener to.BcPort to bind the HTTPS listener to.CdThe port on which the connection should be bound to.AiProduction configuration.ClConfiguration to speak to the QUIC endpoint on the relay \xe2\x80\xa6CjCreate a QUIC server that accepts connections for QUIC \xe2\x80\xa61DaConfiguration for the QUIC server, disabled if None.BgRead data contiguously from the stream.CcDecode TransportParameters from bufferClOptional A record to serve at each origin apex.BdMethod for sealing a token in-place.CmNumber of address validation tokens sent to a client when \xe2\x80\xa6CfReturns the side of the connection (client or server).CeSign the given message and return a digital signature0BiThe size of the packet that was too largeAcStop accepting data0CbReturns the URLs of all servers in this relay map.0AbAccess is allowed.Dhnoq_proto types that are used in the public iroh API. A \xe2\x80\xa6CkAn empty preset that doesn\xe2\x80\x99t set anything on the builder.CmError returned by address lookup services when failing to \xe2\x80\xa6AkQuic client related errors.AeProtocol send errors.nDNS over HTTPS0AoA locally bound socket address.CbA plain non-Tls tokio::net::TcpStreamBiError decoding the relay protocol messagefRelaysCdThe relay over which this network path is connected.AiA connection via a relay.A`A relay address.03CcThe peer abandoned transmitting data on this streamCnThe peer is unable to continue processing this connection, \xe2\x80\xa6DdTell the remote to retry with a token (a QUIC RETRY \xe2\x80\xa6CnRate limits by the client IP, extracted from reverse-proxy \xe2\x80\xa6BbThe type of value that can change.AjThe endpoint\xe2\x80\x99s addressesBlReturns the full list of all known addressesBgReturns the transport addr information.CiReturns an iterator over known all addresses for this \xe2\x80\xa6321CmBest-effort extraction of the ALPN protocols from the TLS \xe2\x80\xa6CmSets the ALPN protocols that this endpoint will accept on \xe2\x80\xa6ChApply the address filter function to a set of addresses.D`Applies the configuration to the passed in Builder.1E`Builds a DnsAddressLookup with the passed DnsResolver.DiBuilds the PkarrPublisher with the passed secret key for \xe2\x80\xa6CgCreates a PkarrResolver from this builder.BfBuild a PkarrRelayClient.BiConstruct a fresh ControllerCjBuild a QuicTransportConfig from the builder.DjBuild a ServerConfig from a ServerConfigBuilder.AhBuilds the DNS resolver.0AiThe contents of the chunkCiThe total amount of bytes which have been transferred \xe2\x80\xa6B`Removes all configured services.BbCloses the connection immediately.BhCloses the QUIC endpoint and the socket.AkCreates an empty relay map.CmCreates an empty builder with no address lookup services, \xe2\x80\xa61CcCreates a no-op guard for endpoint_id.BcFrame type that triggered the errorC`Reports the disconnect once the connection ends.B`Install hooks onto the endpoint.BeConfiguration for the HTTPS listener.CcDistinguishes streams of the same initiator and \xe2\x80\xa6BhWhether this is an IP transport address.CfReturns true if this is a direct IP path.1CeReturns the currently open network paths for this \xe2\x80\xa6AnIterator over candidate paths.CjAn address lookup service which publishes and resolves \xe2\x80\xa6AmPkarr signed packet encoding.DbConfiguration for the Relay server, disabled if None.CgThis module implements the send/recv relaying protocol.BbClose the send stream immediately.DiReturns a freshly-built resolver to replace self after a \xe2\x80\xa6CeReplaces the inner resolver with a freshly-built one.10AmResponds with a retry packet.CmOptional NS record to serve at each origin apex.CdSpawns an accept loop and returns a handle to it \xe2\x80\xa6AbStarts the server.BkSplits the client into a sink and a stream.B`Returns the path\xe2\x80\x99s statistics.AnReturns connection statistics.CgAggregate connection statistics at the moment of close.BeReturns path statistics if available.CeShow connection stats the at the end of the benchmarkBcTitle to record in the qlog captureBmReturns information how this address is used.CmWrite a buffer into this stream, returning how many bytes \xe2\x80\xa6CcEncode TransportParameters into bufferAkAccept the connect attempt.AfAccept the connection.0CaFuture produced by Endpoint::accept.BcAccess restriction for an endpoint.AmThe address is in active use.BfA token bucket used for rate-limiting.AmThe initiator of a connectionoA relay client.AjA network path was closed.Dknoq types that are used in the public iroh API. State of a \xe2\x80\xa6CbAn address explicitly provided by the user via \xe2\x80\xa6BgTop-level configuration for the server.BhConfiguration for a Client.AhCustom transport addressCgThe local custom address, if the transport reports one.BdA connection via a custom transport.AgUse a custom relay map.AkA custom transport address.BmA custom transport address with the given id.5DgREMOVED since relay-protocol-v2, use Self::Status instead.CkRemoved since relay-protocol-v2: A one-way message from \xe2\x80\xa6CfIgnore the connection entirely. The remote gets no \xe2\x80\xa6CjThe length of an ed25519 PublicKey, in bytes.CjThe length of an ed25519 Signature, in bytes.10ChEvents were dropped before the subscriber received them.lRate limits.DcLoad pre-existing certificates from the cert_cache \xe2\x80\xa6CiUse a TLS key and certificate chain that can be reloaded.Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6AnA new network path was opened.Dinoq_proto types that are used in the public iroh API. Id \xe2\x80\xa6A`Defines a presetAkReject the connect attempt.B`Reject and close the connection.CmActively refuse the connection. The remote will receive a \xe2\x80\xa6AaThe built router.AlThe acceptor of a connectionAjA running iroh-dns server.AmA running Relay + QAD server.CbRate limits by the connection\xe2\x80\x99s peer IP address.ChSent from server to client to declare the connection \xe2\x80\xa6CiA one-way message from relay to client, declaring the \xe2\x80\xa6CkOne-way message from server to client indicating issues \xe2\x80\xa6Dknoq types that are used in the public iroh API. An integer \xe2\x80\xa6CmAttempts to accept this incoming connection (an error may \xe2\x80\xa6BbReturns Self::Accept.BoAccepts an incoming connection on the endpoint.AnHandle an incoming connection.BiSee ProtocolHandler::accept.DiConfigures the router to accept the ProtocolHandler when \xe2\x80\xa6BhAccess control for incoming connections.AgCreate and run a client0DkExposes Client, which allows to establish connections to a \xe2\x80\xa6CgThe server-side representation of an ongoing client \xe2\x80\xa6CdWait for the connection to be closed for any reason.CjReturns a future that resolves once the connection has \xe2\x80\xa6ChReturns a future that resolves once the endpoint closes.EhCommon types between the super::handshake and super::relay \xe2\x80\xa6BjConfiguration for the Server.DhCreates a QuicTransportConfig that emits qlog files, if \xe2\x80\xa6BjCreate QUIC error code from TLS alert codeBkAn underlying crypto (e.g. TLS) layer errorBkRenamed to Self::custom_roots.DaCreate a custom relay mode from a list of RelayUrls.DhCreates a new DnsResolver from a struct that implements \xe2\x80\xa602CdExtends this RelayMap with another one.0CmNotify the peer that no more data will ever be written to \xe2\x80\xa6AfHeader protection keysCmIgnores this incoming connection attempt, not sending any \xe2\x80\xa6BgInserts a new relay into the relay map.0CfEnables saving the TLS pre-master key for connections.lRate limits.CfAn in-memory address lookup system to manually add \xe2\x80\xa6ChNumber of events dropped since the last delivered event.DdCreates a new DNS discovery using the iroh.link domain.CkCreates a pkarr publisher which uses the number 0 pkarr \xe2\x80\xa6ClCreates a pkarr resolver builder which uses the number 0 \xe2\x80\xa6AhThe offset in the streamB`Packet deliveries were confirmed0CjA convenience method that waits for the endpoint to be \xe2\x80\xa6AfPacket protection keysBfApplies the given Preset.DkReturns a Preset to apply the DNS address lookup and Pkarr \xe2\x80\xa6B`Protocols used by the iroh-relayBnThe public key of this SecretKey.0BeThe reason the connection was closed.BcHuman-readable reason for the close0BhHuman-readable explanation of the reasonCeClose reason to send with the connection close frame.CfOptional reason for denial to send back to the client.BiRejects this incoming connection attempt.BbReturns Self::Reject.DkReturns a list with the RelayConfig for each relay in this \xe2\x80\xa60BeRemoves an existing relay by its URL.0CnPick the selected path to carry application data among the \xe2\x80\xa6BmTake the provided endpoint and run the server0CeA fully-fledged iroh-relay server over HTTP or HTTPS.BeMetrics tracked for the relay server.BmMetrics collected by the endpoint\xe2\x80\x99s socket.C`Private source type, cannot be created publicly.0AkThe protocol decoding errorAkThe underlying stream error0ClReturns a stream which will yield the most recent values \xe2\x80\xa6AmThe relayed stream connectionClUses the operating system\xe2\x80\x99s certificate facilities for \xe2\x80\xa60BoReturns the protocol version identifier string.BbSerializes to the binary encoding.CmEncodes this key in z-base-32, the encoding used by pkarr \xe2\x80\xa60CkStatistics about datagrams and bytes received on this path.CjStatistics about UDP datagrams received on the connection.CgStatistics about datagrams and bytes sent on this path.CeStatistics about UDP datagrams transmitted on the \xe2\x80\xa6B`A QAD IPv4 round trip completed.B`A QAD IPv6 round trip completed.CgUpdates the watcher to the latest value and returns \xe2\x80\xa6ClVerify a signature on a message with this secret key\xe2\x80\x99s \xe2\x80\xa60CcNumber of ack-eliciting bytes that may be in flightAeBoxed iterator alias.0BbBuilder for Endpoint.BeBuilder for DnsResolver.0CkManages the connections to all currently connected clients.ClUse the default relay map, with production relay servers \xe2\x80\xa6BiEnable portmapping with default settings.CiThe connection is healthy and recovered from previous \xe2\x80\xa6BdCounters exposed by iroh-dns-server.BdMetrics tracked for the relay serverClA preset that is almost empty, besides setting mandatory \xe2\x80\xa6Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6BfUse the staging relay servers from n0.CcThe peer is no longer accepting data on this streamCaThe stream is larger than the user-supplied limitAdNot yet determined..CjPlaceholder for backwards-compatibility for future new \xe2\x80\xa6CkA handle to a value that\xe2\x80\x99s represented by one or more \xe2\x80\xa6CfNumber of times this server has accepted a connection.0DbCreates a DnsAddressLookupBuilder that implements \xe2\x80\xa6DhReturns a PkarrPublisherBuilder that publishes endpoint \xe2\x80\xa6ChCreates a new resolver builder using the pkarr relay \xe2\x80\xa6DiReturns a default QuicTransportConfigBuilder that allows \xe2\x80\xa6EhReturns the builder for an Endpoint, with the given Preset \xe2\x80\xa6DdCreates a new Router using given Endpoint.CmCreates a builder to construct a DNS resolver with custom \xe2\x80\xa60CcThe total number of clients which should be createdCaThe \xe2\x80\x9cServer\xe2\x80\x9d side of the client. Uses the \xe2\x80\xa6CnReturns a reference to the registry of currently connected \xe2\x80\xa6BkConnects to a remote Endpoint.CaEstablishes a new connection to the relay server.CnAttempts to consume bytes tokens from the bucket.BlProvides a list of contacts for the account.CkThe path currently considered the preferred path to the \xe2\x80\xa6CgDecrypt the packet payload with the given packet numberBcDecrypt the given packet\xe2\x80\x99s headerBbDecrypt the Initial packet payloadChDomains for which TLS certificates are issued or loaded.CnProvides the list of domains for which certificates should \xe2\x80\xa6D`Enables the mainline DHT fallback when set to true.CgEncrypt the packet payload with the given packet numberBcEncrypt the given packet\xe2\x80\x99s headerBnDo we have any indication that UDP is working?CjReturns the headers of the HTTP request with which the \xe2\x80\xa6AnOnly keep direct IP addresses.0CbCheck if this stream has been opened during 0-RTT.0BkCo-locating all of the iroh metrics structsCmRetrieve implementation-specific metrics used to populate \xe2\x80\xa60BlReturns metrics collected for this endpoint.CgShow iroh library counter metrics at the end of the \xe2\x80\xa6CaReturns the Metrics for this server.BeConfiguration for the metrics server.CbReturns the metrics collected in the relay server.CnThe maximum UDP payload size guaranteed to be supported by \xe2\x80\xa6CnCreates a minimal configuration that disables all optional \xe2\x80\xa6BbOne or more packets were just sent0BnInitiates a new outgoing bidirectional stream.CiOrigins under which the server publishes pkarr-signed \xe2\x80\xa6ChPresets allow configuring an endpoint quickly with a \xe2\x80\xa6BoDescription of why the connection is unhealthy.DgPublishes the given EndpointData to the Address Lookup \xe2\x80\xa6BfPublishes a SignedPacket.ClNumber of reports executed by net_report, including full \xe2\x80\xa6DeResolves the Item for the given EndpointId.DfResolves the addressing information for an EndpointId \xe2\x80\xa6DkResolves a SignedPacket for the given EndpointId.CoOptional AAAA record to serve at each origin apex.AfStaging configuration.CiCompletes when the peer stops the stream or reads the \xe2\x80\xa6CcThe total number of streams which should be createdCjStreams used in the server-side implementation of iroh \xe2\x80\xa6ClImplements logic for abstracting over a websocket stream \xe2\x80\xa6CeThe length of the AEAD tag appended to packets on \xe2\x80\xa6ClExposes functions to quickly configure a server suitable \xe2\x80\xa6BgCancel-safe waiting for a ping timeout.CgAn advisory duration for how long the client should \xe2\x80\xa6DfReturns a future completing with Ok(value) once a new \xe2\x80\xa6DkAttempts to upgrade this weak handle to a strong Connection\xe2\x80\xa6Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6CkIf the 0-RTT data was accepted, you can continue to use \xe2\x80\xa6CkThe kind of a transport address, used for configuring bias.CiAn AccessControl that admits every endpoint.BnOptions when configuring binding an IP socket.CjStrategy used to obtain TLS certificates for the HTTPS \xe2\x80\xa6BdDatagram support is disabled locallyAdDisable portmapping.CmDisable relay servers completely. This means that neither \xe2\x80\xa6B`Disables rate limiting entirely.BkPotential errors related to DNS operations.0ClControls an iroh endpoint, establishing connections with \xe2\x80\xa6CkA collection of HTTP request handlers for custom endpoints.BbThe address is not currently used.CkAn incoming connection for which the server has not yet \xe2\x80\xa6AhA cache for public keys.B`The largest encoded value lengthCmthe connection is being closed abruptly in the absence of \xe2\x80\xa6CjA borrowed snapshot of a connection\xe2\x80\x99s currently-open \xe2\x80\xa6CgPer-packet recv data filled in by transports during \xe2\x80\xa6CiIf the 0-RTT data was rejected, any streams that were \xe2\x80\xa6CmList of relay server configurations to be used in an iroh \xe2\x80\xa60BaA URL identifying a relay server.0BeTrait for DNS resolvers used in iroh.0iRun errorCjThis path was selected for transmission of application \xe2\x80\xa6Dknoq types that are used in the public iroh API. Identifier \xe2\x80\xa6CnCommunication with the peer has lapsed for longer than the \xe2\x80\xa6Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6ClThe datagram is larger than the connection can currently \xe2\x80\xa6AbAn outgoing packet2CkUnder the hood this is a UTF-8 String is no longer than \xe2\x80\xa600BdGet this public key as a byte array.0BaReturn the full serialized bytes.EhReturns true if a relay with url is contained in this this \xe2\x80\xa60oPacket contentsAoThe contents of the datagram(s)CjReturns the data directory where the server stores its \xe2\x80\xa6BjLocation where the server stores its data.BhDefault values used in irohBaDefault values used in the relay.DfReturns a MetricsConfig with the metrics server disabled.CjDisables the metrics server when set to true.ClReturns the local address that the DNS listener is bound \xe2\x80\xa6ClUses a compiled-in copy of the root certificates trusted \xe2\x80\xa60ChReturns the Endpoint stored in this router.CbReturns the Endpoint of the endpoint.DkThe Endpoint allows establishing connections to other iroh \xe2\x80\xa6ClTime a packet is retained in the store before it becomes \xe2\x80\xa6BnStatistics about frames received on this path.CcStatistics about frames received on the connection.CaStatistics about frames transmitted on this path.CfStatistics about frames transmitted on the connection.DkCreates a new qlog factory that writes files into QLOGDIR, \xe2\x80\xa6DdCreates a new QlogFileGroup that is only enabled if \xe2\x80\xa6CfCreates a new user error from an arbitrary error type.00BjConstruct a VarInt infalliblyBeSucceeds iff x < 2^62BiParses a key from its z-base-32 encoding.0DbGenerate a new SecretKey with a randomness generator.0C`Number of FrameType::Pings received0BnGet the server\xe2\x80\x99s http RelayUrl.CmSpecifies the time to wait after completing MTU discovery \xe2\x80\xa6CcReturns Self for use in down-casting to extract \xe2\x80\xa6BlReturns a list of IP addresses of this peer.BmReturns the direct addresses of the endpoint.0100BfDNS-based endpoint discovery for iroh.CkReturns true, if only a EndpointId is present.CeReturns true if this relay map is empty.BbAre there any services configured?BoReturns true if no paths are open.32CgWhether this is a transport address via a relay server.CbReturns true if this is a relay path.1CmDuration after an address validation token was issued for \xe2\x80\xa6BlConfiguration for the mainline DHT fallback.BlStarts a new ping with an RTT-based timeout.BoInitiates a new outgoing unidirectional stream.BcGet the priority of the send streamCjTools for spawning an accept loop that routes incoming \xe2\x80\xa6CmBuilds the client handler and starts the read & write \xe2\x80\xa6BbCalled when the router shuts down.BkSee ProtocolHandler::shutdown.BcShuts down the accept loop cleanly.ChCancels the server tasks and waits for them to complete.AkRequests graceful shutdown.ChShuts down the relay service, disconnecting all clients.BaShuts down all connected clients.AlSlow start threshold (bytes)CgContains all timeouts that we use in iroh.CkConvert this to the bytes representing the secret part. \xe2\x80\xa6AlReturn the inner byte array.10BeSucceeds iff x < 2^6200Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6BeIn-progress connection attempt futureDkBoxed HTTP response body produced by RelayServiceWithNotify\xe2\x80\xa6CmRepresents datagrams sent from relays (originally sent to \xe2\x80\xa6CnRequest from the client to relay datagrams to given remote \xe2\x80\xa6CjOne or multiple datagrams being transferred via the relay.CeErrors that can occur while dialing the relay server.BcConfiguration for the DNS listener.Dbnoq_proto types that are used in the public iroh API.BgPossible frame types during handshakingDknoq_proto types that are used in the public iroh API. Keys \xe2\x80\xa6BkMaximum total byte size of a signed packet.BoThe mechanism that was used for authentication.AdA net_report report.3CiLifecycle notifications for a transmission paths in a \xe2\x80\xa6Dknoq types that are used in the public iroh API. Statistics \xe2\x80\xa6mA public key.0AeA read error occurredDgnoq types that are used in the public iroh API. Errors \xe2\x80\xa6CeErrors when receiving messages from the relay server.AdRelay receive errorsD`Configuration of the relay servers for an Endpoint.mA secret key.0BoError for sending messages to the relay server.AaRelay send errorsAbEd25519 signature.0CgA pkarr timestamp in microseconds since the UNIX epoch.BcTLS configuration for Relay server.BkConfiguration to use for the TLS connectionCmError returned from the underlying WebSocket stream while \xe2\x80\xa6CnError returned from the underlying WebSocket stream during \xe2\x80\xa6BnAccept the next incoming bidirectional stream.CmAdds addresses to the endpoint data in the given ordered, \xe2\x80\xa60DfAdds an already Boxed AddressLookup service.BcReturns the raw microseconds value.CbBinds an IP socket at the provided socket address.BfAddress to bind the metrics server to.DgAddress to bind the DNS listener to (defaults to 0.0.0.0).DhAddress to bind the HTTP listener to (defaults to 0.0.0.0).DjAddress to bind the HTTPS listener to (defaults to 0.0.0.0\xe2\x80\xa6ChThe socket address on which the QUIC server should bind.BlCustom bootstrap nodes for the mainline DHT.BiStrategy used to obtain TLS certificates.CjRate limits for incoming traffic from a client connection.BbDuplicate the controller\xe2\x80\x99s stateBeThe number of UDP datagrams observed.BlThe datagrams and related metadata to relay.BcThe datagrams and related metadata.CnConvert to a hex string limited to the first 5 bytes for a \xe2\x80\xa60DjCreates a RelayMap from an iterator of RelayUrl.0BnTry to create Self from the raw representationAfip:port of global IPv4Be[ip]:port of global IPv6ClImplements the handshake protocol that authenticates and \xe2\x80\xa6AmDoes this have any addresses?0DkReturns the local address of the HTTP listener, or None if \xe2\x80\xa6CcThe socket address the HTTP server is listening on.BoGet the server\xe2\x80\x99s https RelayUrl.BoWhich side of a connection initiated the streamDhConverts this Connecting into a 0-RTT connection at the \xe2\x80\xa6DkConverts this Accepting into a 0-RTT or 0.5-RTT connection \xe2\x80\xa6BiConverts into TransportAddr.BaBase types and utilities for IrohBoShorthand for self == Side::ClientCiCheck if this endpoint is still alive, or already closed.BkWhether this is a custom transport address.0BoShorthand for self == Side::ServerBkThe authentication mechanism that was used.BbReturns the PKARR server HTTP URL.CiAttempts to read from the stream into the provided bufferC`poll receiving a packet on this custom endpoint.Bepoll sending a packet on this sender.CkSets an explicit proxy url to proxy all HTTP(S) traffic \xe2\x80\xa6CjSet an explicit proxy url to proxy all HTTP(S) traffic \xe2\x80\xa6CcThe socket address the QUIC server is listening on.BdReturns the relay map for this mode.DaReturns the EndpointId of the endpoint that this \xe2\x80\xa6DfReturns the EndpointId from the peer\xe2\x80\x99s TLS certificate.00DfRuns a future to completion, or until the Endpoint is \xe2\x80\xa6BlNumber of FrameType::Pongs sent0BiSets the list of accepted ALPN protocols.AeReturn the signature.BhA stable identifier for this connection.AeReturn the timestamp.CgReturns the optional user-defined data of the endpoint.BfReturns user data information, if set.AnReturns any user-defined data.21BoWrite a buffer into this stream in its entiretyBbConfiguration for the ACME client.ClA filter and/or reordering function applied to transport \xe2\x80\xa600AnTLS certificate configuration.CbThe client frame type for the authentication frameB`The send half of a relay client.BcAn outgoing connection in progress.AbA QUIC connection.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6CkA custom transport address consisting of a transport id \xe2\x80\xa6D`A direct address on which an iroh-endpoint might be \xe2\x80\xa6CeThe identifier for an endpoint in the (iroh) network.03BdConfiguration for the HTTP listener.DjBoxed error type returned from RelayServiceWithNotify\xe2\x80\x99s \xe2\x80\xa6CbThe max byte length allowed for user-defined data.0CaThe provenance string for this Address Lookup \xe2\x80\xa6CeAn address assigned by the router using port mapping.BeConfiguration for qlog trace logging.CbHandles the client side of QUIC address discovery.BbConfiguration for the QUIC server.ChThe HTTP path under which the relay accepts relaying \xe2\x80\xa6Dinoq types that are used in the public iroh API. A stream \xe2\x80\xa6BdInformation about a remote endpoint.Dgnoq types that are used in the public iroh API. Errors \xe2\x80\xa6CmSent from server to client for the server to declare that \xe2\x80\xa6ClA one-way message from relay to client, advertising that \xe2\x80\xa6DhError for attempting to retry an Incoming which already \xe2\x80\xa6CgGenerate self-signed certificates and cache them in \xe2\x80\xa66AcServer spawn errorsDfnoq_proto types that are used in the public iroh API. \xe2\x80\xa66CaAccepts the next incoming uni-directional stream.CnReturns a comma-separated string of all supported protocol \xe2\x80\xa6CkWhether the implementation is permitted to set the spin \xe2\x80\xa6BoOptional authorization token sent to the relay.0AlSets an authorization token.ClReturns the authorization token from the client\xe2\x80\x99s HTTP \xe2\x80\xa6CbReturns the number of bytes read from this stream.ChBytes received from a FrameType::SendPacket0CdBytes sent from a FrameType::SendPacket0BoSets the directory where to cache certificates.BhThe authenticated client\xe2\x80\x99s public key.D`Disconnects connections registered for endpoint_id.BnClass of error as encoded in the specificationB`Application-specific reason codeCcError code to send with the connection close frame.BcType of frame that caused the closeCgCreates a new user error from an arbitrary boxed error.CiConstruct a PublicKey from a slice of bytes.CaCreate a secret key from its byte representation.BmParse an Ed25519 signature from a byte slice.B`Parses from the binary encoding.321CbParse and verify a signed packet from its wire \xe2\x80\xa6CgCreates a new EndpointAddr from its parts.CgCreates a new EndpointInfo from its parts.1DeCreates a new CustomAddr from a transport id and raw \xe2\x80\xa61DiReturns the local address of the HTTPS listener, or None \xe2\x80\xa6CdThe socket address the HTTPS server is listening on.CjConverts into an iterator over known all addresses for \xe2\x80\xa6ClRemoves the filter wrapper and returns the inner address \xe2\x80\xa6AiExtract the integer valueCkIroh\xe2\x80\x99s relay is a feature within iroh, a peer-to-peer \xe2\x80\xa6CmReturns the most recent connection error, if the relay is \xe2\x80\xa6BgPath statistics captured at close time.BmReturns the path\xe2\x80\x99s local address, if known.CiReturns the local address that received this incoming \xe2\x80\xa6BdLocal address of the path, if known.0CgThe local address of the newly selected path, if known.BhReturns the local address of the client.AeLooks up TXT records.AfLooks up a TXT record.10BfThe number of bytes lost on this path.BkThe number of bytes lost on the connection.BaMetrics collected by net reports.C`Decides whether a connecting client is admitted.BkSee AccessControl::on_connect.ChWhether to run a local relay and have the server and \xe2\x80\xa6CjPad UDP datagrams carrying application data to current \xe2\x80\xa6CjPer-path statistics for every path the connection knew \xe2\x80\xa6C`Attempt to write bytes from buf into the stream.DkReturns the prefix_len, see Self::set_prefix_len.CcReturns the provenance of this Address Lookup item.AfReturn the public key.CoReads the next segment of data as zero-copy Bytes.AoReads the next segment of data.CkRead an exact number of bytes contiguously from the stream.CdSets the relay servers to assist in establishing \xe2\x80\xa6AjOnly keep relay addresses.0BjReturns a list of relay urls of this peer.BfReturns the relay URL of the endpoint.0100CcSets a secret key to authenticate with other peers.BhReturns the secret_key of this endpoint.CaRuns the server side of the handshaking protocol.BoEpoch qlog event times are recorded relative toBfInternal utilities to support testing.DjReturns the rustls::ClientConfig used by the endpoint for \xe2\x80\xa6CfCreates a TlsConfig suitable for testing.BdTypes for defining custom transportsCkConstructs a filter that doesn\xe2\x80\x99t filter addresses and \xe2\x80\xa60EeReturns a Watcher for the current EndpointAddr for this \xe2\x80\xa6AiAdds a list of addresses.0BoConfiguration for the signed-packet zone store.AeServer accept errors.ClConfigures the trusted CA root certificates for non-iroh \xe2\x80\xa60Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6B`Default timeout for DNS requests0CaProtocols over which DNS records can be resolved.0CcThe DNS resolver used throughout iroh.0BaAttempted to send an empty packetBeConfiguration for the HTTPS listener.BoResult alias for HTTP responses produced by \xe2\x80\xa6Dhnoq types that are used in the public iroh API. Maximum \xe2\x80\xa6CiObtain certificates from Let\xe2\x80\x99s Encrypt via the ACME \xe2\x80\xa6AdUse Let\xe2\x80\x99s Encrypt.CiPotential errors related to DNS endpoint address lookups.0BjTracks pings on a single relay connection.D`Constructs a QlogConfig for individual connections.BgInformation on a specific relay server.0CbConfiguration for the Relay HTTP and HTTPS server.BiConnection status of a single home relay.BjConfiguration for the signed-packet store.CmError returned from the underlying WebSocket stream while \xe2\x80\xa60BjError from the underlying WebSocket stream0BkError type for WebSocket stream operations.CbA simulated network for testing custom transports.CcAccepts this incoming connection using a custom \xe2\x80\xa6BbConfiguration for the ACME client.CjSets the address filter to control which addresses are \xe2\x80\xa6CnSets the address filter applied to all address data before \xe2\x80\xa6BiCurrent number of zones in the main cacheAjClears the internal cache.BcRemoves all entries from the cache.10BbCreate a connection usable for qadCeLargest UDP payload size the path currently supports.CfSOA record data served for authoritative zones, in \xe2\x80\xa6CkDefault time-to-live, in seconds, for returned DNS records.BiDescription to record in the qlog captureCiNumber of connections we have removed because of an error0CcReturns the endpoint id of the discovered endpoint.CjThe EndpointId of the endpoint this is about.BcThe endpoint ID of the remote peer.11CbReturns the EndpointId of the client.CnReturns the EndpointId of the guarded connection.CbCreates a timestamp from a raw microseconds value.ClLow-level HTTP server components for embedding the relay \xe2\x80\xa6CkThe initial value to be used as the maximum UDP payload \xe2\x80\xa6BkStarting guess for maximum UDP payload sizeBkThe RTT used before an RTT sample is taken.DjReturns a future completing once the value is set to Some \xe2\x80\xa6ClReturns the value set by Self::set_is_required.DdReturns true if this path is currently selected for \xe2\x80\xa6BiChecks if the router is already shutdown.DbCreates a new AcmeConfig with the Let\xe2\x80\x99s Encrypt \xe2\x80\xa6AiLooks up an IPv4 address.BgPerforms an IPv4 lookup with a timeout.10AiLooks up an IPv6 address.BgPerforms an IPv6 lookup with a timeout.10CeThe amount of concurrent streams which should be usedBaReturns the maximum ping timeout.DdPackets are acked in batches, all with the same now \xe2\x80\xa60ClWait until a Pkarr announce for an endpoint is published \xe2\x80\xa6AePacing rate (bytes/s)D`Returns a stream of PathEvents for this connection.CfThe number of network paths to peers that are relayed.ClReturns an iterator over the query parameters set in the \xe2\x80\xa6CgCreates a QuicConfig suitable for testing.CkConvenience method to read all remaining data into a bufferBnReturns the path\xe2\x80\x99s remote transport address.CgReturns the remote address of this incoming connection.BnReturns the remote address of this connection.AiRemote transport address.0CdRemote transport address of the newly selected path.ChReturns addressing information about a recently used \xe2\x80\xa6BoThe sample size used for this key\xe2\x80\x99s algorithmCiMaximum number of bytes to transmit to a peer without \xe2\x80\xa6BkReturns the big-endian byte representation.CcIterate over TXT records under a specific DNS name.CaNumber of bytes to transmit from client to serverCnSpecifies the upper bound to the max UDP payload size that \xe2\x80\xa6D`Returns a WeakConnectionHandle for this connection.CeSets a prefix to the filename of the generated files.DdWrites a single Bytes into this stream in its entirety.BcThe receive half of a relay client.CgThe stream has already been stopped, finished, or resetBmThe stream has already been finished or resetDfnoq types that are used in the public iroh API. Error \xe2\x80\xa6AbConnection errors.CiA process-unique identifier for a single relay client \xe2\x80\xa6mCustom senderCjNetwork-level addressing information for an iroh endpoint.0CgData about an endpoint that may be published to and \xe2\x80\xa600ChSent from server to client to signal that a previous \xe2\x80\xa6CjIndicates that the client identified by the underlying \xe2\x80\xa6CnInformation about an endpoint that may be published to and \xe2\x80\xa600BnThe remote address for an incoming connection.CfAn in-memory address lookup system to manually add \xe2\x80\xa6DdAn iterator over the open paths in a PathList snapshot.BbTrait to configure path selection.Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6BdMetrics tracked for the relay serverBhAll metrics tracked in the relay server.CiThe hyper Service that serves the actual relay endpoints.Djnoq_proto types that are used in the public iroh API. RTT \xe2\x80\xa64BiParameters governing incoming connectionsBaConfiguration for the full Relay.BhA signed DNS packet in the pkarr format.Dgnoq types that are used in the public iroh API. Errors \xe2\x80\xa6DiA simpler version of ToSocketAddrs, that does not do any \xe2\x80\xa6CfAdds addresses in order with duplicates or already \xe2\x80\xa60D`Returns the EndpointData with given filter applied.0CiCompletes the authorization protocol by notifying the \xe2\x80\xa6BlIf the connection is closed, the reason why.AlConservative estimate of RTTCaOnly trusts the explicitly set root certificates.0CcTotal number of DNS requests across all transports.AmSets the DNS resolver to use.CnSets the DNS resolver to use for resolving the pkarr relay \xe2\x80\xa60CiOptionally sets a custom DNS resolver to use for this \xe2\x80\xa6ClReturns the DNS resolver used in this Endpoint.DhCreate a DnsResolver configured to use the test DNS server.CnCreates a new user error from an arbitrary error type that \xe2\x80\xa6CjCreates a new user error from an arbitrary boxed error \xe2\x80\xa60BoRun HTTPS latency probes against relay servers.0CmAdds the provided configuration to the RelayMap.CiWhether this watcher is still connected to all of its \xe2\x80\xa6DdReturns true if the endpoint is connected to the relay.CnReturns the optional timestamp when this endpoint info was \xe2\x80\xa6BhThe number of packets lost on this path.BmThe number of packets lost on the connection.AkSocket to serve metrics on.BgThe network path of the candidate path.DgOptional interception point to handle the Accepting state.BoSee ProtocolHandler::on_accepting.CkThe number of network paths to peers that are user defined.CeThe number of network paths to peers that are direct.DhReturns a stream of PathList snapshots for this connection.BfReturns the timeout for the next ping.DiPolls for the next value, or returns Disconnected if one \xe2\x80\xa6BcNumber of incoming QAD connections.0D`Configures qlog capturing by setting a QlogFactory.CkAn advisory duration that the client should wait before \xe2\x80\xa6ChCreates a RelayConfig suitable for testing.DdRemoves the configuration from the RelayMap for the \xe2\x80\xa6BmNumber of full reports executed by net_reportC`Resolves a hostname from a URL to an IP address.0AmOptional segment size for GSOCkThe segment size if this transmission contains multiple \xe2\x80\xa6CkSend Quantum (bytes) used to control the size of packet \xe2\x80\xa6BcSet the priority of the send streamAiAdds an IP based address.0CkControls which endpoints may use the relay and observes \xe2\x80\xa6CfAddressLookup system for super::Endpoint.BdRenamed to CaTlsConfig.CmThe connection could not be created because not enough of \xe2\x80\xa60oBuild a Client.CbDetails about an incoming relay client connection.ChEndpointHooks intercept the connection establishment \xe2\x80\xa6BnThe stream finished before all bytes were readCcreceived an invalid Retry Token in a client InitialBeThe DNS name for the iroh TXT record.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6AmThe input has invalid length.0BkThe local application closed the connectionBeConfiguration for the metrics server.ChThe set of paths a PathSelector has chosen.CjResolver of address lookup information from a pkarr relay.CcHard NAT: QAD\xe2\x80\x99ed IPv4 address + local fixed port.CcBuilder to create one or more related qlog configs.BeThe relay\xe2\x80\x99s connection to a client.DcBuilder for creating a Router for accepting protocols.AnEnum of metrics for the moduleCgA test transport for use with TestNetwork.AhAvailable address types.0AmRecord data for a TXT record.0AaReturned from \xe2\x80\xa6CnAdds the relay URL to the end of the endpoint data, unless \xe2\x80\xa60CnReturns the local socket addresses on which the underlying \xe2\x80\xa6CjSets the trusted CA root certificates for non-iroh TLS \xe2\x80\xa6CdBuilds a ClientConfig from this config.0DbReturns the ConnectionId assigned to this connection.D`Returns the ConnectionId of the guarded connection.C`Create a custom sender for this custom endpoint.CaNumber of bytes to transmit from server to clientClSupport for handling DNS resource records for dialing by \xe2\x80\xa6DbReturns the EndpointInfo for the discovered endpoint.1CfAdds an external address on which this endpoint is \xe2\x80\xa6AmParses from big-endian bytes.AoNumber of HTTP requests served.AmGet the IncomingCnThe max_ack_delay we will request the peer to useBnSee AccessControl::on_disconnect.BeNotifies that a connection has ended.CkThe known MTU for the current network path has been updatedCjSets a custom PathSelector for this endpoint.BcCryptographic identity of the peer.BnUpdates the ping tracker with a received pong.DjConfigures qlog capturing through the QLOGDIR environment \xe2\x80\xa6BaReceives an application datagram.Abkeyed by relay UrlDjReturns a handle to the embedded RelayService for runtime \xe2\x80\xa6DgTransmits data as an unreliable, unordered application \xe2\x80\xa6CmWhether to implement fair queuing for send streams having \xe2\x80\xa6CaThe TLS server configuration for the QUIC server.CiCreates a ServerConfig suitable for testing.BmThe rustls::ServerConfig to use.CePrivate key used to authenticate data included in \xe2\x80\xa6CfSets the user-defined data and returns the updated \xe2\x80\xa60DiSplits the current datagram into at maximum num_segments \xe2\x80\xa6CaCreates a RelayMap from an iterator.0CgSets the IP based addresses and returns the updated \xe2\x80\xa60BgWrite timeout for the client connectionDbOptions for the Endpoint::connect_with_opts function.AgThe connection was lost0000BmCustom endpoint created by a CustomTransport.AkThe type of direct address.CeHandle and drop guard for test DNS and Pkarr servers.CcFuture returned from Endpoint::closed.Cithe endpoint encountered an internal error and cannot \xe2\x80\xa6CiFilter predicate used for early filtering of incoming \xe2\x80\xa6CcThe decoded data is not a valid Ed25591 public key.0BlConfiguration for the mainline DHT fallback.CiThe main underlying IO stream type used for the relay \xe2\x80\xa6ClConfigures the endpoint to use the n0 defaults, but with \xe2\x80\xa6Amno viable network path existsCmA stream of PathList snapshots for a connection.CiPublisher of address lookup information to a pkarr relay.Dgnoq types that are used in the public iroh API. Errors \xe2\x80\xa60BcVerification of a signature failed.0BkError returned when a staggered call fails.0CmThe peer violated the QUIC specification as understood by \xe2\x80\xa6Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6BeLookup the address of an Endpoint ID.CdAdds an additional Address Lookup for this endpoint.CbReturns the Address Lookup service, if configured.CcCreates an address lookup service for this network.DkAuthorizes a ClientRequest and completes the authorization \xe2\x80\xa6CgIntercept outgoing connections before they are started.0CjCaptivePortal is set when we think there\xe2\x80\x99s a captive \xe2\x80\xa6CdRemoves all direct addresses from the endpoint data.0CgTake the provided endpoint and run the client benchmarkBnCreate a client endpoint and client connection0BdReturn the encoded DNS packet bytes.C`Apply the given filter to the current addresses.0DiReturns a QlogConfig for a connection, if logging should \xe2\x80\xa6BjParameters negotiated during the handshake0BkParameters negotiated during the handshake.ClThe socket address on which the Relay HTTP server should \xe2\x80\xa6AiInitial congestion windowBnConverts this stream into an unordered stream.B`Get a key from a slice of bytes.DbTries to parse a ProtocolVersion from s.CiMaximum number of packets processed in a single write \xe2\x80\xa6ClMaximum time a write transaction stays open before it is \xe2\x80\xa6CnSpecifies the minimum MTU change to stop the MTU discovery \xe2\x80\xa6CaNotifies the system of potential network changes.AhOne packet was just lost0AhOne packet was just sent0CgSets the proxy url from the environment, in this order:BkConfigures qlog capturing into a directory.BeWhether to use the unordered read APIClMaximum number of bytes the peer may transmit across all \xe2\x80\xa6CkCompletes when the stream has been reset by the peer or \xe2\x80\xa60BbNumber of QUIC datagrams received.CeSaturating integer addition. Computes self + rhs, \xe2\x80\xa60ChSaturating integer subtraction. Computes self - rhs, \xe2\x80\xa6CeSets the network prefix length of the subnet this \xe2\x80\xa6BeIn-memory test transport for testing.CkMaximum reordering in time space before time based loss \xe2\x80\xa6CmConverts an endpoint ID to a custom address for this test \xe2\x80\xa6ChTries to convert this type to a SocketAddr.CkConverts into a list of {key}={value} strings.0CbNumber of FrameType::Unknown received0BeAdds a RelayUrl address.CiAdds the relay URL and returns the updated endpoint info.10CfSets the user-defined data and returns the updated \xe2\x80\xa6000CmHow many tokio worker threads to use for each endpoint in \xe2\x80\xa6BoShorthand for a type that implements both a \xe2\x80\xa6BdPer-client rate limit configuration.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6Dhnoq types that are used in the public iroh API. Reasons \xe2\x80\xa6DfTrait to track the state of a Connection at compile time.Dknoq types that are used in the public iroh API. Connection \xe2\x80\xa6AaCustom transport.CoMetrics collected by an crate::endpoint::Endpoint.CnMarker type for a connection that is in the incoming 0-RTT \xe2\x80\xa6DnError when deserialising a PublicKey or a SecretKey.0ClThe maximum size of a packet sent over relay. (This only \xe2\x80\xa6BkConfiguration for the net report component.0CnMarker type for a connection that is in the outgoing 0-RTT \xe2\x80\xa6CmA 'static stream of PathEvents.BaHandler for incoming connections.ClThe relay protocol version negotiated between client and \xe2\x80\xa6BkEnables writing qlog traces to a directory.BkRate limiting strategy for the HTTP server.CjConfiguration for speaking to the QUIC endpoint on the \xe2\x80\xa6C`The server frame type for the challenge responseCnAuthentication was performed by verifying a signature of a \xe2\x80\xa6AbServer task errorsDfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6CbThe peer doesn\xe2\x80\x99t implement any supported versionBgError when writing a frame to a client.CbThis was a 0-RTT stream and the server rejected it000CmIntercept both incoming and outgoing connections once the \xe2\x80\xa60BjIterate over all TXT records, yielding \xe2\x80\xa6BoRenamed to Builder::ca_tls_config.BhCurrent number of zones in the DHT cacheCfSpecify the rustls cryptography to use for all TLS \xe2\x80\xa6B`The remote endpoint to relay to.CoParses a EndpointInfo from DNS TXT lookup results.0CfThe socket address on which to serve the HTTPS server.ClSets a filter that decides whether to accept an incoming \xe2\x80\xa6CdMaximum number of incoming packets that may fail \xe2\x80\xa6AmA DNS server and pkarr relay.BnMax number of bytes to read in a single burst.BoSet the maximum number of TLS tickets to cache.CnProbe indicating the presence of port mapping protocols on \xe2\x80\xa6BhNumber of accepted QAD QUIC connections.0CmRun DNS and Pkarr servers on localhost with the specified \xe2\x80\xa6CiCreates a server endpoint which runs on the given runtime0ClSets the address filter applied before publishing to any \xe2\x80\xa6CcSets whether bind errors are fatal for this socket.BnObject to get current SystemTime.CfReturns this protocol version as an HTTP header value.ClSets an authorization token for all relays configured in \xe2\x80\xa6BkSets an authorization token for this relay.10AiAdds a single nameserver.CkCreates a new DNS resolver configured with a single UDP \xe2\x80\xa610CjCreates a new Memory Lookup instance with the provided \xe2\x80\xa6Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6BmA drop guard to clean up test infrastructure.BeMessages that clients send to relays.CbThe peer\xe2\x80\x99s QUIC stack aborted the connection \xe2\x80\xa63AfDNS endpoint discoveryDgA dyn-compatible version of AccessControl that returns \xe2\x80\xa6CaThe endpoint can no longer create new connectionsCnreceived a STREAM frame or a RESET_STREAM frame containing \xe2\x80\xa6CdError when handling an incoming frame from a client.A`key update errorAnEnum of metrics for the moduleDfA pkarr client to publish SignedPackets to a pkarr relay.ChConfiguration for the portmapper service (UPnP, PCP, \xe2\x80\xa6RelayConfig for Asia-PacificC`Get the default RelayConfig for EU.0CiReturns the default crypto provider, if enabled via a \xe2\x80\xa60C`Number of DNS lookups that failed with an error.C`Number of DNS requests received over UDP or TCP.CiCreate a signed packet containing TXT records under a \xe2\x80\xa6BgNumber of accepted HTTP(S) connections.0BhReturns whether this is a default route.CjWhether to use the Let\xe2\x80\x99s Encrypt production endpoint \xe2\x80\xa6CbResolves IPv4 and IPv6 in parallel with a timeout.0CnMaximum duration of inactivity to accept before timing out \xe2\x80\xa6CgReturn whether this packet is more recent than another.CmNumber of connections closed (only handshaked connections \xe2\x80\xa6CcThe number of connections that have been direct \xe2\x80\xa6CmNumber of connections opened (only handshaked connections \xe2\x80\xa6CiMaximum reordering in packet number space before FACK \xe2\x80\xa6B`Number of port mapping attempts.DhReturns the ProtocolVersion negotiated for this connection.BkProtocol version negotiated for this clientB`Reads the next segments of data.CgResolves a hostname from a URL to its IP addresses, \xe2\x80\xa60CiRuns a relay server with QUIC enabled suitable for tests.DdMaximum number of Incoming to allow to exist at a time.DgConverts into a EndpointAddr by cloning the needed fields.00CkReturn the relay payload (everything after the public key).DaSets a custom QuicTransportConfig for this endpoint.ClAdds additional root certificates to the list of trusted \xe2\x80\xa60AkAdds a list of nameservers.0DfWrites a slice of Bytes into this stream in its entirety.Cfthe application or application protocol caused the \xe2\x80\xa6BkHostname of the default Asia-Pacific relay.AnThe peer closed the connectionDfnoq_proto types that are used in the public iroh API. \xe2\x80\xa60BoThe default HTTP port used by the Relay server.0CgDefault TTL for the records in the pkarr signed packet.BaHostname of the default EU relay.0BmThe input string could not be decoded as hex.0Djnoq_proto types that are used in the public iroh API. The \xe2\x80\xa6BcThe given server name was malformedDjReports a connection\xe2\x80\x99s disconnect to AccessControl when \xe2\x80\xa6C`Data the selector sees about one candidate path.Dgnoq types that are used in the public iroh API. Errors \xe2\x80\xa6ClAuthentication was performed by verifying a signature of \xe2\x80\xa6CbThe transport ID used by TestNetwork.BfAddress of a remote with some metadataCcThe peer does not support receiving datagram framesCnBurst limit for accepting new connection. Unlimited if not \xe2\x80\xa6CmRate limit for accepting new connection. Unlimited if not \xe2\x80\xa6CjAugments endpoint addressing information for the given \xe2\x80\xa6CfAdds an external address on which this endpoint is \xe2\x80\xa6CkClears the address filter, allowing all addresses to be \xe2\x80\xa6BdCongestion events on the connection.AiCongestion window (bytes)D`Starts a connection attempt with a remote Endpoint.BfGet the default RelayMap.0BkInterval between runs of the eviction task.CiReturns endpoint addressing information for the given \xe2\x80\xa6AoHandle the incoming connection.DdReturns a Watcher over the connection status of the \xe2\x80\xa6CmComputes the maximum size of datagrams that may be passed \xe2\x80\xa6AjConfigures the net report.CgConfigures the portmapper service (UPnP, PCP, NAT-PMP).BkFrameType::SendPacket received0BgFrameType::SendPacket sent0CfSets endpoint addressing information for the given \xe2\x80\xa6BfSets a custom TLS verification config.0AiSets a custom TLS config.CgA watcher for local addresses for this custom endpoint.DgWrites Bytes from a slice of buffers into this stream, \xe2\x80\xa6Cmthe endpoint has reached the confidentiality or integrity \xe2\x80\xa6Dknoq types that are used in the public iroh API. Parameters \xe2\x80\xa6CdThe HTTP header name for relay client authenticationBmthe server refused to accept a new connectionC`The default HTTPS port used by the Relay server.0DiA dyn-compatible version of ProtocolHandler that returns \xe2\x80\xa6Ckreceived more data than permitted in advertised data limitsCjError returned when forwarding a packet to a client fails.CgMarker type for a connection that has completed the \xe2\x80\xa6BdThe local address of a network path.8CjThe maximum amount of time, in seconds, the net_report \xe2\x80\xa6Ckdetected an error with protocol compliance that was not \xe2\x80\xa6CmCan occur when parsing a string into a RelayUrl.0Cjreceived a frame for a stream identifier that exceeded \xe2\x80\xa6Cnreceived a frame for a stream that was not in a state that \xe2\x80\xa6CeThe server frame type for authentication confirmationBlInformation how a transport address is used.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6ChThe local endpoint does not support the QUIC version \xe2\x80\xa61CiMaximum quantity of out-of-order crypto layer data to \xe2\x80\xa6AoReturns the default relay mode.ChNumber of DNS lookups that returned at least one answer.CaNumber of DNS requests received over HTTPS (DoH).DeCreates a guard for the connection described by request.CiCreates a Memory Lookup instance from endpoint addresses.CkCreate from a public key and relay payload (signature + \xe2\x80\xa6C`Create a VarInt without ensuring it\xe2\x80\x99s in rangeCfThe number of times holepunching is initiated on a \xe2\x80\xa6BjConverts into a EndpointAddr.CjConverts into a EndpointAddr without cloning.1CbTrue if this sender can send to the given address.BnSet the capacity of the cache for public keys.AcKey cache capacity.CaPackets of other FrameTypes received0BmPackets of other FrameTypes sent0CmNumber of pkarr relay puts that did not change the stored \xe2\x80\xa6CfNumber of QAD QUIC connections that aborted before \xe2\x80\xa60BfNumber of datagrams received using GRODiBuilds a ResolvesServerCert that reloads its certificate \xe2\x80\xa6CcThe EndpointId of the original sender.CnSets the interval after which packets are republished even \xe2\x80\xa6DgTransmits data as an unreliable, unordered application \xe2\x80\xa6ClSee noq_proto::TransportConfig::receive_window.BdNumber of unique client keys per day0CiOverride the instant relative to which all events are \xe2\x80\xa6B`ALPN for our quic addr discoveryBaAddressLookup errorsC`Parameters governing the core QUIC state machineBjA builder for a ServerConfig.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6Dinoq types that are used in the public iroh API. A stream \xe2\x80\xa6C`Returns all supported protocol versions in a \xe2\x80\xa6CbBinds an IP socket at the provided socket address.CjSpecifies the amount of time that MTU discovery should \xe2\x80\xa6B`Removes all IP based transports.BoNumber of DNS lookups that returned no answers.DaReturns true if the use of staging relays is forced.CgWaits until the full handshake occurs and returns a \xe2\x80\xa6ClWaits until the full handshake occurs and then returns a \xe2\x80\xa6CjNumber of HTTP requests that returned a non-2xx status \xe2\x80\xa6DbTurns this builder into a ready-to-use AddressLookup.ChPeriod of inactivity before sending a keep-alive packet.C`Contact email address passed to Let\xe2\x80\x99s Encrypt.CfThe number of PLPMTUD probe packets lost on this path.BlPackets were deemed lost or marked congestedCfThe number of PLPMTUD probe packets sent on this path.ClReturns a stream which will yield the most recent values \xe2\x80\xa6DjTrait for structs that can be converted into AddressLookup\xe2\x80\xa6CeOutcome of EndpointHooks::before_connectCbThe default metrics port used by the Relay server.0BlPacket size exceeds the maximum allowed sizeCgThis trait allows anything that ends up potentially \xe2\x80\xa6Bireceived a frame that was badly formattedC`The input string could not be decoded as base32.0CiThe remote SocketAddr supplied was malformedCbState of the endpoint relevant for path selection.BgBuilder for PkarrResolver.ClMaximum time the server will attempt to get a successful \xe2\x80\xa6BeErrors when attempting to upgrade andDfnoq types that are used in the public iroh API. Error \xe2\x80\xa6BkA weak handle to a Connection.DkSpecifies the ACK frequency config (see AckFrequencyConfig \xe2\x80\xa6AgAdds a custom transportCjThe number of times a black hole was detected in the path.CkCheck for captive portals when generating the first report.0CeRemoves all Address Lookup services from the builder.CfParse a signed packet without verifying the signature.CjReconstruct a signed packet from its raw parts without \xe2\x80\xa6CcINSECURE: Do not verify server certificates at all.0DkSpecifies the MTU discovery config (see MtuDiscoveryConfig \xe2\x80\xa6CjNumber of pkarr relay puts that updated the stored packet.CgRate limit applied to PUT /pkarr requests.CmRemoves all endpoint addressing information for the given \xe2\x80\xa6DjRemoves a configured external address. Returns true if it \xe2\x80\xa6ChThe reordering threshold we will request the peer to useBjFrameType::SendPacket dropped0CjBuilds a ServerCertVerifier from this config.0BeSets whether this is a default route.BoSets a custom QuicTransportConfig.ClPublishes the addressing information about this endpoint \xe2\x80\xa6CeMakes the builder respect the host system\xe2\x80\x99s DNS \xe2\x80\xa60DbRegistry for address lookup services for an Endpoint.CfOutcome of EndpointHooks::after_handshakeCg32B dest pub key + ECN bytes + one datagram\xe2\x80\x99s contentDgAn AddressLookup wrapper that filters addresses before \xe2\x80\xa6DfVerdict from a IncomingFilter for an incoming connection.BjNo default client configuration was set upBiPath abandoned due to unstable interfacesBhBuilder for PkarrPublisher.Cf32B src pub key + ECN bytes + one datagram\xe2\x80\x99s contentCjError generated when failed to parse an ED25519 signature.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6CmMaximum number of packets that may be sent using a single \xe2\x80\xa6CeGet the default RelayConfig for NA east.0CeGet the default RelayConfig for NA west.ChNumber of HTTP requests that returned a 2xx status code.DgLooks up endpoint info by EndpointId and origin domain \xe2\x80\xa60CiPerforms an IPv4 lookup with a timeout in a staggered \xe2\x80\xa60CiPerforms an IPv6 lookup with a timeout in a staggered \xe2\x80\xa60BmMaximum number of segments to transmit (GSO).0BhStarts a new ping with a custom timeout.C`Packets of other FrameTypes dropped0CfWhether the socket address that is initiating this \xe2\x80\xa6AdRuns a relay server.CbBuilder for the rustls::ServerConfig.CfNumber of signed packets removed by the eviction task.C`Number of signed packets removed from the store.CmNumber of times an existing signed packet was replaced by \xe2\x80\xa6CiMaximum number of bytes the peer may transmit without \xe2\x80\xa6CnSets ALPN identifiers that should be signaled as supported \xe2\x80\xa6CkSets the QUIC transport config options for this connection.Chreceived more data in CRYPTO frames than can be bufferedCmServer connection errors, includes errors that can happen \xe2\x80\xa6CaMaximum total size of a serialized signed packet.DkError returned when an input value is too long for UserData\xe2\x80\xa60BaHostname of the default NA relay.BfHostname of the default NA east relay.BfHostname of the default NA west relay.CmCombines RelayService with a notification token.AoError building a signed packet.BcRemoves all relay based transports.CkNumber of times a client was moved into the inactive state.0ChDerives keying material from this connection\xe2\x80\x99s TLS \xe2\x80\xa6CkIf this type ends up wrapping a TLS stream, then this triesClWhether the reported public address differs when probing \xe2\x80\xa6CjNumber of QAD QUIC connections that disconnected after \xe2\x80\xa60CgNumber of signed packets newly inserted into the store.BkCreates a pkarr::SignedPacket.0BhFailed to deserialize client auth headerClThe default QUIC port used by the Relay server to accept \xe2\x80\xa60BjBuilder for DnsAddressLookup.BkThe production pkarr relay run by number 0.BoA builder for the PkarrRelayClientClAnother endpoint connected with the same endpoint id. No \xe2\x80\xa6B`Error verifying a signed packet.CkThe ack-eliciting threshold we will request the peer to useCgSets a callback hinting whether to prefer IPv6 when \xe2\x80\xa6BiNumber of terminated HTTP(S) connections.0CbThe peer\xe2\x80\x99s ACK-frequency parameters have changed0==BmPath abandoned at the application\xe2\x80\x99s requestChEnvironment variable to force the use of staging relays.ClThis represents successful authentication for the client \xe2\x80\xa6CjNumber of times a client was removed from the inactive \xe2\x80\xa60DkParses a EndpointInfo from a pkarr::SignedPacket.0CiNumber of HTTP(S) connections that terminated with an \xe2\x80\xa60CgMaximum number of received bytes to buffer for each \xe2\x80\xa6ClDuration after a retry token was issued for which it\xe2\x80\x99s \xe2\x80\xa6CjReturns the path to the signed-packet store database file.BdNumber of IP transport paths opened.BhAddressLookupBuilder errorsCmthe number of connection IDs provided by the peer exceeds \xe2\x80\xa6Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6CjA QUIC connection on the server-side that can possibly \xe2\x80\xa6CmPath abandoned due to no available connection IDs for the \xe2\x80\xa6BfThe client side of a 0-RTT connection.AiEndpoint close error codeCnFunction to build a ServerCertVerifier from a \xe2\x80\xa6Clreceived transport parameters that were badly formatted, \xe2\x80\xa6ClMaximum number of outgoing application datagram bytes to \xe2\x80\xa6CjCumulative duration of all HTTP requests, in milliseconds.Cn32B dest pub key + ECN byte + segment size u16 + datagrams \xe2\x80\xa6CkThe default capacity of the key cache for the relay server.ClInterval in which to republish the endpoint info even if \xe2\x80\xa6BhThe testing pkarr relay run by number 0.BoBuilder for a QuicTransportConfig.Cm32B src pub key + ECN byte + segment size u16 + datagrams \xe2\x80\xa6CnNumber of bytes received from client connection which have \xe2\x80\xa60CjNumber of client connections which have had any frames \xe2\x80\xa60C`Bytes available in the outgoing datagram buffer.CeRaces an IPv4 and IPv6 lookup with a timeout in a \xe2\x80\xa60DaVariant of max_concurrent_bidi_streams affecting \xe2\x80\xa6BmSpurious congestion events on the connection.BdNumber of IP transport paths closed.CaThe n0 address lookup DNS origin, for production.00CkPath abandoned due to resource limitations in the transportCeThe number of packets buffered for sending per clientAeEndpoint close reasonDgCreates a CaTlsConfig that uses a callback function to \xe2\x80\xa60ChWhether to use \xe2\x80\x9cGeneric Segmentation Offload\xe2\x80\x9d to \xe2\x80\xa6ClWhether the reported public address differs when probing \xe2\x80\xa60CmMaximum number of incoming bidirectional streams that may \xe2\x80\xa6CaSets a custom ValidationTokenConfig.BgNumber of relay transport paths opened.BhThe default certificate reload interval.DdCreate a ServerConfigBuilder for this endpoint that \xe2\x80\xa6ClMaximum number of incoming application datagram bytes to \xe2\x80\xa6CkCreates a client config that trusts any servers without \xe2\x80\xa6BdPackets were incorrectly deemed lost0CaRuns a relay server with a custom access control.BhNumber of custom transport paths opened.CiSets the initial user-defined data to be published in \xe2\x80\xa6CjHow to construct new congestion::Controllers.BmSets a default per-path maximum idle timeout.CbWhether to send observed address reports to peers.ClModifies the number of bidirectional streams that may be \xe2\x80\xa6BgNumber of relay transport paths closed.BnThe n0 address lookup DNS origin, for testing.00BcLooks up endpoint info by DNS name.0BiEnables the Multipath Extension for QUIC.DhMaximum number of received bytes to buffer for all IncomingCmModifies the number of unidirectional streams that may be \xe2\x80\xa6BhNumber of custom transport paths closed.CiError returned when the relay protocol version is not \xe2\x80\xa6DgLooks up endpoint info by EndpointId and origin domain \xe2\x80\xa60CeNumber of consecutive PTOs after which network is \xe2\x80\xa6BlSets a default per-path keep alive interval.CmNumber of times an external address was obtained via port \xe2\x80\xa6CjWhether to receive observed address reports from other \xe2\x80\xa6DiCreates a rustls::ServerConfig and certificates suitable \xe2\x80\xa6CiSets the initial user-defined data to be published in \xe2\x80\xa6CkSets the maximum number of nat traversal addresses this \xe2\x80\xa6AcNat traversal draftCjLooks up endpoint info by DNS name in a staggered fashion.0") \ No newline at end of file diff --git a/pr/4036/docs/search.index/desc/0cf9cd5c86e7.js b/pr/4036/docs/search.index/desc/0cf9cd5c86e7.js new file mode 100644 index 0000000000..951187cb1a --- /dev/null +++ b/pr/4036/docs/search.index/desc/0cf9cd5c86e7.js @@ -0,0 +1 @@ +rd_("AmData flows in both directionsAdAn IP based address.BdThe local IP, if the OS surfaced it.BgA direct connection from an IP address.CkAn IP address, should always be stored in its canonical \xe2\x80\xa63BnConfigures the endpoint to use the n0 defaultsAjContains the success valueChVersion 1 (the only version supported until iroh 0.98.0)B`Version 2 (added in iroh 0.98.0)AlThe endpoint\xe2\x80\x99s identifier.AoGet the identity of this stream00BiReturns the path\xe2\x80\x99s PathId.BcReturns the remote\xe2\x80\x99s endpoint id.BiReturns the endpoint id of this endpoint.A`Path identifier.0BkPath identifier of the newly selected path.AiReturns the transport id.7CiReturns a watcher that updates every time this or the \xe2\x80\xa6CkAll supported protocol versions, in order of preference \xe2\x80\xa6Djnoq types that are used in the public iroh API. Whether a \xe2\x80\xa6B`Error type on failed conversion.AhContains the error valueAoThe largest representable valueAlThe maximum path ID allowed.BkPublic internet address discovered via QAD.lDNS over TCP0lDNS over TLS0C`A Tls wrapped tokio::net::TcpStreamlDNS over UDP0BmData flows only from the stream\xe2\x80\x99s initiatorBkAdds an AddressLookup service.CiReturns an iterator of all supported protocol version \xe2\x80\xa6AnWhich directions data flows inAjConfigurable DNS resolver.AoDNS endpoint discovery for iroh1BcConfiguration for the DNS listener.BeExplicit congestion notification bitsClUpdates the watcher to the latest value and returns that \xe2\x80\xa6AoReturns the config for a relay.CdReturns the path with the given PathId.B`The current best RTT estimation.2BfThe number of I/O operations executed.BoReturns the number of relays in this relay map.BjReturns the number of services configured.BaReturns the number of open paths.2BbSet a custom TokenLogCiMaps this watcher with a function that transforms the \xe2\x80\xa6CaMinimum RTT registered so far for this estimator.DhCreates a new EndpointAddr with no network level addresses.C`Creates a new SignatureError error.CdCreates a new RelayUrlParseError error.ClCreates a new relay configuration with the given URL and \xe2\x80\xa6DhCreates a new EndpointData with given list of transport \xe2\x80\xa6BdCreate a new AddrFilterE`Creates a new EndpointInfo with an empty EndpointData.BoWraps an address lookup with an address filter.BgCreates a new Error error.DaCreates a new Item from a EndpointInfo.BkCreates a new empty Memory Lookup instance.BhCreates a PkarrRelayClient.DiCreates a new QlogConfig that writes a qlog trace to the \xe2\x80\xa6CiCreates a new qlog factory that writes files into the \xe2\x80\xa6BlCreates a new RetryError error.CgCreates a new RemoteEndpointIdError error.DgCreates a new Builder using the given Preset.BcInitializes new connection options.BkConstruct an error with a code and a reasonAeCreate a new StreamIdDjCreates a new RecvInfo for an incoming packet on a custom \xe2\x80\xa6CoCreates a new router builder using given Endpoint.C`Creates a new StaggeredError error.CkCreates a new DNS resolver with sensible cross-platform \xe2\x80\xa6ChCreates a new MaxLengthExceededError error.DjCreates a new QlogFileGroup that writes qlog files to the \xe2\x80\xa6BaCreates a new empty test network.DhCreates a new EndpointAddr with no network level addresses.CgCreates a new SignatureParsingError error.C`Creates a new SignatureError error.CdCreates a new RelayUrlParseError error.87DhCreates a new EndpointData with given list of transport \xe2\x80\xa6BdCreate a new AddrFilter8E`Creates a new EndpointInfo with an empty EndpointData.DdCreates a new DnsConfig with the given required fields.BoCreate a new key cache with the given capacity.CjCreates a new ping tracker with the given maximum ping \xe2\x80\xa6ClCreates a new relay configuration with the given URL and \xe2\x80\xa6CkCreates a new QUIC address discovery configuration with \xe2\x80\xa6BgCreate a new ClientBuilderEdCreates a new RelayConfig bound to http_bind_addr with \xe2\x80\xa6EeCreates a new ClientRequest from an EndpointId and HTTP \xe2\x80\xa6DfCreates a new QuicConfig bound to bind_addr.DhCreates a new TlsConfig with the given bind address and \xe2\x80\xa6DdCreates a new ClientRateLimit with the given byte rate.D`Creates a new AcmeConfig with a ACME directory URL.CiCreates a new config with sensible default values for \xe2\x80\xa6CdCreates a new ForwardPacketError error.ClCreates a new RelayedStream from an inner stream and key \xe2\x80\xa6DkCreates a new bucket starting full at max tokens, refilled \xe2\x80\xa6CeCreates a new InvalidBucketConfig error.DmCreates a new TlsConfig from a rustls ServerConfig.AkCreates a new RelayService.BoCreates a new service wrapper for a connection.DaCreates a new UnsupportedRelayProtocolVersion error.CmCreate a new QuicClient to handle the client side of QUIC \xe2\x80\xa6CkGet SystemTime::now() or the mocked equivalentBgReturns a strictly monotonic timestamp.BnReturns the path\xe2\x80\x99s round-trip time estimate.ChCurrent best estimate of this connection\xe2\x80\x99s latency \xe2\x80\xa60BgRun DNS and Pkarr servers on localhost.BcSets the path as the selected path.AkTLS configuration for iroh.CgTLS verification configuration for iroh and iroh-relay.BgTLS configuration for the HTTPS server.CbSets the TTL (time-to-live) for published packets.BbThe origin of this direct address.C`Returns this frame\xe2\x80\x99s corresponding frame type.CmReturns the URI of the HTTP request with which the client \xe2\x80\xa6D`The RelayUrl where this relay server can be dialed.BbReturns the URL of the home relay.AeThe URL of the relay.2AcTransports address.CjState-specific data stored in the Connection.AaAccess is denied.A`An IPv4 address.A`An IPv6 address.ChAddress lookup results from AddressLookups.Dhnoq_proto types that are used in the public iroh API. A \xe2\x80\xa6CfA single path within a PathList snapshot.Dk8 byte ping payload, to be echoed back in a FrameType::Pong\xe2\x80\xa6ClRequest from the relay to reply to the other side with a \xe2\x80\xa6CiRequest from the client to the server to reply to the \xe2\x80\xa6Ce8 byte payload, the contents of ping being replied toDiReply to a ClientToRelayMsg::Ping from a client with the \xe2\x80\xa6DiReply to a RelayToClientMsg::Ping from a server with the \xe2\x80\xa6B`An error occurred during readingDknoq types that are used in the public iroh API. Whether an \xe2\x80\xa6nThe 0 path id.BgReturns the TransportAddr.DjReturns the current EndpointAddr. As long as the endpoint \xe2\x80\xa6lThe address.CjExtracts the ALPN protocol from the peer\xe2\x80\x99s handshake \xe2\x80\xa60000AcBinds the endpoint.EeConstructs a default Endpoint using the provided Preset \xe2\x80\xa6AhCreate a custom endpointCgBinds and spawns the server from a Config.AhMode for getting a cert.mType of errorBlCurrent congestion window of the connection.BmThe information published about the endpoint.0CcReturns the opaque address data for this transport.1AoReturns the argument unchanged.00000000CmCreates a RelayMap from a RelayUrl.111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111111111111111111111111111111111111111111111111111111111111BdConfiguration for the HTTP listener.ChHTTP-specific constants for the relay server and client.BaCalls U::from(self).0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AnPeer-to-peer QUIC connections.BhReturns an iterator over the open paths.C`Returns an iterator over all encountered errors.ClReturns an iterator over the character strings contained \xe2\x80\xa610BgWaits for the server tasks to complete.CcWaits for the server\xe2\x80\x99s supervisor task to finish.DbLoads a Config from a TOML file at path.AkCaptured call-site metadata000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AcAn empty selection.CoMethod for opening a sealed message data in-place.ClReturns a reference to the value currently stored in the \xe2\x80\xa6CgPort to bind the DNS listener to, for both UDP and TCP.BbPort to bind the HTTP listener to.BcPort to bind the HTTPS listener to.CdThe port on which the connection should be bound to.AiProduction configuration.ClConfiguration to speak to the QUIC endpoint on the relay \xe2\x80\xa6CjCreate a QUIC server that accepts connections for QUIC \xe2\x80\xa61DaConfiguration for the QUIC server, disabled if None.BgRead data contiguously from the stream.CcDecode TransportParameters from bufferClOptional A record to serve at each origin apex.BdMethod for sealing a token in-place.CmNumber of address validation tokens sent to a client when \xe2\x80\xa6CfReturns the side of the connection (client or server).CeSign the given message and return a digital signature0BiThe size of the packet that was too largeAcStop accepting data0CbReturns the URLs of all servers in this relay map.0AbAccess is allowed.Dhnoq_proto types that are used in the public iroh API. A \xe2\x80\xa6CkAn empty preset that doesn\xe2\x80\x99t set anything on the builder.CmError returned by address lookup services when failing to \xe2\x80\xa6AkQuic client related errors.AeProtocol send errors.nDNS over HTTPS0AoA locally bound socket address.CbA plain non-Tls tokio::net::TcpStreamBiError decoding the relay protocol messageAgA relay server address.CdThe relay over which this network path is connected.AiA connection via a relay.A`A relay address.03CcThe peer abandoned transmitting data on this streamCnThe peer is unable to continue processing this connection, \xe2\x80\xa6DdTell the remote to retry with a token (a QUIC RETRY \xe2\x80\xa6CnRate limits by the client IP, extracted from reverse-proxy \xe2\x80\xa6BbThe type of value that can change.AkThe endpoint\xe2\x80\x99s addresses.BmReturns the full list of all known addresses.BgReturns the transport addr information.CiReturns an iterator over known all addresses for this \xe2\x80\xa6321CmBest-effort extraction of the ALPN protocols from the TLS \xe2\x80\xa6CmSets the ALPN protocols that this endpoint will accept on \xe2\x80\xa6ChApply the address filter function to a set of addresses.D`Applies the configuration to the passed in Builder.1E`Builds a DnsAddressLookup with the passed DnsResolver.DiBuilds the PkarrPublisher with the passed secret key for \xe2\x80\xa6CgCreates a PkarrResolver from this builder.BfBuild a PkarrRelayClient.BiConstruct a fresh ControllerCjBuild a QuicTransportConfig from the builder.DjBuild a ServerConfig from a ServerConfigBuilder.AhBuilds the DNS resolver.0AiThe contents of the chunkCiThe total amount of bytes which have been transferred \xe2\x80\xa6B`Removes all configured services.BbCloses the connection immediately.BhCloses the QUIC endpoint and the socket.AkCreates an empty relay map.CmCreates an empty builder with no address lookup services, \xe2\x80\xa61CcCreates a no-op guard for endpoint_id.BcFrame type that triggered the errorC`Reports the disconnect once the connection ends.B`Install hooks onto the endpoint.BeConfiguration for the HTTPS listener.CcDistinguishes streams of the same initiator and \xe2\x80\xa6BhWhether this is an IP transport address.CfReturns true if this is a direct IP path.1CeReturns the currently open network paths for this \xe2\x80\xa6AnIterator over candidate paths.CjAn address lookup service which publishes and resolves \xe2\x80\xa6AmPkarr signed packet encoding.DbConfiguration for the Relay server, disabled if None.CgThis module implements the send/recv relaying protocol.BbClose the send stream immediately.DiReturns a freshly-built resolver to replace self after a \xe2\x80\xa6CeReplaces the inner resolver with a freshly-built one.10AmResponds with a retry packet.CmOptional NS record to serve at each origin apex.CdSpawns an accept loop and returns a handle to it \xe2\x80\xa6AbStarts the server.BkSplits the client into a sink and a stream.B`Returns the path\xe2\x80\x99s statistics.AnReturns connection statistics.CgAggregate connection statistics at the moment of close.BeReturns path statistics if available.CeShow connection stats the at the end of the benchmarkBcTitle to record in the qlog captureBmReturns information how this address is used.CmWrite a buffer into this stream, returning how many bytes \xe2\x80\xa6CcEncode TransportParameters into bufferAkAccept the connect attempt.AfAccept the connection.0CaFuture produced by Endpoint::accept.BcAccess restriction for an endpoint.AmThe address is in active use.BfA token bucket used for rate-limiting.AmThe initiator of a connectionoA relay client.AjA network path was closed.Dknoq types that are used in the public iroh API. State of a \xe2\x80\xa6CbAn address explicitly provided by the user via \xe2\x80\xa6BgTop-level configuration for the server.BfConfiguration for a client connection.AhCustom transport addressCgThe local custom address, if the transport reports one.BdA connection via a custom transport.AgUse a custom relay map.AkA custom transport address.BmA custom transport address with the given id.5DgREMOVED since relay-protocol-v2, use Self::Status instead.CkRemoved since relay-protocol-v2: A one-way message from \xe2\x80\xa6CfIgnore the connection entirely. The remote gets no \xe2\x80\xa6CjThe length of an ed25519 PublicKey, in bytes.CjThe length of an ed25519 Signature, in bytes.10ChEvents were dropped before the subscriber received them.lRate limits.DcLoad pre-existing certificates from the cert_cache \xe2\x80\xa6CiUse a TLS key and certificate chain that can be reloaded.Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6AnA new network path was opened.Dinoq_proto types that are used in the public iroh API. Id \xe2\x80\xa6DaA reusable bundle of endpoint Builder configuration.AkReject the connect attempt.B`Reject and close the connection.CmActively refuse the connection. The remote will receive a \xe2\x80\xa6AaThe built router.AlThe acceptor of a connectionAjA running iroh-dns server.AmA running Relay + QAD server.CbRate limits by the connection\xe2\x80\x99s peer IP address.ChSent from server to client to declare the connection \xe2\x80\xa6CiA one-way message from relay to client, declaring the \xe2\x80\xa6CkOne-way message from server to client indicating issues \xe2\x80\xa6Dknoq types that are used in the public iroh API. An integer \xe2\x80\xa6CmAttempts to accept this incoming connection (an error may \xe2\x80\xa6BbReturns Self::Accept.BoAccepts an incoming connection on the endpoint.AnHandle an incoming connection.BiSee ProtocolHandler::accept.DiConfigures the router to accept the ProtocolHandler when \xe2\x80\xa6BhAccess control for incoming connections.AgCreate and run a client0DkExposes Client, which allows to establish connections to a \xe2\x80\xa6CgThe server-side representation of an ongoing client \xe2\x80\xa6CeWaits for the connection to be closed for any reason.CjReturns a future that resolves once the connection has \xe2\x80\xa6ChReturns a future that resolves once the endpoint closes.EhCommon types between the super::handshake and super::relay \xe2\x80\xa6BjConfiguration for the Server.DhCreates a QuicTransportConfig that emits qlog files, if \xe2\x80\xa6BjCreate QUIC error code from TLS alert codeBkAn underlying crypto (e.g. TLS) layer errorBkRenamed to Self::custom_roots.DaCreate a custom relay mode from a list of RelayUrls.DhCreates a new DnsResolver from a struct that implements \xe2\x80\xa602CdExtends this RelayMap with another one.0CmNotify the peer that no more data will ever be written to \xe2\x80\xa6AfHeader protection keysCmIgnores this incoming connection attempt, not sending any \xe2\x80\xa6BgInserts a new relay into the relay map.0CfEnables saving the TLS pre-master key for connections.lRate limits.CfAn in-memory address lookup system to manually add \xe2\x80\xa6ChNumber of events dropped since the last delivered event.DeCreates a new DNS address lookup using the iroh.link \xe2\x80\xa6CkCreates a pkarr publisher which uses the number 0 pkarr \xe2\x80\xa6ClCreates a pkarr resolver builder which uses the number 0 \xe2\x80\xa6AhThe offset in the streamB`Packet deliveries were confirmed0CjA convenience method that waits for the endpoint to be \xe2\x80\xa6AfPacket protection keysBfApplies the given Preset.DkReturns a Preset to apply the DNS address lookup and Pkarr \xe2\x80\xa6B`Protocols used by the iroh-relayBnThe public key of this SecretKey.0BeThe reason the connection was closed.BcHuman-readable reason for the close0BhHuman-readable explanation of the reasonCeClose reason to send with the connection close frame.CfOptional reason for denial to send back to the client.BiRejects this incoming connection attempt.BbReturns Self::Reject.DkReturns a list with the RelayConfig for each relay in this \xe2\x80\xa60BeRemoves an existing relay by its URL.0CnPick the selected path to carry application data among the \xe2\x80\xa6BmTake the provided endpoint and run the server0CeA fully-fledged iroh-relay server over HTTP or HTTPS.BeMetrics tracked for the relay server.BmMetrics collected by the endpoint\xe2\x80\x99s socket.C`Private source type, cannot be created publicly.0AkThe protocol decoding errorAkThe underlying stream error0ClReturns a stream which will yield the most recent values \xe2\x80\xa6AmThe relayed stream connectionClUses the operating system\xe2\x80\x99s certificate facilities for \xe2\x80\xa60BoReturns the protocol version identifier string.BbSerializes to the binary encoding.CmEncodes this key in z-base-32, the encoding used by pkarr \xe2\x80\xa60CkStatistics about datagrams and bytes received on this path.CjStatistics about UDP datagrams received on the connection.CgStatistics about datagrams and bytes sent on this path.CeStatistics about UDP datagrams transmitted on the \xe2\x80\xa6B`A QAD IPv4 round trip completed.B`A QAD IPv6 round trip completed.CgUpdates the watcher to the latest value and returns \xe2\x80\xa6CeVerify a signature on a message with this public key.0CcNumber of ack-eliciting bytes that may be in flightAeBoxed iterator alias.0BbBuilder for Endpoint.BeBuilder for DnsResolver.0BdRegistry of connected relay clients.ClUse the default relay map, with production relay servers \xe2\x80\xa6BiEnable portmapping with default settings.CiThe connection is healthy and recovered from previous \xe2\x80\xa6BdCounters exposed by iroh-dns-server.BdMetrics tracked for the relay serverClA preset that is almost empty, besides setting mandatory \xe2\x80\xa6Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6BfUse the staging relay servers from n0.CcThe peer is no longer accepting data on this streamCaThe stream is larger than the user-supplied limitAdNot yet determined..CjPlaceholder for backwards-compatibility for future new \xe2\x80\xa6CkA handle to a value that\xe2\x80\x99s represented by one or more \xe2\x80\xa6CfNumber of times this server has accepted a connection.0DbCreates a DnsAddressLookupBuilder that implements \xe2\x80\xa6DhReturns a PkarrPublisherBuilder that publishes endpoint \xe2\x80\xa6ChCreates a new resolver builder using the pkarr relay \xe2\x80\xa6DiReturns a default QuicTransportConfigBuilder that allows \xe2\x80\xa6EhReturns the builder for an Endpoint, with the given Preset \xe2\x80\xa6DdCreates a new Router using given Endpoint.CmCreates a builder to construct a DNS resolver with custom \xe2\x80\xa60CcThe total number of clients which should be createdCaThe \xe2\x80\x9cServer\xe2\x80\x9d side of the client. Uses the \xe2\x80\xa6CnReturns a reference to the registry of currently connected \xe2\x80\xa6BkConnects to a remote Endpoint.CaEstablishes a new connection to the relay server.CnAttempts to consume bytes tokens from the bucket.BlProvides a list of contacts for the account.CkThe path currently considered the preferred path to the \xe2\x80\xa6CgDecrypt the packet payload with the given packet numberBcDecrypt the given packet\xe2\x80\x99s headerBdDecrypts the Initial packet payload.ChDomains for which TLS certificates are issued or loaded.CnProvides the list of domains for which certificates should \xe2\x80\xa6D`Enables the mainline DHT fallback when set to true.CgEncrypt the packet payload with the given packet numberBcEncrypt the given packet\xe2\x80\x99s headerBnDo we have any indication that UDP is working?CjReturns the headers of the HTTP request with which the \xe2\x80\xa6AnOnly keep direct IP addresses.0CbCheck if this stream has been opened during 0-RTT.0BkCo-locating all of the iroh metrics structsCmRetrieve implementation-specific metrics used to populate \xe2\x80\xa60BlReturns metrics collected for this endpoint.CgShow iroh library counter metrics at the end of the \xe2\x80\xa6CaReturns the Metrics for this server.BeConfiguration for the metrics server.CbReturns the metrics collected in the relay server.CnThe maximum UDP payload size guaranteed to be supported by \xe2\x80\xa6CnCreates a minimal configuration that disables all optional \xe2\x80\xa6BbOne or more packets were just sent0BnInitiates a new outgoing bidirectional stream.CiOrigins under which the server publishes pkarr-signed \xe2\x80\xa6ChPresets allow configuring an endpoint quickly with a \xe2\x80\xa6BoDescription of why the connection is unhealthy.DgPublishes the given EndpointData to the Address Lookup \xe2\x80\xa6BfPublishes a SignedPacket.ClNumber of reports executed by net_report, including full \xe2\x80\xa6DeResolves the Item for the given EndpointId.DfResolves the addressing information for an EndpointId \xe2\x80\xa6DkResolves a SignedPacket for the given EndpointId.CoOptional AAAA record to serve at each origin apex.AfStaging configuration.CiCompletes when the peer stops the stream or reads the \xe2\x80\xa6CcThe total number of streams which should be createdCjStreams used in the server-side implementation of iroh \xe2\x80\xa6ClImplements logic for abstracting over a websocket stream \xe2\x80\xa6CeThe length of the AEAD tag appended to packets on \xe2\x80\xa6ClExposes functions to quickly configure a server suitable \xe2\x80\xa6BgCancel-safe waiting for a ping timeout.CgAn advisory duration for how long the client should \xe2\x80\xa6DfReturns a future completing with Ok(value) once a new \xe2\x80\xa6DkAttempts to upgrade this weak handle to a strong Connection\xe2\x80\xa6Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6CkIf the 0-RTT data was accepted, you can continue to use \xe2\x80\xa6CkThe kind of a transport address, used for configuring bias.CiAn AccessControl that admits every endpoint.BnOptions when configuring binding an IP socket.CjStrategy used to obtain TLS certificates for the HTTPS \xe2\x80\xa6BdDatagram support is disabled locallyAdDisable portmapping.CmDisable relay servers completely. This means that neither \xe2\x80\xa6B`Disables rate limiting entirely.BkPotential errors related to DNS operations.0ClControls an iroh endpoint, establishing connections with \xe2\x80\xa6CkA collection of HTTP request handlers for custom endpoints.BbThe address is not currently used.CkAn incoming connection for which the server has not yet \xe2\x80\xa6AhA cache for public keys.B`The largest encoded value lengthCmthe connection is being closed abruptly in the absence of \xe2\x80\xa6CjA borrowed snapshot of a connection\xe2\x80\x99s currently-open \xe2\x80\xa6CgPer-packet recv data filled in by transports during \xe2\x80\xa6CiIf the 0-RTT data was rejected, any streams that were \xe2\x80\xa6CmList of relay server configurations to be used in an iroh \xe2\x80\xa60BaA URL identifying a relay server.0BeTrait for DNS resolvers used in iroh.0iRun errorCjThis path was selected for transmission of application \xe2\x80\xa6Dknoq types that are used in the public iroh API. Identifier \xe2\x80\xa6CnCommunication with the peer has lapsed for longer than the \xe2\x80\xa6Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6ClThe datagram is larger than the connection can currently \xe2\x80\xa6AbAn outgoing packet2ChUser-defined data that can be published and resolved \xe2\x80\xa600BdGet this public key as a byte array.0BaReturn the full serialized bytes.EhReturns true if a relay with url is contained in this this \xe2\x80\xa60oPacket contentsAoThe contents of the datagram(s)CjReturns the data directory where the server stores its \xe2\x80\xa6BjLocation where the server stores its data.BhDefault values used in irohBaDefault values used in the relay.DfReturns a MetricsConfig with the metrics server disabled.CjDisables the metrics server when set to true.ClReturns the local address that the DNS listener is bound \xe2\x80\xa6ClUses a compiled-in copy of the root certificates trusted \xe2\x80\xa60ChReturns the Endpoint stored in this router.CiReturns the Endpoint stored in this builder.DkThe Endpoint allows establishing connections to other iroh \xe2\x80\xa6ClTime a packet is retained in the store before it becomes \xe2\x80\xa6BnStatistics about frames received on this path.CcStatistics about frames received on the connection.CaStatistics about frames transmitted on this path.CfStatistics about frames transmitted on the connection.DkCreates a new qlog factory that writes files into QLOGDIR, \xe2\x80\xa6DdCreates a new QlogFileGroup that is only enabled if \xe2\x80\xa6CfCreates a new user error from an arbitrary error type.00BjConstruct a VarInt infalliblyBeSucceeds iff x < 2^62BiParses a key from its z-base-32 encoding.0DbGenerate a new SecretKey with a randomness generator.0DeNumber of FrameType::Ping frames received from a client.0BnGet the server\xe2\x80\x99s http RelayUrl.CmSpecifies the time to wait after completing MTU discovery \xe2\x80\xa6CcReturns Self for use in down-casting to extract \xe2\x80\xa6CnReturns an iterator over the IP addresses of this endpoint \xe2\x80\xa6BmReturns the direct addresses of the endpoint.0100BfDNS-based endpoint discovery for iroh.CkReturns true if only an EndpointId is present.CeReturns true if this relay map is empty.BbAre there any services configured?BoReturns true if no paths are open.32CgWhether this is a transport address via a relay server.CbReturns true if this is a relay path.1CmDuration after an address validation token was issued for \xe2\x80\xa6BlConfiguration for the mainline DHT fallback.BlStarts a new ping with an RTT-based timeout.BoInitiates a new outgoing unidirectional stream.BcGet the priority of the send streamCjTools for spawning an accept loop that routes incoming \xe2\x80\xa6CmBuilds the client handler and starts the read & write \xe2\x80\xa6BbCalled when the router shuts down.BkSee ProtocolHandler::shutdown.BcShuts down the accept loop cleanly.ChCancels the server tasks and waits for them to complete.AkRequests graceful shutdown.ChShuts down the relay service, disconnecting all clients.BaShuts down all connected clients.AlSlow start threshold (bytes)CgContains all timeouts that we use in iroh.CkConvert this to the bytes representing the secret part. \xe2\x80\xa6AlReturn the inner byte array.10BeSucceeds iff x < 2^6200Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6BeIn-progress connection attempt futureDkBoxed HTTP response body produced by RelayServiceWithNotify\xe2\x80\xa6CmRepresents datagrams sent from relays (originally sent to \xe2\x80\xa6CnRequest from the client to relay datagrams to given remote \xe2\x80\xa6CjOne or multiple datagrams being transferred via the relay.CeErrors that can occur while dialing the relay server.BcConfiguration for the DNS listener.Dbnoq_proto types that are used in the public iroh API.BgPossible frame types during handshakingDknoq_proto types that are used in the public iroh API. Keys \xe2\x80\xa6BkMaximum total byte size of a signed packet.BoThe mechanism that was used for authentication.AdA net_report report.3CiLifecycle notifications for a transmission paths in a \xe2\x80\xa6Dknoq types that are used in the public iroh API. Statistics \xe2\x80\xa6mA public key.0AeA read error occurredDgnoq types that are used in the public iroh API. Errors \xe2\x80\xa6CeErrors when receiving messages from the relay server.AdRelay receive errorsD`Configuration of the relay servers for an Endpoint.mA secret key.0BoError for sending messages to the relay server.AaRelay send errorsAbEd25519 signature.0CgA pkarr timestamp in microseconds since the UNIX epoch.BcTLS configuration for Relay server.BkConfiguration to use for the TLS connectionCmError returned from the underlying WebSocket stream while \xe2\x80\xa6CnError returned from the underlying WebSocket stream during \xe2\x80\xa6BoAccepts the next incoming bidirectional stream.CkAdds addresses to the endpoint data in the given order, \xe2\x80\xa60DfAdds an already Boxed AddressLookup service.BcReturns the raw microseconds value.CbBinds an IP socket at the provided socket address.BfAddress to bind the metrics server to.DgAddress to bind the DNS listener to (defaults to 0.0.0.0).DhAddress to bind the HTTP listener to (defaults to 0.0.0.0).DjAddress to bind the HTTPS listener to (defaults to 0.0.0.0\xe2\x80\xa6ChThe socket address on which the QUIC server should bind.BlCustom bootstrap nodes for the mainline DHT.BiStrategy used to obtain TLS certificates.CjRate limits for incoming traffic from a client connection.BbDuplicate the controller\xe2\x80\x99s stateBeThe number of UDP datagrams observed.BlThe datagrams and related metadata to relay.BcThe datagrams and related metadata.CnConvert to a hex string limited to the first 5 bytes for a \xe2\x80\xa60DjCreates a RelayMap from an iterator of RelayUrl.0BnTry to create Self from the raw representationCdThe discovered global IPv4 address and port, if any.CdThe discovered global IPv6 address and port, if any.ClImplements the handshake protocol that authenticates and \xe2\x80\xa6BgReturns whether this has any addresses.0DkReturns the local address of the HTTP listener, or None if \xe2\x80\xa6CcThe socket address the HTTP server is listening on.BoGet the server\xe2\x80\x99s https RelayUrl.BoWhich side of a connection initiated the streamDhConverts this Connecting into a 0-RTT connection at the \xe2\x80\xa6DkConverts this Accepting into a 0-RTT or 0.5-RTT connection \xe2\x80\xa6BiConverts into TransportAddr.BaBase types and utilities for IrohBoShorthand for self == Side::ClientCiCheck if this endpoint is still alive, or already closed.BkWhether this is a custom transport address.0BoShorthand for self == Side::ServerBkThe authentication mechanism that was used.BbReturns the PKARR server HTTP URL.CiAttempts to read from the stream into the provided bufferC`poll receiving a packet on this custom endpoint.Bepoll sending a packet on this sender.CkSets an explicit proxy url to proxy all HTTP(S) traffic \xe2\x80\xa6CjSet an explicit proxy url to proxy all HTTP(S) traffic \xe2\x80\xa6CcThe socket address the QUIC server is listening on.BdReturns the relay map for this mode.DaReturns the EndpointId of the endpoint that this \xe2\x80\xa6DfReturns the EndpointId from the peer\xe2\x80\x99s TLS certificate.00DfRuns a future to completion, or until the Endpoint is \xe2\x80\xa6AoNumber of bytes sent over IPv4.AoNumber of bytes sent over IPv6.CoNumber of FrameType::Pong frames sent to a client.0BiSets the list of accepted ALPN protocols.AeReturn the signature.BhA stable identifier for this connection.AeReturn the timestamp.CgReturns the optional user-defined data of the endpoint.BfReturns user data information, if set.AnReturns any user-defined data.21BoWrite a buffer into this stream in its entiretyBbConfiguration for the ACME client.ClA filter and/or reordering function applied to transport \xe2\x80\xa600AnTLS certificate configuration.CbThe client frame type for the authentication frameB`The send half of a relay client.BcAn outgoing connection in progress.AbA QUIC connection.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6CkA custom transport address consisting of a transport id \xe2\x80\xa6D`A direct address on which an iroh-endpoint might be \xe2\x80\xa6CeThe identifier for an endpoint in the (iroh) network.03BdConfiguration for the HTTP listener.DjBoxed error type returned from RelayServiceWithNotify\xe2\x80\x99s \xe2\x80\xa6CbThe max byte length allowed for user-defined data.0CaThe provenance string for this Address Lookup \xe2\x80\xa6CeAn address assigned by the router using port mapping.BeConfiguration for qlog trace logging.CbHandles the client side of QUIC address discovery.BbConfiguration for the QUIC server.ChThe HTTP path under which the relay accepts relaying \xe2\x80\xa6Dinoq types that are used in the public iroh API. A stream \xe2\x80\xa6BdInformation about a remote endpoint.Dgnoq types that are used in the public iroh API. Errors \xe2\x80\xa6CmSent from server to client for the server to declare that \xe2\x80\xa6ClA one-way message from relay to client, advertising that \xe2\x80\xa6DhError for attempting to retry an Incoming which already \xe2\x80\xa6CgGenerate self-signed certificates and cache them in \xe2\x80\xa66AcServer spawn errorsDfnoq_proto types that are used in the public iroh API. \xe2\x80\xa66CaAccepts the next incoming uni-directional stream.CnReturns a comma-separated string of all supported protocol \xe2\x80\xa6CkWhether the implementation is permitted to set the spin \xe2\x80\xa6BoOptional authorization token sent to the relay.0AlSets an authorization token.ClReturns the authorization token from the client\xe2\x80\x99s HTTP \xe2\x80\xa6CbReturns the number of bytes read from this stream.DiBytes received from a client in ClientToRelayDatagram or \xe2\x80\xa60DcBytes sent to a client in RelayToClientDatagram or \xe2\x80\xa60BoSets the directory where to cache certificates.BhThe authenticated client\xe2\x80\x99s public key.D`Disconnects connections registered for endpoint_id.BnClass of error as encoded in the specificationB`Application-specific reason codeCcError code to send with the connection close frame.BcType of frame that caused the closeCgCreates a new user error from an arbitrary boxed error.CiConstruct a PublicKey from a slice of bytes.CaCreate a secret key from its byte representation.BmParse an Ed25519 signature from a byte slice.B`Parses from the binary encoding.321CbParse and verify a signed packet from its wire \xe2\x80\xa6CgCreates a new EndpointAddr from its parts.CgCreates a new EndpointInfo from its parts.1DeCreates a new CustomAddr from a transport id and raw \xe2\x80\xa61DiReturns the local address of the HTTPS listener, or None \xe2\x80\xa6CdThe socket address the HTTPS server is listening on.CjConverts into an iterator over known all addresses for \xe2\x80\xa6ClRemoves the filter wrapper and returns the inner address \xe2\x80\xa6AiExtract the integer valueCkIroh\xe2\x80\x99s relay is a feature within iroh, a peer-to-peer \xe2\x80\xa6CmReturns the most recent connection error, if the relay is \xe2\x80\xa6BgPath statistics captured at close time.BmReturns the path\xe2\x80\x99s local address, if known.CiReturns the local address that received this incoming \xe2\x80\xa6BdLocal address of the path, if known.0CgThe local address of the newly selected path, if known.BhReturns the local address of the client.AeLooks up TXT records.AfLooks up a TXT record.10BfThe number of bytes lost on this path.BkThe number of bytes lost on the connection.BaMetrics collected by net reports.C`Decides whether a connecting client is admitted.BkSee AccessControl::on_connect.ChWhether to run a local relay and have the server and \xe2\x80\xa6CjPad UDP datagrams carrying application data to current \xe2\x80\xa6CjPer-path statistics for every path the connection knew \xe2\x80\xa6C`Attempt to write bytes from buf into the stream.DkReturns the prefix_len, see Self::set_prefix_len.CcReturns the provenance of this Address Lookup item.AfReturn the public key.CoReads the next segment of data as zero-copy Bytes.AoReads the next segment of data.CkRead an exact number of bytes contiguously from the stream.CdSets the relay servers to assist in establishing \xe2\x80\xa6AjOnly keep relay addresses.0ClReturns an iterator over the relay URLs of this endpoint \xe2\x80\xa6BfReturns the relay URL of the endpoint.0100CcSets a secret key to authenticate with other peers.BhReturns the secret_key of this endpoint.BnNumber of bytes sent over the relay transport.CaRuns the server side of the handshaking protocol.BoEpoch qlog event times are recorded relative toBfInternal utilities to support testing.DjReturns the rustls::ClientConfig used by the endpoint for \xe2\x80\xa6CfCreates a TlsConfig suitable for testing.BdTypes for defining custom transportsCkConstructs a filter that doesn\xe2\x80\x99t filter addresses and \xe2\x80\xa60EeReturns a Watcher for the current EndpointAddr for this \xe2\x80\xa6AiAdds a list of addresses.0BoConfiguration for the signed-packet zone store.AeServer accept errors.ClConfigures the trusted CA root certificates for non-iroh \xe2\x80\xa60Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6B`Default timeout for DNS requests0CaProtocols over which DNS records can be resolved.0CcThe DNS resolver used throughout iroh.0BaAttempted to send an empty packetBeConfiguration for the HTTPS listener.BoResult alias for HTTP responses produced by \xe2\x80\xa6Dhnoq types that are used in the public iroh API. Maximum \xe2\x80\xa6CiObtain certificates from Let\xe2\x80\x99s Encrypt via the ACME \xe2\x80\xa6AdUse Let\xe2\x80\x99s Encrypt.CiPotential errors related to DNS endpoint address lookups.0BjTracks pings on a single relay connection.D`Constructs a QlogConfig for individual connections.BgInformation on a specific relay server.0CbConfiguration for the Relay HTTP and HTTPS server.BiConnection status of a single home relay.BjConfiguration for the signed-packet store.CmError returned from the underlying WebSocket stream while \xe2\x80\xa60BjError from the underlying WebSocket stream0BkError type for WebSocket stream operations.CbA simulated network for testing custom transports.CcAccepts this incoming connection using a custom \xe2\x80\xa6BbConfiguration for the ACME client.CjSets the address filter to control which addresses are \xe2\x80\xa6CnSets the address filter applied to all address data before \xe2\x80\xa6BiCurrent number of zones in the main cacheAjClears the internal cache.BcRemoves all entries from the cache.10BbCreate a connection usable for qadCeLargest UDP payload size the path currently supports.CfSOA record data served for authoritative zones, in \xe2\x80\xa6CkDefault time-to-live, in seconds, for returned DNS records.BiDescription to record in the qlog captureCeNumber of times a client connection was disconnected.0CcReturns the endpoint id of the discovered endpoint.CjThe EndpointId of the endpoint this is about.BcThe endpoint ID of the remote peer.11CbReturns the EndpointId of the client.CnReturns the EndpointId of the guarded connection.CbCreates a timestamp from a raw microseconds value.ClLow-level HTTP server components for embedding the relay \xe2\x80\xa6CkThe initial value to be used as the maximum UDP payload \xe2\x80\xa6BkStarting guess for maximum UDP payload sizeBkThe RTT used before an RTT sample is taken.DjReturns a future completing once the value is set to Some \xe2\x80\xa6ClReturns the value set by Self::set_is_required.DdReturns true if this path is currently selected for \xe2\x80\xa6BiChecks if the router is already shutdown.DbCreates a new AcmeConfig with the Let\xe2\x80\x99s Encrypt \xe2\x80\xa6AiLooks up an IPv4 address.BgPerforms an IPv4 lookup with a timeout.10AiLooks up an IPv6 address.BgPerforms an IPv6 lookup with a timeout.10CeThe amount of concurrent streams which should be usedBaReturns the maximum ping timeout.DdPackets are acked in batches, all with the same now \xe2\x80\xa60ClWait until a Pkarr announce for an endpoint is published \xe2\x80\xa6AePacing rate (bytes/s)D`Returns a stream of PathEvents for this connection.CfThe number of network paths to peers that are relayed.ClReturns an iterator over the query parameters set in the \xe2\x80\xa6CgCreates a QuicConfig suitable for testing.CkConvenience method to read all remaining data into a bufferBnReturns the path\xe2\x80\x99s remote transport address.CgReturns the remote address of this incoming connection.BnReturns the remote address of this connection.AiRemote transport address.0CdRemote transport address of the newly selected path.ChReturns addressing information about a recently used \xe2\x80\xa6BoThe sample size used for this key\xe2\x80\x99s algorithmCiMaximum number of bytes to transmit to a peer without \xe2\x80\xa6BkReturns the big-endian byte representation.CcIterate over TXT records under a specific DNS name.CaNumber of bytes to transmit from client to serverCnSpecifies the upper bound to the max UDP payload size that \xe2\x80\xa6D`Returns a WeakConnectionHandle for this connection.CeSets a prefix to the filename of the generated files.DdWrites a single Bytes into this stream in its entirety.BcThe receive half of a relay client.CgThe stream has already been stopped, finished, or resetBmThe stream has already been finished or resetDfnoq types that are used in the public iroh API. Error \xe2\x80\xa6AbConnection errors.CiA process-unique identifier for a single relay client \xe2\x80\xa6mCustom senderCjNetwork-level addressing information for an iroh endpoint.0CgData about an endpoint that may be published to and \xe2\x80\xa600ChSent from server to client to signal that a previous \xe2\x80\xa6CjIndicates that the client identified by the underlying \xe2\x80\xa6CnInformation about an endpoint that may be published to and \xe2\x80\xa600BnThe remote address for an incoming connection.CfAn in-memory address lookup system to manually add \xe2\x80\xa6DdAn iterator over the open paths in a PathList snapshot.BbTrait to configure path selection.Dgnoq types that are used in the public iroh API. Future \xe2\x80\xa6BdMetrics tracked for the relay serverBhAll metrics tracked in the relay server.CiThe hyper Service that serves the actual relay endpoints.Djnoq_proto types that are used in the public iroh API. RTT \xe2\x80\xa64BiParameters governing incoming connectionsBaConfiguration for the full Relay.BhA signed DNS packet in the pkarr format.Dgnoq types that are used in the public iroh API. Errors \xe2\x80\xa6DiA simpler version of ToSocketAddrs, that does not do any \xe2\x80\xa6CfAdds addresses in order with duplicates or already \xe2\x80\xa60D`Returns the EndpointData with given filter applied.0CiCompletes the authorization protocol by notifying the \xe2\x80\xa6BlIf the connection is closed, the reason why.AlConservative estimate of RTTCaOnly trusts the explicitly set root certificates.0CcTotal number of DNS requests across all transports.AmSets the DNS resolver to use.CnSets the DNS resolver to use for resolving the pkarr relay \xe2\x80\xa60CiOptionally sets a custom DNS resolver to use for this \xe2\x80\xa6ClReturns the DNS resolver used in this Endpoint.DhCreate a DnsResolver configured to use the test DNS server.CnCreates a new user error from an arbitrary error type that \xe2\x80\xa6CjCreates a new user error from an arbitrary boxed error \xe2\x80\xa60BoRun HTTPS latency probes against relay servers.0CmAdds the provided configuration to the RelayMap.CiWhether this watcher is still connected to all of its \xe2\x80\xa6DdReturns true if the endpoint is connected to the relay.CnReturns the optional timestamp when this endpoint info was \xe2\x80\xa6BhThe number of packets lost on this path.BmThe number of packets lost on the connection.AkSocket to serve metrics on.BgThe network path of the candidate path.DgOptional interception point to handle the Accepting state.BoSee ProtocolHandler::on_accepting.CkThe number of network paths to peers that are user defined.CeThe number of network paths to peers that are direct.DhReturns a stream of PathList snapshots for this connection.BfReturns the timeout for the next ping.DiPolls for the next value, or returns Disconnected if one \xe2\x80\xa6BcNumber of incoming QAD connections.0D`Configures qlog capturing by setting a QlogFactory.CkAn advisory duration that the client should wait before \xe2\x80\xa6ChCreates a RelayConfig suitable for testing.DdRemoves the configuration from the RelayMap for the \xe2\x80\xa6BmNumber of full reports executed by net_reportC`Resolves a hostname from a URL to an IP address.0AmOptional segment size for GSOCkThe segment size if this transmission contains multiple \xe2\x80\xa6CkSend Quantum (bytes) used to control the size of packet \xe2\x80\xa6BcSet the priority of the send streamAiAdds an IP based address.0CkControls which endpoints may use the relay and observes \xe2\x80\xa6CfAddressLookup system for super::Endpoint.BdRenamed to CaTlsConfig.CmThe connection could not be created because not enough of \xe2\x80\xa60oBuild a Client.CbDetails about an incoming relay client connection.ChEndpointHooks intercept the connection establishment \xe2\x80\xa6BnThe stream finished before all bytes were readCcreceived an invalid Retry Token in a client InitialBeThe DNS name for the iroh TXT record.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6AmThe input has invalid length.0BkThe local application closed the connectionBeConfiguration for the metrics server.ChThe set of paths a PathSelector has chosen.CjResolver of address lookup information from a pkarr relay.CcHard NAT: QAD\xe2\x80\x99ed IPv4 address + local fixed port.CcBuilder to create one or more related qlog configs.BeThe relay\xe2\x80\x99s connection to a client.DcBuilder for creating a Router for accepting protocols.BeMetrics collected by the iroh socket.CgA test transport for use with TestNetwork.AhAvailable address types.0AmRecord data for a TXT record.0AaReturned from \xe2\x80\xa6CnAdds the relay URL to the end of the endpoint data, unless \xe2\x80\xa60CnReturns the local socket addresses on which the underlying \xe2\x80\xa6CjSets the trusted CA root certificates for non-iroh TLS \xe2\x80\xa6CdBuilds a ClientConfig from this config.0DbReturns the ConnectionId assigned to this connection.D`Returns the ConnectionId of the guarded connection.C`Create a custom sender for this custom endpoint.CaNumber of bytes to transmit from server to clientClSupport for handling DNS resource records for dialing by \xe2\x80\xa6DbReturns the EndpointInfo for the discovered endpoint.1CfAdds an external address on which this endpoint is \xe2\x80\xa6AmParses from big-endian bytes.AoNumber of HTTP requests served.AmGet the IncomingCnThe max_ack_delay we will request the peer to useBnSee AccessControl::on_disconnect.BeNotifies that a connection has ended.CkThe known MTU for the current network path has been updatedCjSets a custom PathSelector for this endpoint.BcCryptographic identity of the peer.BnUpdates the ping tracker with a received pong.DjConfigures qlog capturing through the QLOGDIR environment \xe2\x80\xa6BaReceives an application datagram.CgThe measured latency to each relay, keyed by relay URL.DjReturns a handle to the embedded RelayService for runtime \xe2\x80\xa6DgTransmits data as an unreliable, unordered application \xe2\x80\xa6CmWhether to implement fair queuing for send streams having \xe2\x80\xa6CaThe TLS server configuration for the QUIC server.CiCreates a ServerConfig suitable for testing.BmThe rustls::ServerConfig to use.CePrivate key used to authenticate data included in \xe2\x80\xa6AkSets the user-defined data.0DiSplits the current datagram into at maximum num_segments \xe2\x80\xa6CaCreates a RelayMap from an iterator.0CgSets the IP based addresses and returns the updated \xe2\x80\xa60BgWrite timeout for the client connectionDbOptions for the Endpoint::connect_with_opts function.AgThe connection was lost0000BmCustom endpoint created by a CustomTransport.AkThe type of direct address.CeHandle and drop guard for test DNS and Pkarr servers.CcFuture returned from Endpoint::closed.Cithe endpoint encountered an internal error and cannot \xe2\x80\xa6CiFilter predicate used for early filtering of incoming \xe2\x80\xa6CcThe decoded data is not a valid Ed25519 public key.0BlConfiguration for the mainline DHT fallback.CiThe main underlying IO stream type used for the relay \xe2\x80\xa6ClConfigures the endpoint to use the n0 defaults, but with \xe2\x80\xa6Amno viable network path existsCmA stream of PathList snapshots for a connection.CiPublisher of address lookup information to a pkarr relay.Dgnoq types that are used in the public iroh API. Errors \xe2\x80\xa60BcVerification of a signature failed.0BkError returned when a staggered call fails.0CmThe peer violated the QUIC specification as understood by \xe2\x80\xa6Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6CjNumber of actor messages processed by the socket actor \xe2\x80\xa6BeLookup the address of an Endpoint ID.CdAdds an additional Address Lookup for this endpoint.CbReturns the Address Lookup service, if configured.CcCreates an address lookup service for this network.DkAuthorizes a ClientRequest and completes the authorization \xe2\x80\xa6CgIntercept outgoing connections before they are started.0CjCaptivePortal is set when we think there\xe2\x80\x99s a captive \xe2\x80\xa6CdRemoves all direct addresses from the endpoint data.0CgTake the provided endpoint and run the client benchmarkBnCreate a client endpoint and client connection0BdReturn the encoded DNS packet bytes.C`Apply the given filter to the current addresses.0DiReturns a QlogConfig for a connection, if logging should \xe2\x80\xa6BjParameters negotiated during the handshake0BkParameters negotiated during the handshake.ClThe socket address on which the Relay HTTP server should \xe2\x80\xa6AiInitial congestion windowBnConverts this stream into an unordered stream.B`Get a key from a slice of bytes.DbTries to parse a ProtocolVersion from s.CiMaximum number of packets processed in a single write \xe2\x80\xa6ClMaximum time a write transaction stays open before it is \xe2\x80\xa6CnSpecifies the minimum MTU change to stop the MTU discovery \xe2\x80\xa6CaNotifies the system of potential network changes.AhOne packet was just lost0AhOne packet was just sent0CgSets the proxy url from the environment, in this order:BkConfigures qlog capturing into a directory.BeWhether to use the unordered read APIClMaximum number of bytes the peer may transmit across all \xe2\x80\xa6CkCompletes when the stream has been reset by the peer or \xe2\x80\xa60BhNumber of data bytes received over IPv4.BhNumber of data bytes received over IPv6.BbNumber of QUIC datagrams received.CeSaturating integer addition. Computes self + rhs, \xe2\x80\xa60ChSaturating integer subtraction. Computes self - rhs, \xe2\x80\xa6CeSets the network prefix length of the subnet this \xe2\x80\xa6BeIn-memory test transport for testing.CkMaximum reordering in time space before time based loss \xe2\x80\xa6CmConverts an endpoint ID to a custom address for this test \xe2\x80\xa6ChTries to convert this type to a SocketAddr.CkConverts into a list of {key}={value} strings.0CjIntended to count received frames with an unrecognized \xe2\x80\xa60BeAdds a RelayUrl address.CiAdds the relay URL and returns the updated endpoint info.10CfSets the user-defined data and returns the updated \xe2\x80\xa6000CmHow many tokio worker threads to use for each endpoint in \xe2\x80\xa6BoShorthand for a type that implements both a \xe2\x80\xa6BdPer-client rate limit configuration.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6Dhnoq types that are used in the public iroh API. Reasons \xe2\x80\xa6DfTrait to track the state of a Connection at compile time.Dknoq types that are used in the public iroh API. Connection \xe2\x80\xa6AaCustom transport.CoMetrics collected by an crate::endpoint::Endpoint.CnMarker type for a connection that is in the incoming 0-RTT \xe2\x80\xa6EaError returned when parsing a PublicKey or a SecretKey.0ClThe maximum size of a packet sent over relay. (This only \xe2\x80\xa6BkConfiguration for the net report component.0CnMarker type for a connection that is in the outgoing 0-RTT \xe2\x80\xa6CmA 'static stream of PathEvents.BaHandler for incoming connections.ClThe relay protocol version negotiated between client and \xe2\x80\xa6BkEnables writing qlog traces to a directory.BkRate limiting strategy for the HTTP server.CjConfiguration for speaking to the QUIC endpoint on the \xe2\x80\xa6C`The server frame type for the challenge responseCnAuthentication was performed by verifying a signature of a \xe2\x80\xa6AbServer task errorsDfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6CbThe peer doesn\xe2\x80\x99t implement any supported versionBgError when writing a frame to a client.CbThis was a 0-RTT stream and the server rejected it000CcNumber of iterations of the main socket actor loop.CmIntercept both incoming and outgoing connections once the \xe2\x80\xa60BjIterate over all TXT records, yielding \xe2\x80\xa6BoRenamed to Builder::ca_tls_config.BhCurrent number of zones in the DHT cacheCfSpecify the rustls cryptography to use for all TLS \xe2\x80\xa6B`The remote endpoint to relay to.CoParses a EndpointInfo from DNS TXT lookup results.0CfThe socket address on which to serve the HTTPS server.ClSets a filter that decides whether to accept an incoming \xe2\x80\xa6CdMaximum number of incoming packets that may fail \xe2\x80\xa6AmA DNS server and pkarr relay.BnMax number of bytes to read in a single burst.BoSet the maximum number of TLS tickets to cache.CaThe relay server with the lowest latency, if any.BhNumber of accepted QAD QUIC connections.0CgNumber of data bytes received over the relay transport.CmRun DNS and Pkarr servers on localhost with the specified \xe2\x80\xa6CiCreates a server endpoint which runs on the given runtime0ClSets the address filter applied before publishing to any \xe2\x80\xa6CcSets whether bind errors are fatal for this socket.BnObject to get current SystemTime.CfReturns this protocol version as an HTTP header value.ClSets an authorization token for all relays configured in \xe2\x80\xa6BkSets an authorization token for this relay.10AiAdds a single nameserver.CkCreates a new DNS resolver configured with a single UDP \xe2\x80\xa610CjCreates a new Memory Lookup instance with the provided \xe2\x80\xa6Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6BmA drop guard to clean up test infrastructure.BeMessages that clients send to relays.CbThe peer\xe2\x80\x99s QUIC stack aborted the connection \xe2\x80\xa63AfDNS endpoint discoveryDgA dyn-compatible version of AccessControl that returns \xe2\x80\xa6CaThe endpoint can no longer create new connectionsCnreceived a STREAM frame or a RESET_STREAM frame containing \xe2\x80\xa6CdError when handling an incoming frame from a client.A`key update errorAnEnum of metrics for the moduleDfA pkarr client to publish SignedPackets to a pkarr relay.ChConfiguration for the portmapper service (UPnP, PCP, \xe2\x80\xa6RelayConfig for Asia-Pacific.C`Get the default RelayConfig for EU.0CiReturns the default crypto provider, if enabled via a \xe2\x80\xa60C`Number of DNS lookups that failed with an error.BiNumber of DNS requests received over UDP.CiCreate a signed packet containing TXT records under a \xe2\x80\xa6BgNumber of accepted HTTP(S) connections.0BhReturns whether this is a default route.CjWhether to use the Let\xe2\x80\x99s Encrypt production endpoint \xe2\x80\xa6CbResolves IPv4 and IPv6 in parallel with a timeout.0CnMaximum duration of inactivity to accept before timing out \xe2\x80\xa6CgReturn whether this packet is more recent than another.CmNumber of connections closed (only handshaked connections \xe2\x80\xa6CcThe number of connections that have been direct \xe2\x80\xa6CmNumber of connections opened (only handshaked connections \xe2\x80\xa6CiMaximum reordering in packet number space before FACK \xe2\x80\xa6B`Number of port mapping attempts.DhReturns the ProtocolVersion negotiated for this connection.BkProtocol version negotiated for this clientB`Reads the next segments of data.ChNumber of data bytes received over any custom transport.CgResolves a hostname from a URL to its IP addresses, \xe2\x80\xa60CiRuns a relay server with QUIC enabled suitable for tests.DdMaximum number of Incoming to allow to exist at a time.DgConverts into a EndpointAddr by cloning the needed fields.DbReturns an EndpointAddr by cloning the needed fields.1CkReturn the relay payload (everything after the public key).DaSets a custom QuicTransportConfig for this endpoint.ClAdds additional root certificates to the list of trusted \xe2\x80\xa60AkAdds a list of nameservers.0DfWrites a slice of Bytes into this stream in its entirety.Cfthe application or application protocol caused the \xe2\x80\xa6BkHostname of the default Asia-Pacific relay.AnThe peer closed the connectionDfnoq_proto types that are used in the public iroh API. \xe2\x80\xa60BoThe default HTTP port used by the Relay server.0CgDefault TTL for the records in the pkarr signed packet.BaHostname of the default EU relay.0BmThe input string could not be decoded as hex.0Djnoq_proto types that are used in the public iroh API. The \xe2\x80\xa6BcThe given server name was malformedDjReports a connection\xe2\x80\x99s disconnect to AccessControl when \xe2\x80\xa6C`Data the selector sees about one candidate path.Dgnoq types that are used in the public iroh API. Errors \xe2\x80\xa6ClAuthentication was performed by verifying a signature of \xe2\x80\xa6CbThe transport ID used by TestNetwork.BfAddress of a remote with some metadataCcThe peer does not support receiving datagram framesCkBurst limit for accepting new connections. Unlimited if \xe2\x80\xa6CnRate limit for accepting new connections. Unlimited if not \xe2\x80\xa6CjNumber of local network interface (link) change events \xe2\x80\xa6CjAugments endpoint addressing information for the given \xe2\x80\xa6CfAdds an external address on which this endpoint is \xe2\x80\xa6CkClears the address filter, allowing all addresses to be \xe2\x80\xa6BdCongestion events on the connection.AiCongestion window (bytes)D`Starts a connection attempt with a remote Endpoint.BfGet the default RelayMap.0BkInterval between runs of the eviction task.CiReturns endpoint addressing information for the given \xe2\x80\xa6AoHandle the incoming connection.DdReturns a Watcher over the connection status of the \xe2\x80\xa6CmComputes the maximum size of datagrams that may be passed \xe2\x80\xa6AjConfigures the net report.CgConfigures the portmapper service (UPnP, PCP, NAT-PMP).CiNumber of times the home relay changed to a different \xe2\x80\xa6EhClientToRelayDatagram or ClientToRelayDatagramBatch frames \xe2\x80\xa60EhRelayToClientDatagram or RelayToClientDatagramBatch frames \xe2\x80\xa60CfSets endpoint addressing information for the given \xe2\x80\xa6BfSets a custom TLS verification config.0AiSets a custom TLS config.CgA watcher for local addresses for this custom endpoint.DgWrites Bytes from a slice of buffers into this stream, \xe2\x80\xa6Cmthe endpoint has reached the confidentiality or integrity \xe2\x80\xa6Dknoq types that are used in the public iroh API. Parameters \xe2\x80\xa6CdThe HTTP header name for relay client authenticationBmthe server refused to accept a new connectionC`The default HTTPS port used by the Relay server.0DiA dyn-compatible version of ProtocolHandler that returns \xe2\x80\xa6Ckreceived more data than permitted in advertised data limitsCjError returned when forwarding a packet to a client fails.CgMarker type for a connection that has completed the \xe2\x80\xa6BdThe local address of a network path.8CjThe maximum amount of time, in seconds, the net_report \xe2\x80\xa6Ckdetected an error with protocol compliance that was not \xe2\x80\xa6CmCan occur when parsing a string into a RelayUrl.0Cjreceived a frame for a stream identifier that exceeded \xe2\x80\xa6Cnreceived a frame for a stream that was not in a state that \xe2\x80\xa6CeThe server frame type for authentication confirmationBlInformation how a transport address is used.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6ChThe local endpoint does not support the QUIC version \xe2\x80\xa61CiNumber of periodic re-STUN timer ticks handled by the \xe2\x80\xa6CiMaximum quantity of out-of-order crypto layer data to \xe2\x80\xa6AoReturns the default relay mode.ChNumber of DNS lookups that returned at least one answer.CaNumber of DNS requests received over HTTPS (DoH).DeCreates a guard for the connection described by request.CiCreates a Memory Lookup instance from endpoint addresses.CkCreate from a public key and relay payload (signature + \xe2\x80\xa6C`Create a VarInt without ensuring it\xe2\x80\x99s in rangeCfThe number of times holepunching is initiated on a \xe2\x80\xa6BjConverts into a EndpointAddr.CkConverts into an EndpointAddr without cloning.1CbTrue if this sender can send to the given address.BnSet the capacity of the cache for public keys.AcKey cache capacity.CkIntended to count received frames other than datagrams, \xe2\x80\xa60CkIntended to count sent frames other than datagrams, but \xe2\x80\xa60CmNumber of pkarr relay puts that did not change the stored \xe2\x80\xa6CfNumber of QAD QUIC connections that aborted before \xe2\x80\xa60CnNumber of receive events that used GRO (coalesced datagram \xe2\x80\xa6DiBuilds a ResolvesServerCert that reloads its certificate \xe2\x80\xa6CcThe EndpointId of the original sender.CnSets the interval after which packets are republished even \xe2\x80\xa6DgTransmits data as an unreliable, unordered application \xe2\x80\xa6CfSets the connection-level flow control receive window.BdNumber of unique client keys per day0CiOverride the instant relative to which all events are \xe2\x80\xa6B`ALPN for our quic addr discoveryBaAddressLookup errorsC`Parameters governing the core QUIC state machineBjA builder for a ServerConfig.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6Dinoq types that are used in the public iroh API. A stream \xe2\x80\xa6C`Returns all supported protocol versions in a \xe2\x80\xa6CbBinds an IP socket at the provided socket address.CjSpecifies the amount of time that MTU discovery should \xe2\x80\xa6B`Removes all IP based transports.BoNumber of DNS lookups that returned no answers.DaReturns true if the use of staging relays is forced.CgWaits until the full handshake occurs and returns a \xe2\x80\xa6ClWaits until the full handshake occurs and then returns a \xe2\x80\xa6CjNumber of HTTP requests that returned a non-2xx status \xe2\x80\xa6DbTurns this builder into a ready-to-use AddressLookup.ChPeriod of inactivity before sending a keep-alive packet.C`Contact email address passed to Let\xe2\x80\x99s Encrypt.CfThe number of PLPMTUD probe packets lost on this path.BlPackets were deemed lost or marked congestedCfThe number of PLPMTUD probe packets sent on this path.ClReturns a stream which will yield the most recent values \xe2\x80\xa6CnIntended to count updates to the local direct address set, \xe2\x80\xa6DjTrait for structs that can be converted into AddressLookup\xe2\x80\xa6CeOutcome of EndpointHooks::before_connectCbThe default metrics port used by the Relay server.0BlPacket size exceeds the maximum allowed sizeCkTrait for extracting keying material from a TLS connection.Bireceived a frame that was badly formattedC`The input string could not be decoded as base32.0CiThe remote SocketAddr supplied was malformedCbState of the endpoint relevant for path selection.BgBuilder for PkarrResolver.ClMaximum time the server will attempt to get a successful \xe2\x80\xa6BeErrors when attempting to upgrade andDfnoq types that are used in the public iroh API. Error \xe2\x80\xa6BkA weak handle to a Connection.DkSpecifies the ACK frequency config (see AckFrequencyConfig \xe2\x80\xa6AgAdds a custom transportCjThe number of times a black hole was detected in the path.CkCheck for captive portals when generating the first report.0CeRemoves all Address Lookup services from the builder.CfParse a signed packet without verifying the signature.CjReconstruct a signed packet from its raw parts without \xe2\x80\xa6CcINSECURE: Do not verify server certificates at all.0DkSpecifies the MTU discovery config (see MtuDiscoveryConfig \xe2\x80\xa6CjNumber of pkarr relay puts that updated the stored packet.CgRate limit applied to PUT /pkarr requests.CmRemoves all endpoint addressing information for the given \xe2\x80\xa6DjRemoves a configured external address. Returns true if it \xe2\x80\xa6ChThe reordering threshold we will request the peer to useEhRelayToClientDatagram or RelayToClientDatagramBatch frames \xe2\x80\xa60CjBuilds a ServerCertVerifier from this config.0BeSets whether this is a default route.BoSets a custom QuicTransportConfig.ClPublishes the addressing information about this endpoint \xe2\x80\xa6CeMakes the builder respect the host system\xe2\x80\x99s DNS \xe2\x80\xa60DbRegistry for address lookup services for an Endpoint.CfOutcome of EndpointHooks::after_handshakeCg32B dest pub key + ECN bytes + one datagram\xe2\x80\x99s contentDgAn AddressLookup wrapper that filters addresses before \xe2\x80\xa6DfVerdict from a IncomingFilter for an incoming connection.BjNo default client configuration was set upBiPath abandoned due to unstable interfacesBhBuilder for PkarrPublisher.Cf32B src pub key + ECN bytes + one datagram\xe2\x80\x99s contentCjError generated when failed to parse an ED25519 signature.Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6CmMaximum number of packets that may be sent using a single \xe2\x80\xa6CeGet the default RelayConfig for NA east.0CeGet the default RelayConfig for NA west.ChNumber of HTTP requests that returned a 2xx status code.DgLooks up endpoint info by EndpointId and origin domain \xe2\x80\xa60CiPerforms an IPv4 lookup with a timeout in a staggered \xe2\x80\xa60CiPerforms an IPv6 lookup with a timeout in a staggered \xe2\x80\xa60BmMaximum number of segments to transmit (GSO).0BhStarts a new ping with a custom timeout.CnIntended to count dropped frames other than datagrams, but \xe2\x80\xa60CfWhether the socket address that is initiating this \xe2\x80\xa6AdRuns a relay server.CbBuilder for the rustls::ServerConfig.CfNumber of signed packets removed by the eviction task.C`Number of signed packets removed from the store.CmNumber of times an existing signed packet was replaced by \xe2\x80\xa6CiMaximum number of bytes the peer may transmit without \xe2\x80\xa6CnSets ALPN identifiers that should be signaled as supported \xe2\x80\xa6CkSets the QUIC transport config options for this connection.Chreceived more data in CRYPTO frames than can be bufferedCmServer connection errors, includes errors that can happen \xe2\x80\xa6CaMaximum total size of a serialized signed packet.DkError returned when an input value is too long for UserData\xe2\x80\xa60BaHostname of the default NA relay.BfHostname of the default NA east relay.BfHostname of the default NA west relay.CmCombines RelayService with a notification token.AoError building a signed packet.BcRemoves all relay based transports.CkNumber of times a client was moved into the inactive state.0ChDerives keying material from this connection\xe2\x80\x99s TLS \xe2\x80\xa6CkIf this type ends up wrapping a TLS stream, then this triesClWhether the reported public address differs when probing \xe2\x80\xa6CjNumber of QAD QUIC connections that disconnected after \xe2\x80\xa60CgNumber of signed packets newly inserted into the store.BkCreates a pkarr::SignedPacket.0BhFailed to deserialize client auth headerClThe default QUIC port used by the Relay server to accept \xe2\x80\xa60BjBuilder for DnsAddressLookup.BkThe production pkarr relay run by number 0.BoA builder for the PkarrRelayClientClAnother endpoint connected with the same endpoint id. No \xe2\x80\xa6B`Error verifying a signed packet.CkThe ack-eliciting threshold we will request the peer to useCgSets a callback hinting whether to prefer IPv6 when \xe2\x80\xa6BiNumber of terminated HTTP(S) connections.0CbThe peer\xe2\x80\x99s ACK-frequency parameters have changed0==BmPath abandoned at the application\xe2\x80\x99s requestChEnvironment variable to force the use of staging relays.C`Result of a successful authentication handshake.CjNumber of times a client was removed from the inactive \xe2\x80\xa60DkParses a EndpointInfo from a pkarr::SignedPacket.0CiNumber of HTTP(S) connections that terminated with an \xe2\x80\xa60CgMaximum number of received bytes to buffer for each \xe2\x80\xa6ClDuration after a retry token was issued for which it\xe2\x80\x99s \xe2\x80\xa6CjReturns the path to the signed-packet store database file.BdNumber of IP transport paths opened.BhAddressLookupBuilder errorsCmthe number of connection IDs provided by the peer exceeds \xe2\x80\xa6Dfnoq_proto types that are used in the public iroh API. \xe2\x80\xa6CjA QUIC connection on the server-side that can possibly \xe2\x80\xa6CmPath abandoned due to no available connection IDs for the \xe2\x80\xa6BfThe client side of a 0-RTT connection.AiEndpoint close error codeCnFunction to build a ServerCertVerifier from a \xe2\x80\xa6Clreceived transport parameters that were badly formatted, \xe2\x80\xa6ClMaximum number of outgoing application datagram bytes to \xe2\x80\xa6CjCumulative duration of all HTTP requests, in milliseconds.Cn32B dest pub key + ECN byte + segment size u16 + datagrams \xe2\x80\xa6CkThe default capacity of the key cache for the relay server.ClInterval in which to republish the endpoint info even if \xe2\x80\xa6BhThe testing pkarr relay run by number 0.BoBuilder for a QuicTransportConfig.Cm32B src pub key + ECN byte + segment size u16 + datagrams \xe2\x80\xa6CnNumber of port-mapping change events handled by the socket \xe2\x80\xa6CnNumber of bytes received from client connection which have \xe2\x80\xa60CjNumber of client connections which have had any frames \xe2\x80\xa60C`Bytes available in the outgoing datagram buffer.CeRaces an IPv4 and IPv6 lookup with a timeout in a \xe2\x80\xa60DaVariant of max_concurrent_bidi_streams affecting \xe2\x80\xa6BmSpurious congestion events on the connection.BdNumber of IP transport paths closed.CaThe n0 address lookup DNS origin, for production.00CkPath abandoned due to resource limitations in the transportCeThe number of packets buffered for sending per clientAeEndpoint close reasonDgCreates a CaTlsConfig that uses a callback function to \xe2\x80\xa60ChWhether to use \xe2\x80\x9cGeneric Segmentation Offload\xe2\x80\x9d to \xe2\x80\xa6ClWhether the reported public address differs when probing \xe2\x80\xa60CmMaximum number of incoming bidirectional streams that may \xe2\x80\xa6CaSets a custom ValidationTokenConfig.BgNumber of relay transport paths opened.BhThe default certificate reload interval.DdCreate a ServerConfigBuilder for this endpoint that \xe2\x80\xa6ClMaximum number of incoming application datagram bytes to \xe2\x80\xa6CkCreates a client config that trusts any servers without \xe2\x80\xa6BdPackets were incorrectly deemed lost0CaRuns a relay server with a custom access control.BhNumber of custom transport paths opened.CiSets the initial user-defined data to be published in \xe2\x80\xa6CjHow to construct new congestion::Controllers.BmSets a default per-path maximum idle timeout.CbWhether to send observed address reports to peers.ClModifies the number of bidirectional streams that may be \xe2\x80\xa6BgNumber of relay transport paths closed.BnThe n0 address lookup DNS origin, for testing.00BcLooks up endpoint info by DNS name.0BiEnables the Multipath Extension for QUIC.DhMaximum number of received bytes to buffer for all IncomingCmModifies the number of unidirectional streams that may be \xe2\x80\xa6BhNumber of custom transport paths closed.CiError returned when the relay protocol version is not \xe2\x80\xa6DgLooks up endpoint info by EndpointId and origin domain \xe2\x80\xa60CeNumber of consecutive PTOs after which network is \xe2\x80\xa6CiIntended to count direct address heartbeat ticks, but \xe2\x80\xa6BlSets a default per-path keep alive interval.CmNumber of times an external address was obtained via port \xe2\x80\xa6CjWhether to receive observed address reports from other \xe2\x80\xa6DiCreates a rustls::ServerConfig and certificates suitable \xe2\x80\xa6CiSets the initial user-defined data to be published in \xe2\x80\xa6CkSets the maximum number of nat traversal addresses this \xe2\x80\xa6AcNat traversal draftCjLooks up endpoint info by DNS name in a staggered fashion.0") \ No newline at end of file diff --git a/pr/4036/docs/search.index/root.js b/pr/4036/docs/search.index/root.js index 4ec880a128..6a06f44f1e 100644 --- a/pr/4036/docs/search.index/root.js +++ b/pr/4036/docs/search.index/root.js @@ -1 +1 @@ -rr_('{"normalizedName":{"I":"AQABoEAAABRWZfZ+AQAAegMBAAEAAQAtBAEBADowAAABAAAAAAAMABAAAADhAlgEvQSZDZoNphCoEKkQgBXyHfMd9B31HQEAAqAQAAAJKKAAAAAEvDI2ARIAAAABAQA7MAAAAQAACwACAPwEAAAsCQoAAQEA9JkNAAABAA4DAQAAA29yZQAAAbMYAAAAEgNuZXMBAaAgAAAb8nRkAAEUGQAAAQABoCAAABr0ZgGCGQAAAYACoBAAABWAoDAAABn+M3MBCQD0oh4AAAEAAgABAAAFdGF0dXMAAAGSGgAAAAAHZWplY3RlZAAA9OkbAAABAAEAAQAA8gJ0dAIBcnNjAPK1GwAAHADyA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DHGAEAyhgAAM0YAADPGAEA0hgAANUYAwDdGAEA4RgCAOoYAADtGAEA8BgAAPMYAgD7GAMAAxnPANUZAQDYGQEA5RkAAOgZAgDuGQEA8RkAAPUZAAD4GQEA+xkAAAAaAAACGgAABBoAAAgaAAASGgAAFBo8AFMaAABVGgIAWhoAAF4aAgBjGgAAZhoAAGkaAQBsGgAAbhoDAHUaBAB7GgAAfxoAAIIaAACGGgAAkBoBAJMaPgDVGgEA2BoAANoaAADcGgQA5xoBAOoaAADtGgEA8BoBAPMaAAD3GgEA+hoAAP0aAAD/GgAAARsAAAQbAQAMGwAAEBsCABUbAAAXGwAAGRuFAKAbAACiGwAApRsAAKcbAACsGwEAsxsAALgbAQC8GwMAxRsFAMwbAADPGwEA0hsAANcbAADdGwMA5RsCAOkbyQC1HAAAtxwAALkcAAC+HAAAwBwCAMUcAADHHAAAyRwAAMscAQDOHAIA1BwBANgcAQDbHAAA3hwBAOEcAADjHD4AJB0EACsdAQAuHQEAMh0AADQdAAA4HQMAPR0jAGIdAQBmHQIAah0AAHAdAQB2HQIAeh0BAH4dAACAHSoArB0AAK8dAQCzHQAAtR0AALcdAAC5HQIAwR0AAMMdHADiHQAA5B0BAOcdAADpHQAA7B0BAO8dAADxHQAA9B0CAPgdAAD8HQEAAR4gACMeAAAlHgAAKR4AACseAgAvHgAAMx4cAFIeAQBWHgIAWh4BAF0eAABfHgAAYR4MAG8eAABxHgIAdh4BAHkeAQB9Hg8Ajh4AAJEeAQCUHgoAoB4AAKMeAQCmHgAAqB4AAKoeAQCtHgAArx4FALYeAwC7HisA6B4KAPQeCAD+HgQA","H":"52veuocd"},"alias":{"N":"`","E":"OzAAAAEAAAIfAQAAAAIf","H":"p2IVDFMs"},"generic_inverted_index":{"N":"d","E":"OjAAAAAAAAA=","H":"KTqNoh+I"}}') \ No newline at end of file +rr_('{"normalizedName":{"I":"AQABoEAAABRWZfZ+AQAAegMBAAEAAQAtBAEBADowAAABAAAAAAAMABAAAADhAlgEvQSZ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eAwC7HisA6B4KAPQeCAD+HgQA","H":"52veuocd"},"alias":{"N":"`","E":"OzAAAAEAAAIfAQAAAAIf","H":"p2IVDFMs"},"generic_inverted_index":{"N":"d","E":"OjAAAAAAAAA=","H":"KTqNoh+I"}}') \ No newline at end of file diff --git a/pr/4036/docs/src/iroh/address_lookup.rs.html b/pr/4036/docs/src/iroh/address_lookup.rs.html index 0c7c53bb2c..c14c3f03da 100644 --- a/pr/4036/docs/src/iroh/address_lookup.rs.html +++ b/pr/4036/docs/src/iroh/address_lookup.rs.html @@ -3,10 +3,10 @@ 3//! To connect to an iroh endpoint a [`EndpointAddr`] is needed, which may contain a 4//! [`RelayUrl`] or one or more *direct addresses* in addition to the [`EndpointId`]. 5//! -6//! Since there is a conversion from [`EndpointId`] to [`EndpointAddr`], you can also use +6//! Since there is a conversion from [`EndpointId`] to [`EndpointAddr`], you can also 7//! connect directly with a [`EndpointId`]. 8//! -9//! For this to work however, the endpoint has to get the addressing information by +9//! For this to work however, the endpoint has to get the addressing information by 10//! other means. 11//! 12//! [`AddressLookup`] is an automated system for an [`Endpoint`] to retrieve this addressing @@ -50,9 +50,9 @@ 50//! [`iroh-mdns-address-lookup`]: https://docs.rs/iroh-mdns-address-lookup 51//! [`iroh-mainline-address-lookup`]: https://docs.rs/iroh-mainline-address-lookup 52//! -53//! To use multiple Address Lookup'ssimultaneously you can call [`Builder::address_lookup`]. +53//! To use multiple Address Lookups simultaneously you can call [`Builder::address_lookup`]. 54//! This will use [`AddressLookupServices`] under the hood, which performs lookups to all -55//! Address Lookupsystems at the same time. +55//! Address Lookup systems at the same time. 56//! 57//! [`Builder::address_lookup`] takes any type that implements [`AddressLookupBuilder`]. You can 58//! implement that trait on a builder struct if your Address Lookup needs information @@ -60,8 +60,8 @@ 60//! is built by calling [`AddressLookupBuilder::into_address_lookup`], passing the finished [`Endpoint`] to your 61//! builder. 62//! -63//! If your Address Lookupdoes not need any information from its endpoint, you can -64//! pass the Address Lookupservice directly to [`Builder::address_lookup`]: All types that +63//! If your Address Lookup does not need any information from its endpoint, you can +64//! pass the Address Lookup service directly to [`Builder::address_lookup`]: All types that 65//! implement [`AddressLookup`] also have a blanket implementation of [`AddressLookupBuilder`]. 66//! 67//! # Examples @@ -334,7 +334,7 @@ 334 /// Publishes the given [`EndpointData`] to the Address Lookup mechanism. 335 /// 336 /// This is fire and forget, since the [`Endpoint`] can not wait for successful -337 /// publishing. If publishing is async, the implementation should start it's own task. +337 /// publishing. If publishing is async, the implementation should start its own task. 338 /// 339 /// This will be called from a tokio task, so it is safe to spawn new tasks. 340 /// These tasks will be run on the runtime of the [`super::Endpoint`]. @@ -369,7 +369,7 @@ 369/// directly from [`Item`]. 370#[derive(Debug, Clone, Eq, PartialEq)] 371pub struct Item { -372 /// The endpoint info for the endpoint, as discovered by the the Address Lookup. +372 /// The endpoint info for the endpoint, as discovered by the Address Lookup. 373 endpoint_info: EndpointInfo, 374 /// A static string to identify the Address Lookup source. 375 /// @@ -421,12 +421,12 @@ 421 self.last_updated 422 } 423 -424 /// Converts into a [`EndpointAddr`] by cloning the needed fields. +424 /// Returns an [`EndpointAddr`] by cloning the needed fields. 425 pub fn to_endpoint_addr(&self) -> EndpointAddr { 426 self.endpoint_info.to_endpoint_addr() 427 } 428 -429 /// Converts into a [`EndpointAddr`] without cloning. +429 /// Converts into an [`EndpointAddr`] without cloning. 430 pub fn into_endpoint_addr(self) -> EndpointAddr { 431 self.endpoint_info.into_endpoint_addr() 432 } @@ -457,7 +457,7 @@ 457/// 458/// See [`AddressLookup`] and [`Self::resolve`] for details. 459/// -460/// [`Endpoint]: crate::Endpoint +460/// [`Endpoint`]: crate::Endpoint 461#[derive(Debug, Default, Clone)] 462pub struct AddressLookupServices { 463 services: Arc<RwLock<Vec<Box<dyn AddressLookup>>>>, diff --git a/pr/4036/docs/src/iroh/address_lookup/dns.rs.html b/pr/4036/docs/src/iroh/address_lookup/dns.rs.html index f35e373fa2..47702949bd 100644 --- a/pr/4036/docs/src/iroh/address_lookup/dns.rs.html +++ b/pr/4036/docs/src/iroh/address_lookup/dns.rs.html @@ -82,57 +82,55 @@ 82 } 83 } 84 -85 /// Creates a new DNS discovery using the `iroh.link` domain. +85 /// Creates a new DNS address lookup using the `iroh.link` domain. 86 /// 87 /// This uses the [`N0_DNS_ENDPOINT_ORIGIN_PROD`] domain. 88 /// -89 /// # Usage during tests -90 /// -91 /// For testing it is possible to use the [`N0_DNS_ENDPOINT_ORIGIN_STAGING`] domain -92 /// with [`DnsAddressLookup::builder`]. This would then use a hosted staging discovery -93 /// service for testing purposes. -94 pub fn n0_dns() -> DnsAddressLookupBuilder { -95 if force_staging_infra() { -96 Self::builder(N0_DNS_ENDPOINT_ORIGIN_STAGING.to_string()) -97 } else { -98 Self::builder(N0_DNS_ENDPOINT_ORIGIN_PROD.to_string()) -99 } -100 } -101} -102 -103impl AddressLookupBuilder for DnsAddressLookupBuilder { -104 fn into_address_lookup( -105 mut self, -106 endpoint: &Endpoint, -107 ) -> Result<impl AddressLookup, AddressLookupBuilderError> { -108 if self.dns_resolver.is_none() { -109 self.dns_resolver = Some(endpoint.dns_resolver()?.clone()); -110 } -111 Ok(self.build()) -112 } -113} -114 -115impl AddressLookup for DnsAddressLookup { -116 fn resolve( -117 &self, -118 endpoint_id: EndpointId, -119 ) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>> { -120 let resolver = self.dns_resolver.clone(); -121 let origin_domain = self.origin_domain.clone(); -122 let span = -123 debug_span!("DnsAddressLookup", lookup_id=%endpoint_id.fmt_short(), %origin_domain); -124 let fut = async move { -125 trace!("starting DNS lookup"); -126 let endpoint_info = resolver -127 .lookup_endpoint_by_id_staggered(&endpoint_id, &origin_domain, DNS_STAGGERING_MS) -128 .await -129 .inspect_err(|err| debug!("DNS lookup failed: {err:#}")) -130 .map_err(|e| AddressLookupError::from_err_any("dns", e))?; -131 debug!(info=?endpoint_info, "DNS lookup success"); -132 Ok(AddressLookupItem::new(endpoint_info, "dns", None)) -133 } -134 .instrument(span); -135 let stream = n0_future::stream::once_future(fut); -136 Some(Box::pin(stream)) -137 } -138}

    \ No newline at end of file +89 /// When running with the environment variable `IROH_FORCE_STAGING_RELAYS` +90 /// set to any non empty value the [`N0_DNS_ENDPOINT_ORIGIN_STAGING`] domain +91 /// is used instead. +92 pub fn n0_dns() -> DnsAddressLookupBuilder { +93 if force_staging_infra() { +94 Self::builder(N0_DNS_ENDPOINT_ORIGIN_STAGING.to_string()) +95 } else { +96 Self::builder(N0_DNS_ENDPOINT_ORIGIN_PROD.to_string()) +97 } +98 } +99} +100 +101impl AddressLookupBuilder for DnsAddressLookupBuilder { +102 fn into_address_lookup( +103 mut self, +104 endpoint: &Endpoint, +105 ) -> Result<impl AddressLookup, AddressLookupBuilderError> { +106 if self.dns_resolver.is_none() { +107 self.dns_resolver = Some(endpoint.dns_resolver()?.clone()); +108 } +109 Ok(self.build()) +110 } +111} +112 +113impl AddressLookup for DnsAddressLookup { +114 fn resolve( +115 &self, +116 endpoint_id: EndpointId, +117 ) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>> { +118 let resolver = self.dns_resolver.clone(); +119 let origin_domain = self.origin_domain.clone(); +120 let span = +121 debug_span!("DnsAddressLookup", lookup_id=%endpoint_id.fmt_short(), %origin_domain); +122 let fut = async move { +123 trace!("starting DNS lookup"); +124 let endpoint_info = resolver +125 .lookup_endpoint_by_id_staggered(&endpoint_id, &origin_domain, DNS_STAGGERING_MS) +126 .await +127 .inspect_err(|err| debug!("DNS lookup failed: {err:#}")) +128 .map_err(|e| AddressLookupError::from_err_any("dns", e))?; +129 debug!(info=?endpoint_info, "DNS lookup success"); +130 Ok(AddressLookupItem::new(endpoint_info, "dns", None)) +131 } +132 .instrument(span); +133 let stream = n0_future::stream::once_future(fut); +134 Some(Box::pin(stream)) +135 } +136}

    \ No newline at end of file diff --git a/pr/4036/docs/src/iroh/address_lookup/memory.rs.html b/pr/4036/docs/src/iroh/address_lookup/memory.rs.html index edce0c6dbe..b627ad41cd 100644 --- a/pr/4036/docs/src/iroh/address_lookup/memory.rs.html +++ b/pr/4036/docs/src/iroh/address_lookup/memory.rs.html @@ -3,7 +3,7 @@ 3//! Often an application might get endpoint addressing information out-of-band in an 4//! application-specific way. [`EndpointTicket`]'s are one common way used to achieve this. 5//! This addressing information is often only usable for a limited time so needs to -6//! be able to be removed again once know it is no longer useful. +6//! be able to be removed again once you know it is no longer useful. 7//! 8//! This is where the [`MemoryLookup`] is useful: it allows applications to add and 9//! retract endpoint addressing information that is otherwise out-of-band to iroh. @@ -29,277 +29,278 @@ 29/// Often an application might get endpoint addressing information out-of-band in an 30/// application-specific way. [`EndpointTicket`]'s are one common way used to achieve this. 31/// This addressing information is often only usable for a limited time so needs to -32/// be able to be removed again once know it is no longer useful. +32/// be able to be removed again once you know it is no longer useful. 33/// 34/// This is where the [`MemoryLookup`] is useful: it allows applications to add and 35/// retract endpoint addressing information that is otherwise out-of-band to iroh. -36/// # Examples -37/// -38/// ```no_run -39/// # #[cfg(with_crypto_provider)] // Endpoint::bind needs a crypto provider -40/// # { -41/// use iroh::{ -42/// Endpoint, EndpointAddr, TransportAddr, address_lookup::memory::MemoryLookup, -43/// endpoint::presets, -44/// }; -45/// use iroh_base::SecretKey; -46/// -47/// # #[tokio::main] -48/// # async fn wrapper() -> n0_error::Result<()> { -49/// // Create the Address Lookup and endpoint. -50/// let address_lookup = MemoryLookup::new(); -51/// -52/// let _ep = Endpoint::builder(presets::N0) -53/// .address_lookup(address_lookup.clone()) -54/// .bind() -55/// .await?; -56/// -57/// // Sometime later add a RelayUrl for our endpoint. -58/// let id = SecretKey::generate().public(); -59/// // You can pass either `EndpointInfo` or `EndpointAddr` to `add_endpoint_info`. -60/// address_lookup.add_endpoint_info(EndpointAddr { -61/// id, -62/// addrs: [TransportAddr::Relay("https://example.com".parse()?)] -63/// .into_iter() -64/// .collect(), -65/// }); -66/// -67/// # Ok(()) -68/// # } +36/// +37/// # Examples +38/// +39/// ```no_run +40/// # #[cfg(with_crypto_provider)] // Endpoint::bind needs a crypto provider +41/// # { +42/// use iroh::{ +43/// Endpoint, EndpointAddr, TransportAddr, address_lookup::memory::MemoryLookup, +44/// endpoint::presets, +45/// }; +46/// use iroh_base::SecretKey; +47/// +48/// # #[tokio::main] +49/// # async fn wrapper() -> n0_error::Result<()> { +50/// // Create the Address Lookup and endpoint. +51/// let address_lookup = MemoryLookup::new(); +52/// +53/// let _ep = Endpoint::builder(presets::N0) +54/// .address_lookup(address_lookup.clone()) +55/// .bind() +56/// .await?; +57/// +58/// // Sometime later add a RelayUrl for our endpoint. +59/// let id = SecretKey::generate().public(); +60/// // You can pass either `EndpointInfo` or `EndpointAddr` to `add_endpoint_info`. +61/// address_lookup.add_endpoint_info(EndpointAddr { +62/// id, +63/// addrs: [TransportAddr::Relay("https://example.com".parse()?)] +64/// .into_iter() +65/// .collect(), +66/// }); +67/// +68/// # Ok(()) 69/// # } -70/// ``` -71/// -72/// [`EndpointTicket`]: https://docs.rs/iroh-tickets/latest/iroh_tickets/endpoint/struct.EndpointTicket.html -73#[derive(Debug, Clone)] -74pub struct MemoryLookup { -75 endpoints: Arc<RwLock<BTreeMap<EndpointId, StoredEndpointInfo>>>, -76 provenance: &'static str, -77} -78 -79impl Default for MemoryLookup { -80 fn default() -> Self { -81 Self { -82 endpoints: Default::default(), -83 provenance: Self::PROVENANCE, -84 } -85 } -86} -87 -88#[derive(Debug)] -89struct StoredEndpointInfo { -90 data: EndpointData, -91 last_updated: SystemTime, -92} -93 -94impl MemoryLookup { -95 /// The provenance string for this Address Lookup implementation. -96 /// -97 /// This is mostly used for debugging information and allows understanding the origin of -98 /// addressing information used by an iroh [`Endpoint`]. -99 /// -100 /// [`Endpoint`]: crate::Endpoint -101 pub const PROVENANCE: &'static str = "memory_lookup"; -102 -103 /// Creates a new static Address Lookup instance. -104 pub fn new() -> Self { -105 Self::default() -106 } -107 -108 /// Creates a new Memory Lookup instance with the provided `provenance`. -109 /// -110 /// The provenance is part of [`address_lookup::Item`]s returned from [`Self::resolve`]. -111 /// It is mostly used for debugging information and allows understanding the origin of -112 /// addressing information used by an iroh [`Endpoint`]. -113 /// -114 /// [`Endpoint`]: crate::Endpoint -115 /// [`address_lookup::Item`]: crate::address_lookup::Item -116 pub fn with_provenance(provenance: &'static str) -> Self { -117 Self { -118 endpoints: Default::default(), -119 provenance, -120 } -121 } -122 -123 /// Creates a Memory Lookup instance from endpoint addresses. -124 /// -125 /// # Examples -126 /// -127 /// ```no_run -128 /// # #[cfg(with_crypto_provider)] // Endpoint::bind needs a crypto provider -129 /// # { -130 /// use std::{net::SocketAddr, str::FromStr}; -131 /// -132 /// use iroh::{Endpoint, EndpointAddr, address_lookup::memory::MemoryLookup, endpoint::presets}; -133 /// -134 /// # fn get_addrs() -> Vec<EndpointAddr> { -135 /// # Vec::new() -136 /// # } -137 /// # #[tokio::main] -138 /// # async fn wrapper() -> n0_error::Result<()> { -139 /// // get addrs from somewhere -140 /// let addrs = get_addrs(); -141 /// -142 /// // create a MemoryLookup from the list of addrs. -143 /// let address_lookup = MemoryLookup::from_endpoint_info(addrs); -144 /// // create an endpoint with the memory lookup address_lookup -145 /// let endpoint = Endpoint::builder(presets::N0) -146 /// .address_lookup(address_lookup) -147 /// .bind() -148 /// .await?; -149 /// # Ok(()) -150 /// # } +70/// # } +71/// ``` +72/// +73/// [`EndpointTicket`]: https://docs.rs/iroh-tickets/latest/iroh_tickets/endpoint/struct.EndpointTicket.html +74#[derive(Debug, Clone)] +75pub struct MemoryLookup { +76 endpoints: Arc<RwLock<BTreeMap<EndpointId, StoredEndpointInfo>>>, +77 provenance: &'static str, +78} +79 +80impl Default for MemoryLookup { +81 fn default() -> Self { +82 Self { +83 endpoints: Default::default(), +84 provenance: Self::PROVENANCE, +85 } +86 } +87} +88 +89#[derive(Debug)] +90struct StoredEndpointInfo { +91 data: EndpointData, +92 last_updated: SystemTime, +93} +94 +95impl MemoryLookup { +96 /// The provenance string for this Address Lookup implementation. +97 /// +98 /// This is mostly used for debugging information and allows understanding the origin of +99 /// addressing information used by an iroh [`Endpoint`]. +100 /// +101 /// [`Endpoint`]: crate::Endpoint +102 pub const PROVENANCE: &'static str = "memory_lookup"; +103 +104 /// Creates a new empty Memory Lookup instance. +105 pub fn new() -> Self { +106 Self::default() +107 } +108 +109 /// Creates a new Memory Lookup instance with the provided `provenance`. +110 /// +111 /// The provenance is part of [`address_lookup::Item`]s returned from [`Self::resolve`]. +112 /// It is mostly used for debugging information and allows understanding the origin of +113 /// addressing information used by an iroh [`Endpoint`]. +114 /// +115 /// [`Endpoint`]: crate::Endpoint +116 /// [`address_lookup::Item`]: crate::address_lookup::Item +117 pub fn with_provenance(provenance: &'static str) -> Self { +118 Self { +119 endpoints: Default::default(), +120 provenance, +121 } +122 } +123 +124 /// Creates a Memory Lookup instance from endpoint addresses. +125 /// +126 /// # Examples +127 /// +128 /// ```no_run +129 /// # #[cfg(with_crypto_provider)] // Endpoint::bind needs a crypto provider +130 /// # { +131 /// use std::{net::SocketAddr, str::FromStr}; +132 /// +133 /// use iroh::{Endpoint, EndpointAddr, address_lookup::memory::MemoryLookup, endpoint::presets}; +134 /// +135 /// # fn get_addrs() -> Vec<EndpointAddr> { +136 /// # Vec::new() +137 /// # } +138 /// # #[tokio::main] +139 /// # async fn wrapper() -> n0_error::Result<()> { +140 /// // get addrs from somewhere +141 /// let addrs = get_addrs(); +142 /// +143 /// // create a MemoryLookup from the list of addrs. +144 /// let address_lookup = MemoryLookup::from_endpoint_info(addrs); +145 /// // create an endpoint with the memory lookup address_lookup +146 /// let endpoint = Endpoint::builder(presets::N0) +147 /// .address_lookup(address_lookup) +148 /// .bind() +149 /// .await?; +150 /// # Ok(()) 151 /// # } -152 /// ``` -153 pub fn from_endpoint_info(infos: impl IntoIterator<Item = impl Into<EndpointInfo>>) -> Self { -154 let res = Self::default(); -155 for info in infos { -156 res.add_endpoint_info(info); -157 } -158 res -159 } -160 -161 /// Sets endpoint addressing information for the given endpoint ID. -162 /// -163 /// This will completely overwrite any existing info for the endpoint. -164 /// -165 /// Returns the [`EndpointData`] of the previous entry, or `None` if there was no previous -166 /// entry for this endpoint ID. -167 pub fn set_endpoint_info( -168 &self, -169 endpoint_info: impl Into<EndpointInfo>, -170 ) -> Option<EndpointData> { -171 let last_updated = SystemTime::now(); -172 let EndpointInfo { endpoint_id, data } = endpoint_info.into(); -173 let mut guard = self.endpoints.write().expect("poisoned"); -174 let previous = guard.insert(endpoint_id, StoredEndpointInfo { data, last_updated }); -175 previous.map(|x| x.data) -176 } -177 -178 /// Augments endpoint addressing information for the given endpoint ID. -179 /// -180 /// The provided addressing information is combined with the existing info in the memory -181 /// lookup. Any new direct addresses are added to those already present while the -182 /// relay URL is overwritten. -183 pub fn add_endpoint_info(&self, endpoint_info: impl Into<EndpointInfo>) { -184 let last_updated = SystemTime::now(); -185 let EndpointInfo { endpoint_id, data } = endpoint_info.into(); -186 let mut guard = self.endpoints.write().expect("poisoned"); -187 match guard.entry(endpoint_id) { -188 Entry::Occupied(mut entry) => { -189 let existing = entry.get_mut(); -190 existing.data.add_addrs(data.addrs().cloned()); -191 existing.data.set_user_data(data.user_data().cloned()); -192 existing.last_updated = last_updated; -193 } -194 Entry::Vacant(entry) => { -195 entry.insert(StoredEndpointInfo { data, last_updated }); -196 } -197 } -198 } -199 -200 /// Returns endpoint addressing information for the given endpoint ID. -201 pub fn get_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo> { -202 let guard = self.endpoints.read().expect("poisoned"); -203 let info = guard.get(&endpoint_id)?; -204 Some(EndpointInfo::from_parts(endpoint_id, info.data.clone())) -205 } -206 -207 /// Removes all endpoint addressing information for the given endpoint ID. -208 /// -209 /// Any removed information is returned. -210 pub fn remove_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo> { -211 let mut guard = self.endpoints.write().expect("poisoned"); -212 let info = guard.remove(&endpoint_id)?; -213 Some(EndpointInfo::from_parts(endpoint_id, info.data)) -214 } -215} -216 -217impl AddressLookup for MemoryLookup { -218 fn publish(&self, _data: &EndpointData) {} -219 -220 fn resolve(&self, endpoint_id: EndpointId) -> Option<BoxStream<Result<super::Item, Error>>> { -221 let guard = self.endpoints.read().expect("poisoned"); -222 let info = guard.get(&endpoint_id); -223 match info { -224 Some(endpoint_info) => { -225 let last_updated = endpoint_info -226 .last_updated -227 .duration_since(SystemTime::UNIX_EPOCH) -228 .expect("time drift") -229 .as_micros() as u64; -230 let item = Item::new( -231 EndpointInfo::from_parts(endpoint_id, endpoint_info.data.clone()), -232 self.provenance, -233 Some(last_updated), -234 ); -235 Some(stream::iter(Some(Ok(item))).boxed()) -236 } -237 None => None, -238 } -239 } -240} -241 -242#[cfg(all(test, with_crypto_provider))] -243mod tests { -244 use iroh_base::{EndpointAddr, SecretKey, TransportAddr}; -245 use n0_error::{Result, StackResultExt}; -246 -247 use super::*; -248 use crate::{Endpoint, endpoint::presets}; -249 -250 #[tokio::test] -251 async fn test_basic() -> Result { -252 let address_lookup = MemoryLookup::new(); -253 -254 let _ep = Endpoint::builder(presets::Minimal) -255 .address_lookup(address_lookup.clone()) -256 .bind() -257 .await?; -258 -259 let key = SecretKey::from_bytes(&[0u8; 32]); -260 let addr = EndpointAddr::from_parts( -261 key.public(), -262 [TransportAddr::Relay("https://example.com".parse()?)], -263 ); -264 let user_data = Some("foobar".parse().unwrap()); -265 let endpoint_info = EndpointInfo::from(addr.clone()).with_user_data(user_data.clone()); -266 address_lookup.add_endpoint_info(endpoint_info.clone()); -267 -268 let back = address_lookup -269 .get_endpoint_info(key.public()) -270 .context("no addr")?; -271 -272 assert_eq!(back, endpoint_info); -273 assert_eq!(back.user_data(), user_data.as_ref()); -274 assert_eq!(back.into_endpoint_addr(), addr); -275 -276 let removed = address_lookup -277 .remove_endpoint_info(key.public()) -278 .context("nothing removed")?; -279 assert_eq!(removed, endpoint_info); -280 let res = address_lookup.get_endpoint_info(key.public()); -281 assert!(res.is_none()); -282 -283 Ok(()) -284 } -285 -286 #[tokio::test] -287 async fn test_provenance() -> Result { -288 let address_lookup = MemoryLookup::with_provenance("foo"); -289 let key = SecretKey::from_bytes(&[0u8; 32]); -290 let addr = EndpointAddr::from_parts( -291 key.public(), -292 [TransportAddr::Relay("https://example.com".parse()?)], -293 ); -294 address_lookup.add_endpoint_info(addr); -295 let mut stream = address_lookup.resolve(key.public()).unwrap(); -296 let item = stream.next().await.unwrap()?; -297 assert_eq!(item.provenance(), "foo"); -298 assert_eq!( -299 item.relay_urls().next(), -300 Some(&("https://example.com".parse()?)) -301 ); -302 -303 Ok(()) -304 } -305}
    \ No newline at end of file +152 /// # } +153 /// ``` +154 pub fn from_endpoint_info(infos: impl IntoIterator<Item = impl Into<EndpointInfo>>) -> Self { +155 let res = Self::default(); +156 for info in infos { +157 res.add_endpoint_info(info); +158 } +159 res +160 } +161 +162 /// Sets endpoint addressing information for the given endpoint ID. +163 /// +164 /// This will completely overwrite any existing info for the endpoint. +165 /// +166 /// Returns the [`EndpointData`] of the previous entry, or `None` if there was no previous +167 /// entry for this endpoint ID. +168 pub fn set_endpoint_info( +169 &self, +170 endpoint_info: impl Into<EndpointInfo>, +171 ) -> Option<EndpointData> { +172 let last_updated = SystemTime::now(); +173 let EndpointInfo { endpoint_id, data } = endpoint_info.into(); +174 let mut guard = self.endpoints.write().expect("poisoned"); +175 let previous = guard.insert(endpoint_id, StoredEndpointInfo { data, last_updated }); +176 previous.map(|x| x.data) +177 } +178 +179 /// Augments endpoint addressing information for the given endpoint ID. +180 /// +181 /// The provided addressing information is combined with the existing info in the memory +182 /// lookup. Any new direct addresses are added to those already present while the +183 /// relay URL is overwritten. +184 pub fn add_endpoint_info(&self, endpoint_info: impl Into<EndpointInfo>) { +185 let last_updated = SystemTime::now(); +186 let EndpointInfo { endpoint_id, data } = endpoint_info.into(); +187 let mut guard = self.endpoints.write().expect("poisoned"); +188 match guard.entry(endpoint_id) { +189 Entry::Occupied(mut entry) => { +190 let existing = entry.get_mut(); +191 existing.data.add_addrs(data.addrs().cloned()); +192 existing.data.set_user_data(data.user_data().cloned()); +193 existing.last_updated = last_updated; +194 } +195 Entry::Vacant(entry) => { +196 entry.insert(StoredEndpointInfo { data, last_updated }); +197 } +198 } +199 } +200 +201 /// Returns endpoint addressing information for the given endpoint ID. +202 pub fn get_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo> { +203 let guard = self.endpoints.read().expect("poisoned"); +204 let info = guard.get(&endpoint_id)?; +205 Some(EndpointInfo::from_parts(endpoint_id, info.data.clone())) +206 } +207 +208 /// Removes all endpoint addressing information for the given endpoint ID. +209 /// +210 /// Any removed information is returned. +211 pub fn remove_endpoint_info(&self, endpoint_id: EndpointId) -> Option<EndpointInfo> { +212 let mut guard = self.endpoints.write().expect("poisoned"); +213 let info = guard.remove(&endpoint_id)?; +214 Some(EndpointInfo::from_parts(endpoint_id, info.data)) +215 } +216} +217 +218impl AddressLookup for MemoryLookup { +219 fn publish(&self, _data: &EndpointData) {} +220 +221 fn resolve(&self, endpoint_id: EndpointId) -> Option<BoxStream<Result<super::Item, Error>>> { +222 let guard = self.endpoints.read().expect("poisoned"); +223 let info = guard.get(&endpoint_id); +224 match info { +225 Some(endpoint_info) => { +226 let last_updated = endpoint_info +227 .last_updated +228 .duration_since(SystemTime::UNIX_EPOCH) +229 .expect("time drift") +230 .as_micros() as u64; +231 let item = Item::new( +232 EndpointInfo::from_parts(endpoint_id, endpoint_info.data.clone()), +233 self.provenance, +234 Some(last_updated), +235 ); +236 Some(stream::iter(Some(Ok(item))).boxed()) +237 } +238 None => None, +239 } +240 } +241} +242 +243#[cfg(all(test, with_crypto_provider))] +244mod tests { +245 use iroh_base::{EndpointAddr, SecretKey, TransportAddr}; +246 use n0_error::{Result, StackResultExt}; +247 +248 use super::*; +249 use crate::{Endpoint, endpoint::presets}; +250 +251 #[tokio::test] +252 async fn test_basic() -> Result { +253 let address_lookup = MemoryLookup::new(); +254 +255 let _ep = Endpoint::builder(presets::Minimal) +256 .address_lookup(address_lookup.clone()) +257 .bind() +258 .await?; +259 +260 let key = SecretKey::from_bytes(&[0u8; 32]); +261 let addr = EndpointAddr::from_parts( +262 key.public(), +263 [TransportAddr::Relay("https://example.com".parse()?)], +264 ); +265 let user_data = Some("foobar".parse().unwrap()); +266 let endpoint_info = EndpointInfo::from(addr.clone()).with_user_data(user_data.clone()); +267 address_lookup.add_endpoint_info(endpoint_info.clone()); +268 +269 let back = address_lookup +270 .get_endpoint_info(key.public()) +271 .context("no addr")?; +272 +273 assert_eq!(back, endpoint_info); +274 assert_eq!(back.user_data(), user_data.as_ref()); +275 assert_eq!(back.into_endpoint_addr(), addr); +276 +277 let removed = address_lookup +278 .remove_endpoint_info(key.public()) +279 .context("nothing removed")?; +280 assert_eq!(removed, endpoint_info); +281 let res = address_lookup.get_endpoint_info(key.public()); +282 assert!(res.is_none()); +283 +284 Ok(()) +285 } +286 +287 #[tokio::test] +288 async fn test_provenance() -> Result { +289 let address_lookup = MemoryLookup::with_provenance("foo"); +290 let key = SecretKey::from_bytes(&[0u8; 32]); +291 let addr = EndpointAddr::from_parts( +292 key.public(), +293 [TransportAddr::Relay("https://example.com".parse()?)], +294 ); +295 address_lookup.add_endpoint_info(addr); +296 let mut stream = address_lookup.resolve(key.public()).unwrap(); +297 let item = stream.next().await.unwrap()?; +298 assert_eq!(item.provenance(), "foo"); +299 assert_eq!( +300 item.relay_urls().next(), +301 Some(&("https://example.com".parse()?)) +302 ); +303 +304 Ok(()) +305 } +306}
    \ No newline at end of file diff --git a/pr/4036/docs/src/iroh/address_lookup/pkarr.rs.html b/pr/4036/docs/src/iroh/address_lookup/pkarr.rs.html index b903e195ad..e2cca29d44 100644 --- a/pr/4036/docs/src/iroh/address_lookup/pkarr.rs.html +++ b/pr/4036/docs/src/iroh/address_lookup/pkarr.rs.html @@ -259,423 +259,425 @@ 259/// that it only publishes address lookup information, for the corresponding resolver use 260/// the [`PkarrResolver`] together with [`AddressLookupServices`]. 261/// -262/// This publisher will **only** publish the [`RelayUrl`] if it is set, otherwise the *direct addresses* are published instead. -263/// -264/// [pkarr]: https://pkarr.org -265/// [module docs]: crate::address_lookup::pkarr -266/// [`RelayUrl`]: crate::RelayUrl -267/// [`AddressLookupServices`]: super::AddressLookupServices -268#[derive(derive_more::Debug, Clone)] -269pub struct PkarrPublisher { -270 endpoint_id: EndpointId, -271 watchable: Watchable<Option<EndpointInfo>>, -272 addr_filter: AddrFilter, -273 _drop_guard: Arc<AbortOnDropHandle<()>>, -274} -275 -276impl PkarrPublisher { -277 /// Returns a [`PkarrPublisherBuilder`] that publishes endpoint info to a [pkarr] relay at `pkarr_relay`. -278 /// -279 /// If no further options are set, the pkarr publisher will use [`DEFAULT_PKARR_TTL`] as the -280 /// time-to-live value for the published packets, and it will republish Address Lookup information -281 /// every [`DEFAULT_REPUBLISH_INTERVAL`], even if the information is unchanged. -282 /// -283 /// [`PkarrPublisherBuilder`] implements [`AddressLookupBuilder`], so it can be passed to [`address_lookup`]. -284 /// It will then use the endpoint's secret key to sign published packets. -285 /// -286 /// [`address_lookup`]: crate::endpoint::Builder::address_lookup -287 /// [pkarr]: https://pkarr.org -288 pub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder { -289 PkarrPublisherBuilder::new(pkarr_relay) -290 } -291 -292 /// Creates a new [`PkarrPublisher`] with a custom TTL and republish intervals. -293 /// -294 /// This allows creating the publisher with custom time-to-live values of the -295 /// [`SignedPacket`]s as well as a custom republish interval. -296 fn new( -297 secret_key: SecretKey, -298 pkarr_relay: Url, -299 ttl: u32, -300 republish_interval: Duration, -301 #[cfg(not(wasm_browser))] dns_resolver: DnsResolver, -302 tls_config: rustls::ClientConfig, -303 addr_filter: AddrFilter, -304 ) -> Self { -305 debug!("creating pkarr publisher that publishes to {pkarr_relay}"); -306 let endpoint_id = secret_key.public(); -307 -308 #[cfg(wasm_browser)] -309 let pkarr_client = PkarrRelayClient::new(pkarr_relay); -310 -311 #[cfg(not(wasm_browser))] -312 let pkarr_client = PkarrRelayClient::new(pkarr_relay, tls_config, dns_resolver); -313 -314 let watchable = Watchable::default(); -315 let service = PublisherService { -316 ttl, -317 watcher: watchable.watch(), -318 secret_key, -319 pkarr_client, -320 republish_interval, -321 }; -322 let join_handle = task::spawn(service.run().instrument(error_span!("pkarr_publish"))); -323 Self { -324 watchable, -325 endpoint_id, -326 addr_filter, -327 _drop_guard: Arc::new(AbortOnDropHandle::new(join_handle)), -328 } -329 } -330 -331 /// Creates a pkarr publisher which uses the [number 0] pkarr relay server. -332 /// -333 /// This uses the pkarr relay server operated by [number 0], at -334 /// [`N0_DNS_PKARR_RELAY_PROD`]. -335 /// -336 /// When running with the environment variable -337 /// `IROH_FORCE_STAGING_RELAYS` set to any non empty value [`N0_DNS_PKARR_RELAY_STAGING`] -338 /// server is used instead. -339 /// -340 /// [number 0]: https://n0.computer -341 pub fn n0_dns() -> PkarrPublisherBuilder { -342 PkarrPublisherBuilder::n0_dns() -343 } -344 -345 /// Publishes the addressing information about this endpoint to a pkarr relay. -346 /// -347 /// This is a nonblocking function, the actual update is performed in the background. -348 pub fn update_endpoint_data(&self, data: &EndpointData) { -349 let data = data.apply_filter(&self.addr_filter).into_owned(); -350 let info = EndpointInfo::from_parts(self.endpoint_id, data); -351 self.watchable.set(Some(info)).ok(); -352 } -353} -354 -355impl AddressLookup for PkarrPublisher { -356 fn publish(&self, data: &EndpointData) { -357 self.update_endpoint_data(data); -358 } -359} -360 -361/// Publish endpoint info to a pkarr relay. -362#[derive(derive_more::Debug, Clone)] -363struct PublisherService { -364 #[debug("SecretKey")] -365 secret_key: SecretKey, -366 #[debug("PkarrClient")] -367 pkarr_client: PkarrRelayClient, -368 watcher: n0_watcher::Direct<Option<EndpointInfo>>, -369 ttl: u32, -370 republish_interval: Duration, -371} -372 -373impl PublisherService { -374 async fn run(mut self) { -375 let mut failed_attempts = 0; -376 let republish = time::sleep(Duration::MAX); -377 tokio::pin!(republish); -378 loop { -379 if !self.watcher.is_connected() { -380 break; -381 } -382 if let Some(info) = self.watcher.get() { -383 match self.publish_current(info).await { -384 Err(err) => { -385 failed_attempts += 1; -386 // Retry after increasing timeout -387 let retry_after = Duration::from_secs(failed_attempts); -388 republish.as_mut().reset(Instant::now() + retry_after); -389 warn!( -390 err = %format!("{err:#}"), -391 url = %self.pkarr_client.pkarr_relay_url , -392 ?retry_after, -393 %failed_attempts, -394 "Failed to publish to pkarr", -395 ); -396 } -397 Ok(()) => { -398 failed_attempts = 0; -399 // Republish after fixed interval -400 republish -401 .as_mut() -402 .reset(Instant::now() + self.republish_interval); -403 } -404 } -405 } -406 // Wait until either the retry/republish timeout is reached, or the endpoint info changed. -407 tokio::select! { -408 res = self.watcher.updated() => match res { -409 Ok(_) => debug!("Publish endpoint info to pkarr (info changed)"), -410 Err(Disconnected { .. }) => break, -411 }, -412 _ = &mut republish => debug!("Publish endpoint info to pkarr (interval elapsed)"), -413 } -414 } -415 } -416 -417 async fn publish_current(&self, info: EndpointInfo) -> Result<(), PkarrError> { -418 debug!( -419 data = ?info.data, -420 pkarr_relay = %self.pkarr_client.pkarr_relay_url, -421 "Publishing endpoint info to pkarr" -422 ); -423 let signed_packet = info -424 .to_pkarr_signed_packet(&self.secret_key, self.ttl) -425 .map_err(|err| e!(PkarrError::Encoding, err))?; -426 self.pkarr_client.publish(&signed_packet).await?; -427 trace!( -428 data = ?info.data, -429 pkarr_relay = %self.pkarr_client.pkarr_relay_url, -430 "Published endpoint info to pkarr" -431 ); -432 Ok(()) -433 } -434} -435 -436/// Builder for [`PkarrResolver`]. -437/// -438/// See [`PkarrResolver::builder`]. -439#[derive(Debug)] -440pub struct PkarrResolverBuilder { -441 pkarr_relay: Url, -442 #[cfg(not(wasm_browser))] -443 dns_resolver: Option<DnsResolver>, -444} -445 -446impl PkarrResolverBuilder { -447 /// Sets the DNS resolver to use for resolving the pkarr relay URL. -448 #[cfg(not(wasm_browser))] -449 pub fn dns_resolver(mut self, dns_resolver: DnsResolver) -> Self { -450 self.dns_resolver = Some(dns_resolver); -451 self -452 } -453 -454 /// Creates a [`PkarrResolver`] from this builder. -455 pub fn build(self, tls_config: rustls::ClientConfig) -> PkarrResolver { -456 #[cfg(wasm_browser)] -457 let pkarr_client = PkarrRelayClient::new(self.pkarr_relay); -458 -459 #[cfg(not(wasm_browser))] -460 let pkarr_client = PkarrRelayClient::new( -461 self.pkarr_relay, -462 tls_config, -463 self.dns_resolver.unwrap_or_default(), -464 ); -465 -466 PkarrResolver { pkarr_client } -467 } -468} -469 -470impl AddressLookupBuilder for PkarrResolverBuilder { -471 fn into_address_lookup( -472 mut self, -473 endpoint: &Endpoint, -474 ) -> Result<impl AddressLookup, AddressLookupBuilderError> { -475 #[cfg(not(wasm_browser))] -476 if self.dns_resolver.is_none() { -477 self.dns_resolver = Some(endpoint.dns_resolver()?.clone()); -478 } -479 let tls_config = endpoint.tls_config().clone(); -480 Ok(self.build(tls_config)) -481 } -482} -483 -484/// Resolver of address lookup information from a [pkarr] relay. -485/// -486/// The resolver uses HTTP to query address lookup information from a pkarr relay server, -487/// see the [module docs] for details. -488/// -489/// This implements the [`AddressLookup`] trait to be used as an address lookup service. Note -490/// that it only resolves address lookup information, for the corresponding publisher use -491/// the [`PkarrPublisher`] together with [`AddressLookupServices`]. -492/// -493/// [pkarr]: https://pkarr.org -494/// [module docs]: crate::address_lookup::pkarr -495/// [`AddressLookupServices`]: super::AddressLookupServices -496#[derive(derive_more::Debug, Clone)] -497pub struct PkarrResolver { -498 pkarr_client: PkarrRelayClient, -499} -500 -501impl PkarrResolver { -502 /// Creates a new resolver builder using the pkarr relay server at the URL. -503 /// -504 /// The builder implements [`AddressLookupBuilder`]. -505 pub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder { -506 PkarrResolverBuilder { -507 pkarr_relay, -508 #[cfg(not(wasm_browser))] -509 dns_resolver: None, -510 } -511 } -512 -513 /// Creates a pkarr resolver builder which uses the [number 0] pkarr relay server. -514 /// -515 /// This uses the pkarr relay server operated by [number 0] at -516 /// [`N0_DNS_PKARR_RELAY_PROD`]. -517 /// -518 /// When running with the environment variable `IROH_FORCE_STAGING_RELAYS` -519 /// set to any non empty value [`N0_DNS_PKARR_RELAY_STAGING`] -520 /// server is used instead. -521 /// -522 /// [number 0]: https://n0.computer -523 pub fn n0_dns() -> PkarrResolverBuilder { -524 let pkarr_relay = match force_staging_infra() { -525 true => N0_DNS_PKARR_RELAY_STAGING, -526 false => N0_DNS_PKARR_RELAY_PROD, -527 }; -528 -529 let pkarr_relay: Url = pkarr_relay.parse().expect("url is valid"); -530 Self::builder(pkarr_relay) -531 } -532} -533 -534impl AddressLookup for PkarrResolver { -535 fn resolve( -536 &self, -537 endpoint_id: EndpointId, -538 ) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>> { -539 let pkarr_client = self.pkarr_client.clone(); -540 let fut = async move { -541 let signed_packet = pkarr_client.resolve(endpoint_id).await?; -542 let info = EndpointInfo::from_pkarr_signed_packet(&signed_packet) -543 .map_err(|err| AddressLookupError::from_err_any("pkarr", err))?; -544 let item = AddressLookupItem::new(info, "pkarr", None); -545 Ok(item) -546 }; -547 let stream = n0_future::stream::once_future(fut); -548 Some(Box::pin(stream)) -549 } -550} -551 -552/// A [pkarr](https://pkarr.org) client to publish [`SignedPacket`]s to a pkarr relay. -553/// -554/// [pkarr]: https://pkarr.org -555#[derive(Debug, Clone)] -556pub struct PkarrRelayClient { -557 http_client: reqwest::Client, -558 pkarr_relay_url: Url, -559} -560 -561/// A builder for the [`PkarrRelayClient`] -562#[derive(Debug, Clone)] -563pub struct PkarrRelayClientBuilder { -564 pkarr_relay_url: Url, -565 #[cfg(not(wasm_browser))] -566 dns_resolver: DnsResolver, +262/// By default this publisher only publishes the [`RelayUrl`], to avoid leaking IP addresses to +263/// the public pkarr server. Which addresses are published is controlled by the [`AddrFilter`] +264/// set via [`PkarrPublisherBuilder::addr_filter`]. +265/// +266/// [pkarr]: https://pkarr.org +267/// [module docs]: crate::address_lookup::pkarr +268/// [`RelayUrl`]: crate::RelayUrl +269/// [`AddressLookupServices`]: super::AddressLookupServices +270#[derive(derive_more::Debug, Clone)] +271pub struct PkarrPublisher { +272 endpoint_id: EndpointId, +273 watchable: Watchable<Option<EndpointInfo>>, +274 addr_filter: AddrFilter, +275 _drop_guard: Arc<AbortOnDropHandle<()>>, +276} +277 +278impl PkarrPublisher { +279 /// Returns a [`PkarrPublisherBuilder`] that publishes endpoint info to a [pkarr] relay at `pkarr_relay`. +280 /// +281 /// If no further options are set, the pkarr publisher will use [`DEFAULT_PKARR_TTL`] as the +282 /// time-to-live value for the published packets, and it will republish Address Lookup information +283 /// every [`DEFAULT_REPUBLISH_INTERVAL`], even if the information is unchanged. +284 /// +285 /// [`PkarrPublisherBuilder`] implements [`AddressLookupBuilder`], so it can be passed to [`address_lookup`]. +286 /// It will then use the endpoint's secret key to sign published packets. +287 /// +288 /// [`address_lookup`]: crate::endpoint::Builder::address_lookup +289 /// [pkarr]: https://pkarr.org +290 pub fn builder(pkarr_relay: Url) -> PkarrPublisherBuilder { +291 PkarrPublisherBuilder::new(pkarr_relay) +292 } +293 +294 /// Creates a new [`PkarrPublisher`] with a custom TTL and republish intervals. +295 /// +296 /// This allows creating the publisher with custom time-to-live values of the +297 /// [`SignedPacket`]s as well as a custom republish interval. +298 fn new( +299 secret_key: SecretKey, +300 pkarr_relay: Url, +301 ttl: u32, +302 republish_interval: Duration, +303 #[cfg(not(wasm_browser))] dns_resolver: DnsResolver, +304 tls_config: rustls::ClientConfig, +305 addr_filter: AddrFilter, +306 ) -> Self { +307 debug!("creating pkarr publisher that publishes to {pkarr_relay}"); +308 let endpoint_id = secret_key.public(); +309 +310 #[cfg(wasm_browser)] +311 let pkarr_client = PkarrRelayClient::new(pkarr_relay); +312 +313 #[cfg(not(wasm_browser))] +314 let pkarr_client = PkarrRelayClient::new(pkarr_relay, tls_config, dns_resolver); +315 +316 let watchable = Watchable::default(); +317 let service = PublisherService { +318 ttl, +319 watcher: watchable.watch(), +320 secret_key, +321 pkarr_client, +322 republish_interval, +323 }; +324 let join_handle = task::spawn(service.run().instrument(error_span!("pkarr_publish"))); +325 Self { +326 watchable, +327 endpoint_id, +328 addr_filter, +329 _drop_guard: Arc::new(AbortOnDropHandle::new(join_handle)), +330 } +331 } +332 +333 /// Creates a pkarr publisher which uses the [number 0] pkarr relay server. +334 /// +335 /// This uses the pkarr relay server operated by [number 0], at +336 /// [`N0_DNS_PKARR_RELAY_PROD`]. +337 /// +338 /// When running with the environment variable +339 /// `IROH_FORCE_STAGING_RELAYS` set to any non empty value [`N0_DNS_PKARR_RELAY_STAGING`] +340 /// server is used instead. +341 /// +342 /// [number 0]: https://n0.computer +343 pub fn n0_dns() -> PkarrPublisherBuilder { +344 PkarrPublisherBuilder::n0_dns() +345 } +346 +347 /// Publishes the addressing information about this endpoint to a pkarr relay. +348 /// +349 /// This is a nonblocking function, the actual update is performed in the background. +350 pub fn update_endpoint_data(&self, data: &EndpointData) { +351 let data = data.apply_filter(&self.addr_filter).into_owned(); +352 let info = EndpointInfo::from_parts(self.endpoint_id, data); +353 self.watchable.set(Some(info)).ok(); +354 } +355} +356 +357impl AddressLookup for PkarrPublisher { +358 fn publish(&self, data: &EndpointData) { +359 self.update_endpoint_data(data); +360 } +361} +362 +363/// Publish endpoint info to a pkarr relay. +364#[derive(derive_more::Debug, Clone)] +365struct PublisherService { +366 #[debug("SecretKey")] +367 secret_key: SecretKey, +368 #[debug("PkarrClient")] +369 pkarr_client: PkarrRelayClient, +370 watcher: n0_watcher::Direct<Option<EndpointInfo>>, +371 ttl: u32, +372 republish_interval: Duration, +373} +374 +375impl PublisherService { +376 async fn run(mut self) { +377 let mut failed_attempts = 0; +378 let republish = time::sleep(Duration::MAX); +379 tokio::pin!(republish); +380 loop { +381 if !self.watcher.is_connected() { +382 break; +383 } +384 if let Some(info) = self.watcher.get() { +385 match self.publish_current(info).await { +386 Err(err) => { +387 failed_attempts += 1; +388 // Retry after increasing timeout +389 let retry_after = Duration::from_secs(failed_attempts); +390 republish.as_mut().reset(Instant::now() + retry_after); +391 warn!( +392 err = %format!("{err:#}"), +393 url = %self.pkarr_client.pkarr_relay_url , +394 ?retry_after, +395 %failed_attempts, +396 "Failed to publish to pkarr", +397 ); +398 } +399 Ok(()) => { +400 failed_attempts = 0; +401 // Republish after fixed interval +402 republish +403 .as_mut() +404 .reset(Instant::now() + self.republish_interval); +405 } +406 } +407 } +408 // Wait until either the retry/republish timeout is reached, or the endpoint info changed. +409 tokio::select! { +410 res = self.watcher.updated() => match res { +411 Ok(_) => debug!("Publish endpoint info to pkarr (info changed)"), +412 Err(Disconnected { .. }) => break, +413 }, +414 _ = &mut republish => debug!("Publish endpoint info to pkarr (interval elapsed)"), +415 } +416 } +417 } +418 +419 async fn publish_current(&self, info: EndpointInfo) -> Result<(), PkarrError> { +420 debug!( +421 data = ?info.data, +422 pkarr_relay = %self.pkarr_client.pkarr_relay_url, +423 "Publishing endpoint info to pkarr" +424 ); +425 let signed_packet = info +426 .to_pkarr_signed_packet(&self.secret_key, self.ttl) +427 .map_err(|err| e!(PkarrError::Encoding, err))?; +428 self.pkarr_client.publish(&signed_packet).await?; +429 trace!( +430 data = ?info.data, +431 pkarr_relay = %self.pkarr_client.pkarr_relay_url, +432 "Published endpoint info to pkarr" +433 ); +434 Ok(()) +435 } +436} +437 +438/// Builder for [`PkarrResolver`]. +439/// +440/// See [`PkarrResolver::builder`]. +441#[derive(Debug)] +442pub struct PkarrResolverBuilder { +443 pkarr_relay: Url, +444 #[cfg(not(wasm_browser))] +445 dns_resolver: Option<DnsResolver>, +446} +447 +448impl PkarrResolverBuilder { +449 /// Sets the DNS resolver to use for resolving the pkarr relay URL. +450 #[cfg(not(wasm_browser))] +451 pub fn dns_resolver(mut self, dns_resolver: DnsResolver) -> Self { +452 self.dns_resolver = Some(dns_resolver); +453 self +454 } +455 +456 /// Creates a [`PkarrResolver`] from this builder. +457 pub fn build(self, tls_config: rustls::ClientConfig) -> PkarrResolver { +458 #[cfg(wasm_browser)] +459 let pkarr_client = PkarrRelayClient::new(self.pkarr_relay); +460 +461 #[cfg(not(wasm_browser))] +462 let pkarr_client = PkarrRelayClient::new( +463 self.pkarr_relay, +464 tls_config, +465 self.dns_resolver.unwrap_or_default(), +466 ); +467 +468 PkarrResolver { pkarr_client } +469 } +470} +471 +472impl AddressLookupBuilder for PkarrResolverBuilder { +473 fn into_address_lookup( +474 mut self, +475 endpoint: &Endpoint, +476 ) -> Result<impl AddressLookup, AddressLookupBuilderError> { +477 #[cfg(not(wasm_browser))] +478 if self.dns_resolver.is_none() { +479 self.dns_resolver = Some(endpoint.dns_resolver()?.clone()); +480 } +481 let tls_config = endpoint.tls_config().clone(); +482 Ok(self.build(tls_config)) +483 } +484} +485 +486/// Resolver of address lookup information from a [pkarr] relay. +487/// +488/// The resolver uses HTTP to query address lookup information from a pkarr relay server, +489/// see the [module docs] for details. +490/// +491/// This implements the [`AddressLookup`] trait to be used as an address lookup service. Note +492/// that it only resolves address lookup information, for the corresponding publisher use +493/// the [`PkarrPublisher`] together with [`AddressLookupServices`]. +494/// +495/// [pkarr]: https://pkarr.org +496/// [module docs]: crate::address_lookup::pkarr +497/// [`AddressLookupServices`]: super::AddressLookupServices +498#[derive(derive_more::Debug, Clone)] +499pub struct PkarrResolver { +500 pkarr_client: PkarrRelayClient, +501} +502 +503impl PkarrResolver { +504 /// Creates a new resolver builder using the pkarr relay server at the URL. +505 /// +506 /// The builder implements [`AddressLookupBuilder`]. +507 pub fn builder(pkarr_relay: Url) -> PkarrResolverBuilder { +508 PkarrResolverBuilder { +509 pkarr_relay, +510 #[cfg(not(wasm_browser))] +511 dns_resolver: None, +512 } +513 } +514 +515 /// Creates a pkarr resolver builder which uses the [number 0] pkarr relay server. +516 /// +517 /// This uses the pkarr relay server operated by [number 0] at +518 /// [`N0_DNS_PKARR_RELAY_PROD`]. +519 /// +520 /// When running with the environment variable `IROH_FORCE_STAGING_RELAYS` +521 /// set to any non empty value [`N0_DNS_PKARR_RELAY_STAGING`] +522 /// server is used instead. +523 /// +524 /// [number 0]: https://n0.computer +525 pub fn n0_dns() -> PkarrResolverBuilder { +526 let pkarr_relay = match force_staging_infra() { +527 true => N0_DNS_PKARR_RELAY_STAGING, +528 false => N0_DNS_PKARR_RELAY_PROD, +529 }; +530 +531 let pkarr_relay: Url = pkarr_relay.parse().expect("url is valid"); +532 Self::builder(pkarr_relay) +533 } +534} +535 +536impl AddressLookup for PkarrResolver { +537 fn resolve( +538 &self, +539 endpoint_id: EndpointId, +540 ) -> Option<BoxStream<Result<AddressLookupItem, AddressLookupError>>> { +541 let pkarr_client = self.pkarr_client.clone(); +542 let fut = async move { +543 let signed_packet = pkarr_client.resolve(endpoint_id).await?; +544 let info = EndpointInfo::from_pkarr_signed_packet(&signed_packet) +545 .map_err(|err| AddressLookupError::from_err_any("pkarr", err))?; +546 let item = AddressLookupItem::new(info, "pkarr", None); +547 Ok(item) +548 }; +549 let stream = n0_future::stream::once_future(fut); +550 Some(Box::pin(stream)) +551 } +552} +553 +554/// A [pkarr](https://pkarr.org) client to publish [`SignedPacket`]s to a pkarr relay. +555/// +556/// [pkarr]: https://pkarr.org +557#[derive(Debug, Clone)] +558pub struct PkarrRelayClient { +559 http_client: reqwest::Client, +560 pkarr_relay_url: Url, +561} +562 +563/// A builder for the [`PkarrRelayClient`] +564#[derive(Debug, Clone)] +565pub struct PkarrRelayClientBuilder { +566 pkarr_relay_url: Url, 567 #[cfg(not(wasm_browser))] -568 tls_config: rustls::ClientConfig, -569} -570 -571impl PkarrRelayClientBuilder { -572 /// Build a [`PkarrRelayClient`]. -573 pub fn build(self) -> PkarrRelayClient { -574 #[cfg(not(wasm_browser))] -575 let builder = reqwest_client_builder(self.tls_config, self.dns_resolver); -576 -577 #[cfg(wasm_browser)] -578 let builder = reqwest_client_builder(); -579 -580 let http_client = builder.build().expect("failed to create reqwest client"); -581 PkarrRelayClient { -582 http_client, -583 pkarr_relay_url: self.pkarr_relay_url, -584 } -585 } -586} -587 -588impl PkarrRelayClient { -589 /// Creates a [`PkarrRelayClient`]. -590 #[cfg(not(wasm_browser))] -591 pub fn new( -592 pkarr_relay_url: Url, -593 tls_config: rustls::ClientConfig, -594 dns_resolver: DnsResolver, -595 ) -> Self { -596 let http_client = reqwest_client_builder(tls_config, dns_resolver) -597 .build() -598 .expect("failed to create reqwest client"); -599 Self { -600 http_client, -601 pkarr_relay_url, -602 } -603 } -604 -605 /// Creates a [`PkarrRelayClient`]. -606 #[cfg(wasm_browser)] -607 pub fn new(pkarr_relay_url: Url) -> Self { -608 let http_client = reqwest_client_builder() -609 .build() -610 .expect("failed to create reqwest client"); -611 Self { -612 http_client, -613 pkarr_relay_url, -614 } -615 } -616 -617 /// Resolves a [`SignedPacket`] for the given [`EndpointId`]. -618 pub async fn resolve( -619 &self, -620 endpoint_id: EndpointId, -621 ) -> Result<SignedPacket, AddressLookupError> { -622 let mut url = self.pkarr_relay_url.clone(); -623 url.path_segments_mut() -624 .map_err(|_| { -625 e!(PkarrError::InvalidRelayUrl { -626 url: self.pkarr_relay_url.clone().into() -627 }) -628 })? -629 .push(&endpoint_id.to_z32()); -630 -631 let response = self -632 .http_client -633 .get(url) -634 .send() -635 .await -636 .map_err(|err| e!(PkarrError::HttpSend, anyerr!(err)))?; -637 -638 if !response.status().is_success() { -639 return Err(e!(PkarrError::HttpRequest { -640 status: response.status() -641 }) -642 .into()); -643 } -644 -645 let payload = response -646 .bytes() -647 .await -648 .map_err(|err| e!(PkarrError::HttpPayload, anyerr!(err)))?; -649 let packet = SignedPacket::from_relay_payload(&endpoint_id, &payload) -650 .map_err(|err| e!(PkarrError::Verify, err))?; -651 Ok(packet) -652 } -653 -654 /// Publishes a [`SignedPacket`]. -655 pub async fn publish(&self, signed_packet: &SignedPacket) -> Result<(), PkarrError> { -656 let mut url = self.pkarr_relay_url.clone(); -657 url.path_segments_mut() -658 .map_err(|_| { -659 e!(PkarrError::InvalidRelayUrl { -660 url: self.pkarr_relay_url.clone().into() -661 }) -662 })? -663 .push(&signed_packet.public_key().to_z32()); -664 -665 let response = self -666 .http_client -667 .put(url) -668 .body(signed_packet.to_relay_payload()) -669 .send() -670 .await -671 .map_err(|err| e!(PkarrError::HttpSend, anyerr!(err)))?; -672 -673 if !response.status().is_success() { -674 return Err(e!(PkarrError::HttpRequest { -675 status: response.status() -676 })); -677 } -678 -679 Ok(()) -680 } -681}

    \ No newline at end of file +568 dns_resolver: DnsResolver, +569 #[cfg(not(wasm_browser))] +570 tls_config: rustls::ClientConfig, +571} +572 +573impl PkarrRelayClientBuilder { +574 /// Build a [`PkarrRelayClient`]. +575 pub fn build(self) -> PkarrRelayClient { +576 #[cfg(not(wasm_browser))] +577 let builder = reqwest_client_builder(self.tls_config, self.dns_resolver); +578 +579 #[cfg(wasm_browser)] +580 let builder = reqwest_client_builder(); +581 +582 let http_client = builder.build().expect("failed to create reqwest client"); +583 PkarrRelayClient { +584 http_client, +585 pkarr_relay_url: self.pkarr_relay_url, +586 } +587 } +588} +589 +590impl PkarrRelayClient { +591 /// Creates a [`PkarrRelayClient`]. +592 #[cfg(not(wasm_browser))] +593 pub fn new( +594 pkarr_relay_url: Url, +595 tls_config: rustls::ClientConfig, +596 dns_resolver: DnsResolver, +597 ) -> Self { +598 let http_client = reqwest_client_builder(tls_config, dns_resolver) +599 .build() +600 .expect("failed to create reqwest client"); +601 Self { +602 http_client, +603 pkarr_relay_url, +604 } +605 } +606 +607 /// Creates a [`PkarrRelayClient`]. +608 #[cfg(wasm_browser)] +609 pub fn new(pkarr_relay_url: Url) -> Self { +610 let http_client = reqwest_client_builder() +611 .build() +612 .expect("failed to create reqwest client"); +613 Self { +614 http_client, +615 pkarr_relay_url, +616 } +617 } +618 +619 /// Resolves a [`SignedPacket`] for the given [`EndpointId`]. +620 pub async fn resolve( +621 &self, +622 endpoint_id: EndpointId, +623 ) -> Result<SignedPacket, AddressLookupError> { +624 let mut url = self.pkarr_relay_url.clone(); +625 url.path_segments_mut() +626 .map_err(|_| { +627 e!(PkarrError::InvalidRelayUrl { +628 url: self.pkarr_relay_url.clone().into() +629 }) +630 })? +631 .push(&endpoint_id.to_z32()); +632 +633 let response = self +634 .http_client +635 .get(url) +636 .send() +637 .await +638 .map_err(|err| e!(PkarrError::HttpSend, anyerr!(err)))?; +639 +640 if !response.status().is_success() { +641 return Err(e!(PkarrError::HttpRequest { +642 status: response.status() +643 }) +644 .into()); +645 } +646 +647 let payload = response +648 .bytes() +649 .await +650 .map_err(|err| e!(PkarrError::HttpPayload, anyerr!(err)))?; +651 let packet = SignedPacket::from_relay_payload(&endpoint_id, &payload) +652 .map_err(|err| e!(PkarrError::Verify, err))?; +653 Ok(packet) +654 } +655 +656 /// Publishes a [`SignedPacket`]. +657 pub async fn publish(&self, signed_packet: &SignedPacket) -> Result<(), PkarrError> { +658 let mut url = self.pkarr_relay_url.clone(); +659 url.path_segments_mut() +660 .map_err(|_| { +661 e!(PkarrError::InvalidRelayUrl { +662 url: self.pkarr_relay_url.clone().into() +663 }) +664 })? +665 .push(&signed_packet.public_key().to_z32()); +666 +667 let response = self +668 .http_client +669 .put(url) +670 .body(signed_packet.to_relay_payload()) +671 .send() +672 .await +673 .map_err(|err| e!(PkarrError::HttpSend, anyerr!(err)))?; +674 +675 if !response.status().is_success() { +676 return Err(e!(PkarrError::HttpRequest { +677 status: response.status() +678 })); +679 } +680 +681 Ok(()) +682 } +683}
    \ No newline at end of file diff --git a/pr/4036/docs/src/iroh/defaults.rs.html b/pr/4036/docs/src/iroh/defaults.rs.html index 6a0c34d787..e7c32683c4 100644 --- a/pr/4036/docs/src/iroh/defaults.rs.html +++ b/pr/4036/docs/src/iroh/defaults.rs.html @@ -69,7 +69,7 @@ 69 RelayConfig::from(RelayUrl::from(url)) 70 } 71 -72 /// Get the default [`RelayConfig`] for Asia-Pacific +72 /// Get the default [`RelayConfig`] for Asia-Pacific. 73 pub fn default_ap_relay() -> RelayConfig { 74 // The default Asia-Pacific relay server run by number0. 75 let url: Url = format!("https://{AP_RELAY_HOSTNAME}") diff --git a/pr/4036/docs/src/iroh/endpoint.rs.html b/pr/4036/docs/src/iroh/endpoint.rs.html index 8f7687d879..da39799c38 100644 --- a/pr/4036/docs/src/iroh/endpoint.rs.html +++ b/pr/4036/docs/src/iroh/endpoint.rs.html @@ -400,7 +400,7 @@ 400 /// socket should be bound or the routing will be non-deterministic. 401 /// 402 /// To use a subnet with a non-zero prefix length as the default route in addition to -403 /// being routed when its prefix matches, use [`BindOpts::set_is_default_route]. +403 /// being routed when its prefix matches, use [`BindOpts::set_is_default_route`]. 404 /// Subnets with a prefix length of zero are always marked as default routes. 405 /// 406 /// Finally note that most outgoing datagrams are part of an existing network flow. That @@ -601,7 +601,7 @@ 601 /// 602 /// This filter is applied once, at the [`AddressLookupServices`] level, before 603 /// distributing data to any individual address lookup service. This ensures -604 /// consistent filtering regardless of how the services configured. +604 /// consistent filtering regardless of how the services are configured. 605 /// 606 /// [`AddressLookupServices`]: crate::address_lookup::AddressLookupServices 607 pub fn addr_filter(mut self, filter: AddrFilter) -> Self { @@ -842,7 +842,7 @@ 842/// [`Endpoint::connect`] and [`Endpoint::accept`] methods. Once established, the 843/// [`Connection`] gives access to most [QUIC] features. Individual streams to send data to 844/// the peer are created using the [`Connection::open_bi`], [`Connection::accept_bi`], -845/// [`Connection::open_uni`] and [`Connection::open_bi`] functions. +845/// [`Connection::open_uni`] and [`Connection::accept_uni`] functions. 846/// 847/// Note that due to the light-weight properties of streams a stream will only be accepted 848/// once the initiating peer has sent some data on it. @@ -1186,8 +1186,8 @@ 1186 /// understand if the endpoint has ever been considered "online". But after 1187 /// that initial call to [`Endpoint::online`], to understand if your 1188 /// endpoint is no longer able to be connected to by endpoints outside -1189 /// of the private or local network, watch for changes in it's [`EndpointAddr`]. -1190 /// If there are no `addrs`in the [`EndpointAddr`], you may not be dialable by other endpoints +1189 /// of the private or local network, watch for changes in its [`EndpointAddr`]. +1190 /// If there are no `addrs` in the [`EndpointAddr`], you may not be dialable by other endpoints 1191 /// on the internet. 1192 /// 1193 /// The `EndpointAddr` will change as: @@ -1299,2704 +1299,2706 @@ 1299 /// 1300 /// # Examples 1301 /// -1302 /// ```no run -1303 /// use iroh::Endpoint; -1304 /// -1305 /// #[tokio::main] -1306 /// async fn main() { -1307 /// // After this await returns, the endpoint is bound to a local socket. -1308 /// // It can be dialed, but almost certainly hasn't finished picking a -1309 /// // relay. -1310 /// let endpoint = Endpoint::bind().await; -1311 /// -1312 /// // After this await returns we have a connection to at least one relay -1313 /// // and holepunching should work as expected. -1314 /// endpoint.online().await; -1315 /// } -1316 /// ``` -1317 pub async fn online(&self) { -1318 let mut watcher = self.inner.home_relay_status(); -1319 let mut value = watcher.get(); -1320 loop { -1321 if value.into_iter().any(|status| status.is_connected()) { -1322 return; -1323 } -1324 value = match watcher.updated().await { -1325 Ok(value) => value, -1326 Err(_disconnected) => { -1327 std::future::pending::<()>().await; -1328 break; -1329 } -1330 } -1331 } -1332 } -1333 -1334 /// Returns a [`Watcher`] over the connection status of the endpoint's home relays. -1335 /// -1336 /// The watched value has one entry per home relay whose URL is known, -1337 /// and is empty when no relays are configured or before the endpoint has -1338 /// selected one the home relay from the list of configured relays. -1339 /// The watcher updates whenever any home relay's connection status changes. -1340 /// See [`RelayStatus`] for the information available on each entry. -1341 /// -1342 /// The returned watcher only becomes disconnected once the last clone of -1343 /// the [`Endpoint`] is dropped. Closing the endpoint does not disconnect -1344 /// the watcher. To stop a task once the endpoint stops, combine with -1345 /// [`Self::closed`]. -1346 pub fn home_relay_status(&self) -> impl Watcher<Value = Vec<RelayStatus>> + use<> { -1347 self.inner.home_relay_status() -1348 } -1349 -1350 /// Returns a [`Watcher`] for any net-reports run from this [`Endpoint`]. -1351 /// -1352 /// A `net-report` checks the network conditions of the [`Endpoint`], such as -1353 /// whether it is connected to the internet via Ipv4 and/or Ipv6, its NAT -1354 /// status, its latency to the relay servers, and its public addresses. -1355 /// -1356 /// The [`Endpoint`] continuously runs `net-reports` to monitor if network -1357 /// conditions have changed. This [`Watcher`] will return the latest result -1358 /// of the `net-report`. -1359 /// -1360 /// When issuing the first call to this method the first report might -1361 /// still be underway, in this case the [`Watcher`] might not be initialized -1362 /// with [`Some`] value yet. Once the net-report has been successfully -1363 /// run, the [`Watcher`] will always return [`Some`] report immediately, which -1364 /// is the most recently run `net-report`. -1365 /// -1366 /// The returned watcher only becomes disconnected once the last clone of the [`Endpoint`] -1367 /// is dropped. Closing the endpoint does not disconnect the watcher. Thus, a stream created -1368 /// via [`Watcher::stream`] only terminates once the endpoint stops. If you want to stop a -1369 /// task once the endpoint stops combine with [`Self::closed`]. -1370 /// -1371 /// # Examples +1302 /// ```no_run +1303 /// # #[cfg(with_crypto_provider)] +1304 /// # { +1305 /// # #[tokio::main] +1306 /// # async fn main() -> n0_error::Result<()> { +1307 /// # use iroh::{Endpoint, endpoint::presets}; +1308 /// // After this await returns, the endpoint is bound to a local socket. +1309 /// // It can be dialed, but almost certainly hasn't finished picking a +1310 /// // relay. +1311 /// let endpoint = Endpoint::bind(presets::N0).await?; +1312 /// +1313 /// // After this await returns we have a connection to at least one relay +1314 /// // and holepunching should work as expected. +1315 /// endpoint.online().await; +1316 /// # Ok(()) } +1317 /// # } +1318 /// ``` +1319 pub async fn online(&self) { +1320 let mut watcher = self.inner.home_relay_status(); +1321 let mut value = watcher.get(); +1322 loop { +1323 if value.into_iter().any(|status| status.is_connected()) { +1324 return; +1325 } +1326 value = match watcher.updated().await { +1327 Ok(value) => value, +1328 Err(_disconnected) => { +1329 std::future::pending::<()>().await; +1330 break; +1331 } +1332 } +1333 } +1334 } +1335 +1336 /// Returns a [`Watcher`] over the connection status of the endpoint's home relays. +1337 /// +1338 /// The watched value has one entry per home relay whose URL is known, +1339 /// and is empty when no relays are configured or before the endpoint has +1340 /// selected a home relay from the list of configured relays. +1341 /// The watcher updates whenever any home relay's connection status changes. +1342 /// See [`RelayStatus`] for the information available on each entry. +1343 /// +1344 /// The returned watcher only becomes disconnected once the last clone of +1345 /// the [`Endpoint`] is dropped. Closing the endpoint does not disconnect +1346 /// the watcher. To stop a task once the endpoint stops, combine with +1347 /// [`Self::closed`]. +1348 pub fn home_relay_status(&self) -> impl Watcher<Value = Vec<RelayStatus>> + use<> { +1349 self.inner.home_relay_status() +1350 } +1351 +1352 /// Returns a [`Watcher`] for any net-reports run from this [`Endpoint`]. +1353 /// +1354 /// A `net-report` checks the network conditions of the [`Endpoint`], such as +1355 /// whether it is connected to the internet via Ipv4 and/or Ipv6, its NAT +1356 /// status, its latency to the relay servers, and its public addresses. +1357 /// +1358 /// The [`Endpoint`] continuously runs `net-reports` to monitor if network +1359 /// conditions have changed. This [`Watcher`] will return the latest result +1360 /// of the `net-report`. +1361 /// +1362 /// When issuing the first call to this method the first report might +1363 /// still be underway, in this case the [`Watcher`] might not be initialized +1364 /// with [`Some`] value yet. Once the net-report has been successfully +1365 /// run, the [`Watcher`] will always return [`Some`] report immediately, which +1366 /// is the most recently run `net-report`. +1367 /// +1368 /// The returned watcher only becomes disconnected once the last clone of the [`Endpoint`] +1369 /// is dropped. Closing the endpoint does not disconnect the watcher. Thus, a stream created +1370 /// via [`Watcher::stream`] only terminates once the endpoint stops. If you want to stop a +1371 /// task once the endpoint stops combine with [`Self::closed`]. 1372 /// -1373 /// To get the first report use [`Watcher::initialized`]: -1374 /// ```no_run -1375 /// # #[cfg(with_crypto_provider)] -1376 /// # { -1377 /// use iroh::{Endpoint, Watcher as _, endpoint::presets}; -1378 /// -1379 /// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap(); -1380 /// # rt.block_on(async move { -1381 /// let ep = Endpoint::bind(presets::N0).await.unwrap(); -1382 /// let _report = ep.net_report().initialized().await; -1383 /// # }); -1384 /// # } -1385 /// ``` -1386 #[doc(hidden)] -1387 pub fn net_report(&self) -> impl Watcher<Value = Option<NetReport>> + use<> { -1388 self.inner.net_report() -1389 } -1390 -1391 /// Returns the last [`NetReport`] generated by this endpoint. -1392 /// -1393 /// Returns `None` if no net report was ever generated. +1373 /// # Examples +1374 /// +1375 /// To get the first report use [`Watcher::initialized`]: +1376 /// ```no_run +1377 /// # #[cfg(with_crypto_provider)] +1378 /// # { +1379 /// use iroh::{Endpoint, Watcher as _, endpoint::presets}; +1380 /// +1381 /// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap(); +1382 /// # rt.block_on(async move { +1383 /// let ep = Endpoint::bind(presets::N0).await.unwrap(); +1384 /// let _report = ep.net_report().initialized().await; +1385 /// # }); +1386 /// # } +1387 /// ``` +1388 #[doc(hidden)] +1389 pub fn net_report(&self) -> impl Watcher<Value = Option<NetReport>> + use<> { +1390 self.inner.net_report() +1391 } +1392 +1393 /// Returns the last [`NetReport`] generated by this endpoint. 1394 /// -1395 /// This method is hidden in the docs because it is not part of the public api -1396 #[doc(hidden)] -1397 pub fn last_net_report(&self) -> Option<NetReport> { -1398 self.inner.net_report().get() -1399 } -1400 -1401 /// Returns the local socket addresses on which the underlying sockets are bound. -1402 /// -1403 /// The [`Endpoint`] always binds on an IPv4 address and also tries to bind on an IPv6 -1404 /// address if available. -1405 #[cfg(not(wasm_browser))] -1406 pub fn bound_sockets(&self) -> Vec<SocketAddr> { -1407 self.inner -1408 .local_addr() -1409 .into_iter() -1410 .filter_map(|addr| addr.into_socket_addr()) -1411 .collect() -1412 } -1413 -1414 // # Methods for less common getters. -1415 // -1416 // Partially they return things passed into the builder. -1417 -1418 /// Returns the DNS resolver used in this [`Endpoint`]. -1419 /// -1420 /// # Errors +1395 /// Returns `None` if no net report was ever generated. +1396 /// +1397 /// This method is hidden in the docs because it is not part of the public api +1398 #[doc(hidden)] +1399 pub fn last_net_report(&self) -> Option<NetReport> { +1400 self.inner.net_report().get() +1401 } +1402 +1403 /// Returns the local socket addresses on which the underlying sockets are bound. +1404 /// +1405 /// The [`Endpoint`] always binds on an IPv4 address and also tries to bind on an IPv6 +1406 /// address if available. +1407 #[cfg(not(wasm_browser))] +1408 pub fn bound_sockets(&self) -> Vec<SocketAddr> { +1409 self.inner +1410 .local_addr() +1411 .into_iter() +1412 .filter_map(|addr| addr.into_socket_addr()) +1413 .collect() +1414 } +1415 +1416 // # Methods for less common getters. +1417 // +1418 // Partially they return things passed into the builder. +1419 +1420 /// Returns the DNS resolver used in this [`Endpoint`]. 1421 /// -1422 /// Returns an `EndpointError::Closed` error if the endpoint is closed. +1422 /// # Errors 1423 /// -1424 /// See [`Builder::dns_resolver`]. -1425 #[cfg(not(wasm_browser))] -1426 pub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError> { -1427 if self.is_closed() { -1428 return Err(e!(EndpointError::Closed)); -1429 } -1430 Ok(self.inner.dns_resolver()) -1431 } -1432 -1433 /// Returns the [`rustls::ClientConfig`] used by the endpoint for connecting to external services. -1434 /// -1435 /// This might be useful for address lookup services or other functions -1436 /// that want to use the same trust anchors as iroh does for verifying the -1437 /// validity of TLS certificates presented by external services. -1438 /// -1439 /// Note that this TLS config is unrelated to how iroh validates the authenticity -1440 /// of iroh connections itself. -1441 /// -1442 /// The config is based on the trust anchors set via [`Builder::ca_tls_config`]. -1443 pub fn tls_config(&self) -> &rustls::ClientConfig { -1444 &self.inner.tls_config -1445 } -1446 -1447 /// Returns the Address Lookup service, if configured. -1448 /// -1449 /// # Errors +1424 /// Returns an `EndpointError::Closed` error if the endpoint is closed. +1425 /// +1426 /// See [`Builder::dns_resolver`]. +1427 #[cfg(not(wasm_browser))] +1428 pub fn dns_resolver(&self) -> Result<&DnsResolver, EndpointError> { +1429 if self.is_closed() { +1430 return Err(e!(EndpointError::Closed)); +1431 } +1432 Ok(self.inner.dns_resolver()) +1433 } +1434 +1435 /// Returns the [`rustls::ClientConfig`] used by the endpoint for connecting to external services. +1436 /// +1437 /// This might be useful for address lookup services or other functions +1438 /// that want to use the same trust anchors as iroh does for verifying the +1439 /// validity of TLS certificates presented by external services. +1440 /// +1441 /// Note that this TLS config is unrelated to how iroh validates the authenticity +1442 /// of iroh connections itself. +1443 /// +1444 /// The config is based on the trust anchors set via [`Builder::ca_tls_config`]. +1445 pub fn tls_config(&self) -> &rustls::ClientConfig { +1446 &self.inner.tls_config +1447 } +1448 +1449 /// Returns the Address Lookup service, if configured. 1450 /// -1451 /// Returns a `EndpointError::Closed` error if the endpoint is closed. +1451 /// # Errors 1452 /// -1453 /// See [`Builder::address_lookup`]. -1454 pub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError> { -1455 if self.is_closed() { -1456 return Err(e!(EndpointError::Closed)); -1457 } -1458 Ok(self.inner.address_lookup()) -1459 } -1460 -1461 /// Returns metrics collected for this endpoint. -1462 /// -1463 /// The endpoint internally collects various metrics about its operation. -1464 /// The returned [`EndpointMetrics`] struct contains all of these metrics. -1465 /// -1466 /// You can access individual metrics directly by using the public fields: -1467 /// ```rust -1468 /// # use std::collections::BTreeMap; -1469 /// # use iroh::endpoint::{Endpoint, presets}; -1470 /// # async fn wrapper() -> n0_error::Result<()> { -1471 /// let endpoint = Endpoint::bind(presets::N0).await?; -1472 /// assert_eq!(endpoint.metrics().socket.recv_datagrams.get(), 0); -1473 /// # Ok(()) -1474 /// # } -1475 /// ``` -1476 /// -1477 /// [`EndpointMetrics`] implements [`MetricsGroupSet`], and each field -1478 /// implements [`MetricsGroup`]. These traits provide methods to iterate over -1479 /// the groups in the set, and over the individual metrics in each group, without having -1480 /// to access each field manually. With these methods, it is straightforward to collect -1481 /// all metrics into a map or push their values to a metrics collector. -1482 /// -1483 /// For example, the following snippet collects all metrics into a map: -1484 /// ```rust -1485 /// # use std::collections::BTreeMap; -1486 /// # use iroh_metrics::{Metric, MetricsGroup, MetricValue, MetricsGroupSet}; -1487 /// # use iroh::endpoint::{Endpoint, presets}; -1488 /// # async fn wrapper() -> n0_error::Result<()> { -1489 /// let endpoint = Endpoint::bind(presets::N0).await?; -1490 /// let metrics: BTreeMap<String, MetricValue> = endpoint -1491 /// .metrics() -1492 /// .iter() -1493 /// .map(|(group, metric)| { -1494 /// let name = [group, metric.name()].join(":"); -1495 /// (name, metric.value()) -1496 /// }) -1497 /// .collect(); -1498 /// -1499 /// assert_eq!(metrics["socket:recv_datagrams"], MetricValue::Counter(0)); -1500 /// # Ok(()) -1501 /// # } -1502 /// ``` -1503 /// -1504 /// The metrics can also be encoded into the OpenMetrics text format, as used by Prometheus. -1505 /// To do so, use the [`iroh_metrics::Registry`], add the endpoint metrics to the -1506 /// registry with [`Registry::register_all`], and encode the metrics to a string with -1507 /// [`encode_openmetrics_to_string`]: -1508 /// ```rust -1509 /// # use iroh_metrics::{Registry, MetricsSource}; -1510 /// # use iroh::endpoint::{Endpoint, presets}; -1511 /// # async fn wrapper() -> n0_error::Result<()> { -1512 /// let endpoint = Endpoint::bind(presets::N0).await?; -1513 /// let mut registry = Registry::default(); -1514 /// registry.register_all(endpoint.metrics()); -1515 /// let s = registry.encode_openmetrics_to_string()?; -1516 /// assert!(s.contains(r#"TYPE socket_recv_datagrams counter"#)); -1517 /// assert!(s.contains(r#"socket_recv_datagrams_total 0"#)); -1518 /// # Ok(()) -1519 /// # } -1520 /// ``` -1521 /// -1522 /// Through a registry, you can also add labels or prefixes to metrics with -1523 /// [`Registry::sub_registry_with_label`] or [`Registry::sub_registry_with_prefix`]. -1524 /// Furthermore, [`iroh_metrics::service`] provides functions to easily start services -1525 /// to serve the metrics with a HTTP server, dump them to a file, or push them -1526 /// to a Prometheus gateway. -1527 /// -1528 /// For example, the following snippet launches an HTTP server that serves the metrics in the -1529 /// OpenMetrics text format: -1530 /// ```no_run -1531 /// # use std::sync::{Arc, RwLock}; -1532 /// # use iroh_metrics::{Registry, MetricsSource}; -1533 /// # use iroh::endpoint::{Endpoint, presets}; -1534 /// # use n0_error::{StackResultExt, StdResultExt}; -1535 /// # async fn wrapper() -> n0_error::Result<()> { -1536 /// // Create a registry, wrapped in a read-write lock so that we can register and serve -1537 /// // the metrics independently. -1538 /// let registry = Arc::new(RwLock::new(Registry::default())); -1539 /// // Spawn an OpenMetrics HTTP server backed by the registry. -1540 /// let addr = "0.0.0.0:9100".parse().unwrap(); -1541 /// let metrics_server = iroh_metrics::service::MetricsServer::spawn(addr, registry.clone()) -1542 /// .await -1543 /// .std_context("spawn metrics server")?; -1544 /// -1545 /// // Spawn an endpoint and add the metrics to the registry. -1546 /// let endpoint = Endpoint::bind(presets::N0).await?; -1547 /// registry.write().unwrap().register_all(endpoint.metrics()); -1548 /// -1549 /// // Fetch the metrics via HTTP. -1550 /// let res = reqwest::get("http://localhost:9100/metrics") -1551 /// .await -1552 /// .std_context("get")? -1553 /// .text() -1554 /// .await -1555 /// .std_context("text")?; -1556 /// -1557 /// assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#)); -1558 /// assert!(res.contains(r#"socket_recv_datagrams_total 0"#)); -1559 /// # metrics_server.shutdown().await; -1560 /// # Ok(()) -1561 /// # } -1562 /// ``` -1563 /// -1564 /// [`Registry`]: iroh_metrics::Registry -1565 /// [`Registry::register_all`]: iroh_metrics::Registry::register_all -1566 /// [`Registry::sub_registry_with_label`]: iroh_metrics::Registry::sub_registry_with_label -1567 /// [`Registry::sub_registry_with_prefix`]: iroh_metrics::Registry::sub_registry_with_prefix -1568 /// [`encode_openmetrics_to_string`]: iroh_metrics::MetricsSource::encode_openmetrics_to_string -1569 /// [`MetricsGroup`]: iroh_metrics::MetricsGroup -1570 /// [`MetricsGroupSet`]: iroh_metrics::MetricsGroupSet -1571 #[cfg(feature = "metrics")] -1572 pub fn metrics(&self) -> &EndpointMetrics { -1573 &self.inner.metrics -1574 } -1575 -1576 /// Returns addressing information about a recently used remote endpoint. -1577 /// -1578 /// The returned [`RemoteInfo`] contains a list of all transport addresses for the remote -1579 /// that we know about. This is a snapshot in time and not a watcher. -1580 /// -1581 /// Returns `None` if the endpoint doesn't have information about the remote or if the endpoint is closed. -1582 /// When remote endpoints are no longer used, our endpoint will keep information around -1583 /// for a little while, and then drop it. Afterwards, this will return `None`. -1584 pub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo> { -1585 if self.is_closed() { -1586 return None; -1587 } -1588 self.inner.remote_info(endpoint_id).await -1589 } -1590 -1591 // # Methods for less common state updates. +1453 /// Returns a `EndpointError::Closed` error if the endpoint is closed. +1454 /// +1455 /// See [`Builder::address_lookup`]. +1456 pub fn address_lookup(&self) -> Result<&AddressLookupServices, EndpointError> { +1457 if self.is_closed() { +1458 return Err(e!(EndpointError::Closed)); +1459 } +1460 Ok(self.inner.address_lookup()) +1461 } +1462 +1463 /// Returns metrics collected for this endpoint. +1464 /// +1465 /// The endpoint internally collects various metrics about its operation. +1466 /// The returned [`EndpointMetrics`] struct contains all of these metrics. +1467 /// +1468 /// You can access individual metrics directly by using the public fields: +1469 /// ```rust +1470 /// # use std::collections::BTreeMap; +1471 /// # use iroh::endpoint::{Endpoint, presets}; +1472 /// # async fn wrapper() -> n0_error::Result<()> { +1473 /// let endpoint = Endpoint::bind(presets::N0).await?; +1474 /// assert_eq!(endpoint.metrics().socket.recv_datagrams.get(), 0); +1475 /// # Ok(()) +1476 /// # } +1477 /// ``` +1478 /// +1479 /// [`EndpointMetrics`] implements [`MetricsGroupSet`], and each field +1480 /// implements [`MetricsGroup`]. These traits provide methods to iterate over +1481 /// the groups in the set, and over the individual metrics in each group, without having +1482 /// to access each field manually. With these methods, it is straightforward to collect +1483 /// all metrics into a map or push their values to a metrics collector. +1484 /// +1485 /// For example, the following snippet collects all metrics into a map: +1486 /// ```rust +1487 /// # use std::collections::BTreeMap; +1488 /// # use iroh_metrics::{Metric, MetricsGroup, MetricValue, MetricsGroupSet}; +1489 /// # use iroh::endpoint::{Endpoint, presets}; +1490 /// # async fn wrapper() -> n0_error::Result<()> { +1491 /// let endpoint = Endpoint::bind(presets::N0).await?; +1492 /// let metrics: BTreeMap<String, MetricValue> = endpoint +1493 /// .metrics() +1494 /// .iter() +1495 /// .map(|(group, metric)| { +1496 /// let name = [group, metric.name()].join(":"); +1497 /// (name, metric.value()) +1498 /// }) +1499 /// .collect(); +1500 /// +1501 /// assert_eq!(metrics["socket:recv_datagrams"], MetricValue::Counter(0)); +1502 /// # Ok(()) +1503 /// # } +1504 /// ``` +1505 /// +1506 /// The metrics can also be encoded into the OpenMetrics text format, as used by Prometheus. +1507 /// To do so, use the [`iroh_metrics::Registry`], add the endpoint metrics to the +1508 /// registry with [`Registry::register_all`], and encode the metrics to a string with +1509 /// [`encode_openmetrics_to_string`]: +1510 /// ```rust +1511 /// # use iroh_metrics::{Registry, MetricsSource}; +1512 /// # use iroh::endpoint::{Endpoint, presets}; +1513 /// # async fn wrapper() -> n0_error::Result<()> { +1514 /// let endpoint = Endpoint::bind(presets::N0).await?; +1515 /// let mut registry = Registry::default(); +1516 /// registry.register_all(endpoint.metrics()); +1517 /// let s = registry.encode_openmetrics_to_string()?; +1518 /// assert!(s.contains(r#"TYPE socket_recv_datagrams counter"#)); +1519 /// assert!(s.contains(r#"socket_recv_datagrams_total 0"#)); +1520 /// # Ok(()) +1521 /// # } +1522 /// ``` +1523 /// +1524 /// Through a registry, you can also add labels or prefixes to metrics with +1525 /// [`Registry::sub_registry_with_label`] or [`Registry::sub_registry_with_prefix`]. +1526 /// Furthermore, [`iroh_metrics::service`] provides functions to easily start services +1527 /// to serve the metrics with a HTTP server, dump them to a file, or push them +1528 /// to a Prometheus gateway. +1529 /// +1530 /// For example, the following snippet launches an HTTP server that serves the metrics in the +1531 /// OpenMetrics text format: +1532 /// ```no_run +1533 /// # use std::sync::{Arc, RwLock}; +1534 /// # use iroh_metrics::{Registry, MetricsSource}; +1535 /// # use iroh::endpoint::{Endpoint, presets}; +1536 /// # use n0_error::{StackResultExt, StdResultExt}; +1537 /// # async fn wrapper() -> n0_error::Result<()> { +1538 /// // Create a registry, wrapped in a read-write lock so that we can register and serve +1539 /// // the metrics independently. +1540 /// let registry = Arc::new(RwLock::new(Registry::default())); +1541 /// // Spawn an OpenMetrics HTTP server backed by the registry. +1542 /// let addr = "0.0.0.0:9100".parse().unwrap(); +1543 /// let metrics_server = iroh_metrics::service::MetricsServer::spawn(addr, registry.clone()) +1544 /// .await +1545 /// .std_context("spawn metrics server")?; +1546 /// +1547 /// // Spawn an endpoint and add the metrics to the registry. +1548 /// let endpoint = Endpoint::bind(presets::N0).await?; +1549 /// registry.write().unwrap().register_all(endpoint.metrics()); +1550 /// +1551 /// // Fetch the metrics via HTTP. +1552 /// let res = reqwest::get("http://localhost:9100/metrics") +1553 /// .await +1554 /// .std_context("get")? +1555 /// .text() +1556 /// .await +1557 /// .std_context("text")?; +1558 /// +1559 /// assert!(res.contains(r#"TYPE socket_recv_datagrams counter"#)); +1560 /// assert!(res.contains(r#"socket_recv_datagrams_total 0"#)); +1561 /// # metrics_server.shutdown().await; +1562 /// # Ok(()) +1563 /// # } +1564 /// ``` +1565 /// +1566 /// [`Registry`]: iroh_metrics::Registry +1567 /// [`Registry::register_all`]: iroh_metrics::Registry::register_all +1568 /// [`Registry::sub_registry_with_label`]: iroh_metrics::Registry::sub_registry_with_label +1569 /// [`Registry::sub_registry_with_prefix`]: iroh_metrics::Registry::sub_registry_with_prefix +1570 /// [`encode_openmetrics_to_string`]: iroh_metrics::MetricsSource::encode_openmetrics_to_string +1571 /// [`MetricsGroup`]: iroh_metrics::MetricsGroup +1572 /// [`MetricsGroupSet`]: iroh_metrics::MetricsGroupSet +1573 #[cfg(feature = "metrics")] +1574 pub fn metrics(&self) -> &EndpointMetrics { +1575 &self.inner.metrics +1576 } +1577 +1578 /// Returns addressing information about a recently used remote endpoint. +1579 /// +1580 /// The returned [`RemoteInfo`] contains a list of all transport addresses for the remote +1581 /// that we know about. This is a snapshot in time and not a watcher. +1582 /// +1583 /// Returns `None` if the endpoint doesn't have information about the remote or if the endpoint is closed. +1584 /// When remote endpoints are no longer used, our endpoint will keep information around +1585 /// for a little while, and then drop it. Afterwards, this will return `None`. +1586 pub async fn remote_info(&self, endpoint_id: EndpointId) -> Option<RemoteInfo> { +1587 if self.is_closed() { +1588 return None; +1589 } +1590 self.inner.remote_info(endpoint_id).await +1591 } 1592 -1593 /// Notifies the system of potential network changes. -1594 /// -1595 /// On many systems iroh is able to detect network changes by itself, however -1596 /// some systems like android do not expose this functionality to native code. -1597 /// Android does however provide this functionality to Java code. This -1598 /// function allows for notifying iroh of any potential network changes like -1599 /// this. -1600 /// -1601 /// Even when the network did not change, or iroh was already able to detect -1602 /// the network change itself, there is no harm in calling this function. -1603 /// -1604 /// If the endpoint is closed, this method will log a warning and ignore the request. -1605 pub async fn network_change(&self) { -1606 if self.is_closed() { -1607 debug!("Attempting to notify a closed endpoint about a network change. Ignoring."); -1608 return; -1609 } -1610 self.inner.network_change().await; -1611 } -1612 -1613 // # Methods to update internal state. +1593 // # Methods for less common state updates. +1594 +1595 /// Notifies the system of potential network changes. +1596 /// +1597 /// On many systems iroh is able to detect network changes by itself, however +1598 /// some systems like android do not expose this functionality to native code. +1599 /// Android does however provide this functionality to Java code. This +1600 /// function allows for notifying iroh of any potential network changes like +1601 /// this. +1602 /// +1603 /// Even when the network did not change, or iroh was already able to detect +1604 /// the network change itself, there is no harm in calling this function. +1605 /// +1606 /// If the endpoint is closed, this method will log a warning and ignore the request. +1607 pub async fn network_change(&self) { +1608 if self.is_closed() { +1609 debug!("Attempting to notify a closed endpoint about a network change. Ignoring."); +1610 return; +1611 } +1612 self.inner.network_change().await; +1613 } 1614 -1615 /// Sets the initial user-defined data to be published in Address Lookups for this endpoint. -1616 /// -1617 /// If the user-defined data passed to this function is different to the previous one, -1618 /// the endpoint will republish its endpoint info to the configured Address Lookups. -1619 /// -1620 /// See also [`Builder::user_data_for_address_lookup`] for setting an initial value when -1621 /// building the endpoint. -1622 /// -1623 /// If the endpoint is closed, this method will log a warning and ignore the -1624 /// request. -1625 pub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>) { -1626 if self.is_closed() { -1627 warn!("Attempting to set user data for a closed endpoint. Ignoring."); -1628 return; -1629 } -1630 self.inner.set_user_data_for_address_lookup(user_data); -1631 } -1632 -1633 // # Methods for terminating the endpoint. +1615 // # Methods to update internal state. +1616 +1617 /// Sets the initial user-defined data to be published in Address Lookups for this endpoint. +1618 /// +1619 /// If the user-defined data passed to this function is different to the previous one, +1620 /// the endpoint will republish its endpoint info to the configured Address Lookups. +1621 /// +1622 /// See also [`Builder::user_data_for_address_lookup`] for setting an initial value when +1623 /// building the endpoint. +1624 /// +1625 /// If the endpoint is closed, this method will log a warning and ignore the +1626 /// request. +1627 pub fn set_user_data_for_address_lookup(&self, user_data: Option<UserData>) { +1628 if self.is_closed() { +1629 warn!("Attempting to set user data for a closed endpoint. Ignoring."); +1630 return; +1631 } +1632 self.inner.set_user_data_for_address_lookup(user_data); +1633 } 1634 -1635 /// Closes the QUIC endpoint and the socket. -1636 /// -1637 /// This will close any remaining open [`Connection`]s with an error code -1638 /// of `0` and an empty reason. Though it is best practice to close those -1639 /// explicitly before with a custom error code and reason. -1640 /// -1641 /// It will then make a best effort to wait for all close notifications to be -1642 /// acknowledged by the peers, re-transmitting them if needed. This ensures the -1643 /// peers are aware of the closed connections instead of having to wait for a timeout -1644 /// on the connection. Once all connections are closed or timed out, the future -1645 /// finishes. -1646 /// -1647 /// The maximum time-out that this future will wait for depends on QUIC transport -1648 /// configurations of non-drained connections at the time of calling, and their current -1649 /// estimates of round trip time. With default parameters and a conservative estimate -1650 /// of round trip time, this call's future should take 3 seconds to resolve in cases of -1651 /// bad connectivity or failed connections. In the usual case, this call's future should -1652 /// return much more quickly. -1653 /// -1654 /// It is highly recommended you *do* wait for this close call to finish, if possible. -1655 /// Not doing so will make connections that were still open while closing the endpoint -1656 /// time out on the remote end. Thus remote ends will assume connections to have failed -1657 /// even if all application data was transmitted successfully. -1658 /// -1659 /// Note: Someone used to closing TCP sockets might wonder why it is necessary to wait -1660 /// for timeouts when closing QUIC endpoints, while they don't have to do this for TCP -1661 /// sockets. This is due to QUIC and its acknowledgments being implemented in user-land, -1662 /// while TCP sockets usually get closed and drained by the operating system in the -1663 /// kernel during the "Time-Wait" period of the TCP socket. -1664 /// -1665 /// Be aware however that the underlying UDP sockets are only closed once all clones of -1666 /// the the respective [`Endpoint`] are dropped. -1667 pub async fn close(&self) { -1668 self.inner.close().await; -1669 } -1670 -1671 /// Check if this endpoint is still alive, or already closed. -1672 pub fn is_closed(&self) -> bool { -1673 self.inner.is_closed() -1674 } -1675 -1676 /// Returns a future that resolves once the endpoint closes. -1677 /// -1678 /// The returned future does not contain a clone or reference to the [`Endpoint`], -1679 /// so keeping the returned future alive does not prevent the endpoint from being dropped. -1680 /// -1681 /// To run a task and stop it once the endpoint closes, you can use -1682 /// [`EndpointClosed::run_until`]: -1683 /// ```no_run -1684 /// # #[cfg(with_crypto_provider)] -1685 /// # { -1686 /// # use iroh::endpoint::{Endpoint, presets}; -1687 /// # async fn wrapper() -> n0_error::Result<()> { -1688 /// let endpoint = Endpoint::bind(presets::N0).await?; -1689 /// tokio::spawn(endpoint.closed().run_until(async move { -1690 /// // the future will be aborted once the endpoint closes. -1691 /// })); -1692 /// # Ok(()) -1693 /// # } -1694 /// # } -1695 /// ``` -1696 pub fn closed(&self) -> EndpointClosed { -1697 EndpointClosed { -1698 inner: self.inner.closed(), -1699 } -1700 } -1701 -1702 /// Create a [`ServerConfigBuilder`] for this endpoint that includes the given alpns. -1703 /// -1704 /// Use the [`ServerConfigBuilder`] to customize the [`ServerConfig`] connection configuration -1705 /// for a connection accepted using the [`Incoming::accept_with`] method. -1706 pub fn create_server_config_builder(&self, alpns: Vec<Vec<u8>>) -> ServerConfigBuilder { -1707 let inner = self.inner.static_config.create_server_config(alpns); -1708 ServerConfigBuilder::new(inner, self.inner.static_config.transport_config.clone()) -1709 } -1710 -1711 // # Remaining private methods +1635 // # Methods for terminating the endpoint. +1636 +1637 /// Closes the QUIC endpoint and the socket. +1638 /// +1639 /// This will close any remaining open [`Connection`]s with an error code +1640 /// of `0` and an empty reason. Though it is best practice to close those +1641 /// explicitly before with a custom error code and reason. +1642 /// +1643 /// It will then make a best effort to wait for all close notifications to be +1644 /// acknowledged by the peers, re-transmitting them if needed. This ensures the +1645 /// peers are aware of the closed connections instead of having to wait for a timeout +1646 /// on the connection. Once all connections are closed or timed out, the future +1647 /// finishes. +1648 /// +1649 /// The maximum time-out that this future will wait for depends on QUIC transport +1650 /// configurations of non-drained connections at the time of calling, and their current +1651 /// estimates of round trip time. With default parameters and a conservative estimate +1652 /// of round trip time, this call's future should take 3 seconds to resolve in cases of +1653 /// bad connectivity or failed connections. In the usual case, this call's future should +1654 /// return much more quickly. +1655 /// +1656 /// It is highly recommended you *do* wait for this close call to finish, if possible. +1657 /// Not doing so will make connections that were still open while closing the endpoint +1658 /// time out on the remote end. Thus remote ends will assume connections to have failed +1659 /// even if all application data was transmitted successfully. +1660 /// +1661 /// Note: Someone used to closing TCP sockets might wonder why it is necessary to wait +1662 /// for timeouts when closing QUIC endpoints, while they don't have to do this for TCP +1663 /// sockets. This is due to QUIC and its acknowledgments being implemented in user-land, +1664 /// while TCP sockets usually get closed and drained by the operating system in the +1665 /// kernel during the "Time-Wait" period of the TCP socket. +1666 /// +1667 /// Be aware however that the underlying UDP sockets are only closed once all clones of +1668 /// the respective [`Endpoint`] are dropped. +1669 pub async fn close(&self) { +1670 self.inner.close().await; +1671 } +1672 +1673 /// Check if this endpoint is still alive, or already closed. +1674 pub fn is_closed(&self) -> bool { +1675 self.inner.is_closed() +1676 } +1677 +1678 /// Returns a future that resolves once the endpoint closes. +1679 /// +1680 /// The returned future does not contain a clone or reference to the [`Endpoint`], +1681 /// so keeping the returned future alive does not prevent the endpoint from being dropped. +1682 /// +1683 /// To run a task and stop it once the endpoint closes, you can use +1684 /// [`EndpointClosed::run_until`]: +1685 /// ```no_run +1686 /// # #[cfg(with_crypto_provider)] +1687 /// # { +1688 /// # use iroh::endpoint::{Endpoint, presets}; +1689 /// # async fn wrapper() -> n0_error::Result<()> { +1690 /// let endpoint = Endpoint::bind(presets::N0).await?; +1691 /// tokio::spawn(endpoint.closed().run_until(async move { +1692 /// // the future will be aborted once the endpoint closes. +1693 /// })); +1694 /// # Ok(()) +1695 /// # } +1696 /// # } +1697 /// ``` +1698 pub fn closed(&self) -> EndpointClosed { +1699 EndpointClosed { +1700 inner: self.inner.closed(), +1701 } +1702 } +1703 +1704 /// Create a [`ServerConfigBuilder`] for this endpoint that includes the given alpns. +1705 /// +1706 /// Use the [`ServerConfigBuilder`] to customize the [`ServerConfig`] connection configuration +1707 /// for a connection accepted using the [`Incoming::accept_with`] method. +1708 pub fn create_server_config_builder(&self, alpns: Vec<Vec<u8>>) -> ServerConfigBuilder { +1709 let inner = self.inner.static_config.create_server_config(alpns); +1710 ServerConfigBuilder::new(inner, self.inner.static_config.transport_config.clone()) +1711 } 1712 -1713 /// Translates a raw [`SocketAddr`] (which may be a synthetic mapped address) into -1714 /// a transport address. -1715 pub(crate) fn to_transport_addr(&self, addr: SocketAddr) -> crate::socket::transports::Addr { -1716 self.inner.to_transport_addr(addr) -1717 } -1718 -1719 #[cfg(all(test, with_crypto_provider))] -1720 pub(crate) fn inner(&self) -> Result<Arc<EndpointInner>, EndpointError> { -1721 if self.is_closed() { -1722 return Err(e!(EndpointError::Closed)); -1723 } -1724 Ok(self.inner.clone()) -1725 } -1726} -1727 -1728/// Options for the [`Endpoint::connect_with_opts`] function. -1729#[derive(Default, Debug, Clone)] -1730pub struct ConnectOptions { -1731 transport_config: Option<QuicTransportConfig>, -1732 additional_alpns: Vec<Vec<u8>>, -1733} -1734 -1735impl ConnectOptions { -1736 /// Initializes new connection options. -1737 /// -1738 /// By default, the connection will use the same options -1739 /// as [`Endpoint::connect`], e.g. a default [`QuicTransportConfig`]. -1740 pub fn new() -> Self { -1741 Self::default() -1742 } -1743 -1744 /// Sets the QUIC transport config options for this connection. -1745 pub fn with_transport_config(mut self, transport_config: QuicTransportConfig) -> Self { -1746 self.transport_config = Some(transport_config); -1747 self -1748 } -1749 -1750 /// Sets [ALPN] identifiers that should be signaled as supported on connection, *in -1751 /// addition* to the main [ALPN] identifier used in [`Endpoint::connect_with_opts`]. -1752 /// -1753 /// This allows connecting to servers that may only support older versions of your -1754 /// protocol. In this case, you would add the older [ALPN] identifiers with this -1755 /// function. -1756 /// -1757 /// You'll know the final negotiated [ALPN] identifier once your connection was -1758 /// established using [`Connection::alpn`], or even slightly earlier in the -1759 /// handshake by using [`Connecting::alpn`]. -1760 /// The negotiated [ALPN] identifier may be any of the [ALPN] identifiers in this -1761 /// list or the main [ALPN] used in [`Endpoint::connect_with_opts`]. -1762 /// -1763 /// The [ALPN] identifier order on the connect side doesn't matter, since it's the -1764 /// accept side that determines the protocol. -1765 /// -1766 /// For setting the supported [ALPN] identifiers on the accept side, see the endpoint -1767 /// builder's [`Builder::alpns`] function. -1768 /// -1769 /// [ALPN]: https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation -1770 pub fn with_additional_alpns(mut self, alpns: Vec<Vec<u8>>) -> Self { -1771 self.additional_alpns = alpns; -1772 self -1773 } -1774} -1775 -1776/// Future returned from [`Endpoint::closed`]. -1777#[derive(derive_more::Debug)] -1778#[pin_project] -1779#[debug("EndpointClosed")] -1780pub struct EndpointClosed { -1781 #[pin] -1782 inner: WaitForCancellationFutureOwned, -1783} -1784 -1785impl Future for EndpointClosed { -1786 type Output = (); -1787 -1788 fn poll( -1789 self: Pin<&mut Self>, -1790 cx: &mut std::task::Context<'_>, -1791 ) -> std::task::Poll<Self::Output> { -1792 let this = self.project(); -1793 this.inner.poll(cx) -1794 } -1795} -1796 -1797impl EndpointClosed { -1798 /// Runs a future to completion, or until the [`Endpoint`] is closed. -1799 /// -1800 /// Returns the output of `fut` if it completes before the endpoint closes, -1801 /// or `None` otherwise. -1802 pub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output> { -1803 n0_future::future::or(async { Some(fut.await) }, async { -1804 self.await; -1805 None -1806 }) -1807 .await -1808 } -1809} -1810 -1811/// Read a proxy url from the environment, in this order -1812/// -1813/// - `HTTP_PROXY` -1814/// - `http_proxy` -1815/// - `HTTPS_PROXY` -1816/// - `https_proxy` -1817fn proxy_url_from_env() -> Option<Url> { -1818 if let Some(url) = std::env::var("HTTP_PROXY") -1819 .ok() -1820 .and_then(|s| s.parse::<Url>().ok()) -1821 { -1822 if is_cgi() { -1823 warn!("HTTP_PROXY environment variable ignored in CGI"); -1824 } else { -1825 return Some(url); -1826 } -1827 } -1828 if let Some(url) = std::env::var("http_proxy") -1829 .ok() -1830 .and_then(|s| s.parse::<Url>().ok()) -1831 { -1832 return Some(url); -1833 } -1834 if let Some(url) = std::env::var("HTTPS_PROXY") -1835 .ok() -1836 .and_then(|s| s.parse::<Url>().ok()) -1837 { -1838 return Some(url); -1839 } -1840 if let Some(url) = std::env::var("https_proxy") -1841 .ok() -1842 .and_then(|s| s.parse::<Url>().ok()) -1843 { -1844 return Some(url); -1845 } -1846 -1847 None -1848} -1849 -1850/// Connection status of a single home relay. -1851/// -1852/// Observed via [`Endpoint::home_relay_status`]. -1853#[derive(Debug, Clone, PartialEq, Eq)] -1854pub struct RelayStatus { -1855 url: RelayUrl, -1856 state: RelayConnectionState, -1857} -1858 -1859impl RelayStatus { -1860 pub(crate) fn new(url: RelayUrl, state: RelayConnectionState) -> Self { -1861 Self { url, state } -1862 } -1863 -1864 /// Returns the URL of the home relay. -1865 pub fn url(&self) -> &RelayUrl { -1866 &self.url -1867 } -1868 -1869 /// Returns `true` if the endpoint is connected to the relay. -1870 pub fn is_connected(&self) -> bool { -1871 self.state.is_connected() -1872 } -1873 -1874 /// Returns the most recent connection error, if the relay is currently -1875 /// disconnected. -1876 /// -1877 /// Returns `None` when the relay is connected, or when the endpoint has -1878 /// not yet observed a failed connection attempt. -1879 pub fn last_error(&self) -> Option<&AnyError> { -1880 self.state.last_error().map(Arc::as_ref) -1881 } -1882} -1883 -1884/// Configuration of the relay servers for an [`Endpoint`]. -1885#[derive(Debug, Clone, PartialEq, Eq)] -1886pub enum RelayMode { -1887 /// Disable relay servers completely. -1888 /// This means that neither listening nor dialing relays will be available. -1889 Disabled, -1890 /// Use the default relay map, with production relay servers from n0. -1891 /// -1892 /// See [`crate::defaults::prod`] for the severs used. -1893 Default, -1894 /// Use the staging relay servers from n0. -1895 Staging, -1896 /// Use a custom relay map. -1897 Custom(RelayMap), -1898} -1899 -1900impl RelayMode { -1901 /// Returns the relay map for this mode. -1902 pub fn relay_map(&self) -> RelayMap { -1903 match self { -1904 RelayMode::Disabled => RelayMap::empty(), -1905 RelayMode::Default => crate::defaults::prod::default_relay_map(), -1906 RelayMode::Staging => crate::defaults::staging::default_relay_map(), -1907 RelayMode::Custom(relay_map) => relay_map.clone(), -1908 } -1909 } -1910 -1911 /// Create a custom relay mode from a list of [`RelayUrl`]s. -1912 /// -1913 /// # Example +1713 // # Remaining private methods +1714 +1715 /// Translates a raw [`SocketAddr`] (which may be a synthetic mapped address) into +1716 /// a transport address. +1717 pub(crate) fn to_transport_addr(&self, addr: SocketAddr) -> crate::socket::transports::Addr { +1718 self.inner.to_transport_addr(addr) +1719 } +1720 +1721 #[cfg(all(test, with_crypto_provider))] +1722 pub(crate) fn inner(&self) -> Result<Arc<EndpointInner>, EndpointError> { +1723 if self.is_closed() { +1724 return Err(e!(EndpointError::Closed)); +1725 } +1726 Ok(self.inner.clone()) +1727 } +1728} +1729 +1730/// Options for the [`Endpoint::connect_with_opts`] function. +1731#[derive(Default, Debug, Clone)] +1732pub struct ConnectOptions { +1733 transport_config: Option<QuicTransportConfig>, +1734 additional_alpns: Vec<Vec<u8>>, +1735} +1736 +1737impl ConnectOptions { +1738 /// Initializes new connection options. +1739 /// +1740 /// By default, the connection will use the same options +1741 /// as [`Endpoint::connect`], e.g. a default [`QuicTransportConfig`]. +1742 pub fn new() -> Self { +1743 Self::default() +1744 } +1745 +1746 /// Sets the QUIC transport config options for this connection. +1747 pub fn with_transport_config(mut self, transport_config: QuicTransportConfig) -> Self { +1748 self.transport_config = Some(transport_config); +1749 self +1750 } +1751 +1752 /// Sets [ALPN] identifiers that should be signaled as supported on connection, *in +1753 /// addition* to the main [ALPN] identifier used in [`Endpoint::connect_with_opts`]. +1754 /// +1755 /// This allows connecting to servers that may only support older versions of your +1756 /// protocol. In this case, you would add the older [ALPN] identifiers with this +1757 /// function. +1758 /// +1759 /// You'll know the final negotiated [ALPN] identifier once your connection was +1760 /// established using [`Connection::alpn`], or even slightly earlier in the +1761 /// handshake by using [`Connecting::alpn`]. +1762 /// The negotiated [ALPN] identifier may be any of the [ALPN] identifiers in this +1763 /// list or the main [ALPN] used in [`Endpoint::connect_with_opts`]. +1764 /// +1765 /// The [ALPN] identifier order on the connect side doesn't matter, since it's the +1766 /// accept side that determines the protocol. +1767 /// +1768 /// For setting the supported [ALPN] identifiers on the accept side, see the endpoint +1769 /// builder's [`Builder::alpns`] function. +1770 /// +1771 /// [ALPN]: https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation +1772 pub fn with_additional_alpns(mut self, alpns: Vec<Vec<u8>>) -> Self { +1773 self.additional_alpns = alpns; +1774 self +1775 } +1776} +1777 +1778/// Future returned from [`Endpoint::closed`]. +1779#[derive(derive_more::Debug)] +1780#[pin_project] +1781#[debug("EndpointClosed")] +1782pub struct EndpointClosed { +1783 #[pin] +1784 inner: WaitForCancellationFutureOwned, +1785} +1786 +1787impl Future for EndpointClosed { +1788 type Output = (); +1789 +1790 fn poll( +1791 self: Pin<&mut Self>, +1792 cx: &mut std::task::Context<'_>, +1793 ) -> std::task::Poll<Self::Output> { +1794 let this = self.project(); +1795 this.inner.poll(cx) +1796 } +1797} +1798 +1799impl EndpointClosed { +1800 /// Runs a future to completion, or until the [`Endpoint`] is closed. +1801 /// +1802 /// Returns the output of `fut` if it completes before the endpoint closes, +1803 /// or `None` otherwise. +1804 pub async fn run_until<F: Future>(self, fut: F) -> Option<F::Output> { +1805 n0_future::future::or(async { Some(fut.await) }, async { +1806 self.await; +1807 None +1808 }) +1809 .await +1810 } +1811} +1812 +1813/// Read a proxy url from the environment, in this order +1814/// +1815/// - `HTTP_PROXY` +1816/// - `http_proxy` +1817/// - `HTTPS_PROXY` +1818/// - `https_proxy` +1819fn proxy_url_from_env() -> Option<Url> { +1820 if let Some(url) = std::env::var("HTTP_PROXY") +1821 .ok() +1822 .and_then(|s| s.parse::<Url>().ok()) +1823 { +1824 if is_cgi() { +1825 warn!("HTTP_PROXY environment variable ignored in CGI"); +1826 } else { +1827 return Some(url); +1828 } +1829 } +1830 if let Some(url) = std::env::var("http_proxy") +1831 .ok() +1832 .and_then(|s| s.parse::<Url>().ok()) +1833 { +1834 return Some(url); +1835 } +1836 if let Some(url) = std::env::var("HTTPS_PROXY") +1837 .ok() +1838 .and_then(|s| s.parse::<Url>().ok()) +1839 { +1840 return Some(url); +1841 } +1842 if let Some(url) = std::env::var("https_proxy") +1843 .ok() +1844 .and_then(|s| s.parse::<Url>().ok()) +1845 { +1846 return Some(url); +1847 } +1848 +1849 None +1850} +1851 +1852/// Connection status of a single home relay. +1853/// +1854/// Observed via [`Endpoint::home_relay_status`]. +1855#[derive(Debug, Clone, PartialEq, Eq)] +1856pub struct RelayStatus { +1857 url: RelayUrl, +1858 state: RelayConnectionState, +1859} +1860 +1861impl RelayStatus { +1862 pub(crate) fn new(url: RelayUrl, state: RelayConnectionState) -> Self { +1863 Self { url, state } +1864 } +1865 +1866 /// Returns the URL of the home relay. +1867 pub fn url(&self) -> &RelayUrl { +1868 &self.url +1869 } +1870 +1871 /// Returns `true` if the endpoint is connected to the relay. +1872 pub fn is_connected(&self) -> bool { +1873 self.state.is_connected() +1874 } +1875 +1876 /// Returns the most recent connection error, if the relay is currently +1877 /// disconnected. +1878 /// +1879 /// Returns `None` when the relay is connected, or when the endpoint has +1880 /// not yet observed a failed connection attempt. +1881 pub fn last_error(&self) -> Option<&AnyError> { +1882 self.state.last_error().map(Arc::as_ref) +1883 } +1884} +1885 +1886/// Configuration of the relay servers for an [`Endpoint`]. +1887#[derive(Debug, Clone, PartialEq, Eq)] +1888pub enum RelayMode { +1889 /// Disable relay servers completely. +1890 /// This means that neither listening nor dialing relays will be available. +1891 Disabled, +1892 /// Use the default relay map, with production relay servers from n0. +1893 /// +1894 /// See [`crate::defaults::prod`] for the severs used. +1895 Default, +1896 /// Use the staging relay servers from n0. +1897 Staging, +1898 /// Use a custom relay map. +1899 Custom(RelayMap), +1900} +1901 +1902impl RelayMode { +1903 /// Returns the relay map for this mode. +1904 pub fn relay_map(&self) -> RelayMap { +1905 match self { +1906 RelayMode::Disabled => RelayMap::empty(), +1907 RelayMode::Default => crate::defaults::prod::default_relay_map(), +1908 RelayMode::Staging => crate::defaults::staging::default_relay_map(), +1909 RelayMode::Custom(relay_map) => relay_map.clone(), +1910 } +1911 } +1912 +1913 /// Create a custom relay mode from a list of [`RelayUrl`]s. 1914 /// -1915 /// ``` -1916 /// # fn main() -> n0_error::Result<()> { -1917 /// # use iroh::RelayMode; -1918 /// RelayMode::custom([ -1919 /// "https://use1-1.relay.n0.iroh-canary.iroh.link.".parse()?, -1920 /// "https://euw-1.relay.n0.iroh-canary.iroh.link.".parse()?, -1921 /// ]); -1922 /// # Ok(()) } -1923 /// ``` -1924 pub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self { -1925 let m = RelayMap::from_iter(map); -1926 Self::Custom(m) -1927 } -1928} -1929 -1930/// Environment variable to force the use of staging relays. -1931pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS"; -1932 -1933/// Returns `true` if the use of staging relays is forced. -1934pub fn force_staging_infra() -> bool { -1935 matches!(std::env::var(ENV_FORCE_STAGING_RELAYS), Ok(value) if !value.is_empty()) -1936} -1937 -1938/// Returns the default relay mode. -1939/// -1940/// If the `IROH_FORCE_STAGING_RELAYS` environment variable is non empty, it will return `RelayMode::Staging`. -1941/// Otherwise, it will return `RelayMode::Default`. -1942pub fn default_relay_mode() -> RelayMode { -1943 // Use staging in testing -1944 match force_staging_infra() { -1945 true => RelayMode::Staging, -1946 false => RelayMode::Default, -1947 } -1948} -1949 -1950/// Check if we are being executed in a CGI context. -1951/// -1952/// If so, a malicious client can send the `Proxy:` header, and it will -1953/// be in the `HTTP_PROXY` env var. So we don't use it :) -1954fn is_cgi() -> bool { -1955 std::env::var_os("REQUEST_METHOD").is_some() -1956} -1957 -1958#[cfg(all(test, with_crypto_provider))] -1959mod tests { -1960 use std::{ -1961 collections::BTreeMap, -1962 io, -1963 net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4}, -1964 str::FromStr, -1965 sync::Arc, -1966 time::{Duration, Instant}, -1967 }; -1968 -1969 use iroh_base::{EndpointAddr, EndpointId, RelayUrl, SecretKey, TransportAddr}; -1970 use iroh_dns::endpoint_info::UserData; -1971 use iroh_relay::{RelayConfig, server::Access, tls::CaTlsConfig}; -1972 use n0_error::{AnyError as Error, Result, StdResultExt}; -1973 use n0_future::{BufferedStreamExt, StreamExt, future::now_or_never, stream, time}; -1974 use n0_tracing_test::traced_test; -1975 use n0_watcher::Watcher; -1976 use noq::PathStats; -1977 use rand::{RngExt, SeedableRng}; -1978 use rand_chacha::ChaCha8Rng; -1979 use tokio::sync::oneshot; -1980 use tracing::{Instrument, debug_span, error_span, info, info_span, instrument}; -1981 -1982 use super::Endpoint; -1983 use crate::{ -1984 RelayMap, RelayMode, -1985 address_lookup::memory::MemoryLookup, -1986 endpoint::{ -1987 ApplicationClose, BindError, BindOpts, ConnectError, ConnectOptions, -1988 ConnectWithOptsError, Connection, ConnectionError, PathEvent, PathEventStream, presets, -1989 }, -1990 protocol::{AcceptError, ProtocolHandler, Router}, -1991 test_utils::{ -1992 QlogFileGroup, run_relay_server, run_relay_server_with, run_relay_server_with_access, -1993 }, -1994 }; -1995 -1996 const TEST_ALPN: &[u8] = b"n0/iroh/test"; +1915 /// # Example +1916 /// +1917 /// ``` +1918 /// # fn main() -> n0_error::Result<()> { +1919 /// # use iroh::RelayMode; +1920 /// RelayMode::custom([ +1921 /// "https://use1-1.relay.n0.iroh-canary.iroh.link.".parse()?, +1922 /// "https://euw-1.relay.n0.iroh-canary.iroh.link.".parse()?, +1923 /// ]); +1924 /// # Ok(()) } +1925 /// ``` +1926 pub fn custom(map: impl IntoIterator<Item = RelayUrl>) -> Self { +1927 let m = RelayMap::from_iter(map); +1928 Self::Custom(m) +1929 } +1930} +1931 +1932/// Environment variable to force the use of staging relays. +1933pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS"; +1934 +1935/// Returns `true` if the use of staging relays is forced. +1936pub fn force_staging_infra() -> bool { +1937 matches!(std::env::var(ENV_FORCE_STAGING_RELAYS), Ok(value) if !value.is_empty()) +1938} +1939 +1940/// Returns the default relay mode. +1941/// +1942/// If the `IROH_FORCE_STAGING_RELAYS` environment variable is non empty, it will return `RelayMode::Staging`. +1943/// Otherwise, it will return `RelayMode::Default`. +1944pub fn default_relay_mode() -> RelayMode { +1945 // Use staging in testing +1946 match force_staging_infra() { +1947 true => RelayMode::Staging, +1948 false => RelayMode::Default, +1949 } +1950} +1951 +1952/// Check if we are being executed in a CGI context. +1953/// +1954/// If so, a malicious client can send the `Proxy:` header, and it will +1955/// be in the `HTTP_PROXY` env var. So we don't use it :) +1956fn is_cgi() -> bool { +1957 std::env::var_os("REQUEST_METHOD").is_some() +1958} +1959 +1960#[cfg(all(test, with_crypto_provider))] +1961mod tests { +1962 use std::{ +1963 collections::BTreeMap, +1964 io, +1965 net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4}, +1966 str::FromStr, +1967 sync::Arc, +1968 time::{Duration, Instant}, +1969 }; +1970 +1971 use iroh_base::{EndpointAddr, EndpointId, RelayUrl, SecretKey, TransportAddr}; +1972 use iroh_dns::endpoint_info::UserData; +1973 use iroh_relay::{RelayConfig, server::Access, tls::CaTlsConfig}; +1974 use n0_error::{AnyError as Error, Result, StdResultExt}; +1975 use n0_future::{BufferedStreamExt, StreamExt, future::now_or_never, stream, time}; +1976 use n0_tracing_test::traced_test; +1977 use n0_watcher::Watcher; +1978 use noq::PathStats; +1979 use rand::{RngExt, SeedableRng}; +1980 use rand_chacha::ChaCha8Rng; +1981 use tokio::sync::oneshot; +1982 use tracing::{Instrument, debug_span, error_span, info, info_span, instrument}; +1983 +1984 use super::Endpoint; +1985 use crate::{ +1986 RelayMap, RelayMode, +1987 address_lookup::memory::MemoryLookup, +1988 endpoint::{ +1989 ApplicationClose, BindError, BindOpts, ConnectError, ConnectOptions, +1990 ConnectWithOptsError, Connection, ConnectionError, PathEvent, PathEventStream, presets, +1991 }, +1992 protocol::{AcceptError, ProtocolHandler, Router}, +1993 test_utils::{ +1994 QlogFileGroup, run_relay_server, run_relay_server_with, run_relay_server_with_access, +1995 }, +1996 }; 1997 -1998 #[tokio::test] -1999 #[traced_test] -2000 async fn test_connect_self() -> Result { -2001 let ep = Endpoint::builder(presets::Minimal) -2002 .alpns(vec![TEST_ALPN.to_vec()]) -2003 .bind() -2004 .await -2005 .unwrap(); -2006 let my_addr = ep.addr(); -2007 let res = ep.connect(my_addr.clone(), TEST_ALPN).await; -2008 assert!(res.is_err()); -2009 let err = res.err().unwrap(); -2010 assert!(err.to_string().starts_with("Connecting to ourself")); -2011 -2012 Ok(()) -2013 } -2014 -2015 #[tokio::test] -2016 #[traced_test] -2017 async fn endpoint_connect_close() -> Result { -2018 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -2019 let (relay_map, relay_url, _guard) = run_relay_server().await?; -2020 let server_secret_key = SecretKey::from_bytes(&rng.random()); -2021 let server_peer_id = server_secret_key.public(); -2022 -2023 let qlog = QlogFileGroup::from_env("endpoint_connect_close"); +1998 const TEST_ALPN: &[u8] = b"n0/iroh/test"; +1999 +2000 #[tokio::test] +2001 #[traced_test] +2002 async fn test_connect_self() -> Result { +2003 let ep = Endpoint::builder(presets::Minimal) +2004 .alpns(vec![TEST_ALPN.to_vec()]) +2005 .bind() +2006 .await +2007 .unwrap(); +2008 let my_addr = ep.addr(); +2009 let res = ep.connect(my_addr.clone(), TEST_ALPN).await; +2010 assert!(res.is_err()); +2011 let err = res.err().unwrap(); +2012 assert!(err.to_string().starts_with("Connecting to ourself")); +2013 +2014 Ok(()) +2015 } +2016 +2017 #[tokio::test] +2018 #[traced_test] +2019 async fn endpoint_connect_close() -> Result { +2020 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2021 let (relay_map, relay_url, _guard) = run_relay_server().await?; +2022 let server_secret_key = SecretKey::from_bytes(&rng.random()); +2023 let server_peer_id = server_secret_key.public(); 2024 -2025 // Wait for the endpoint to be started to make sure it's up before clients try to connect -2026 let ep = Endpoint::builder(presets::Minimal) -2027 .relay_mode(RelayMode::Custom(relay_map.clone())) -2028 .secret_key(server_secret_key) -2029 .transport_config(qlog.create("server")?) -2030 .alpns(vec![TEST_ALPN.to_vec()]) -2031 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2032 .bind() -2033 .await?; -2034 // Wait for the endpoint to be reachable via relay -2035 ep.online().await; -2036 -2037 let server = tokio::spawn( -2038 async move { -2039 info!("accepting connection"); -2040 let incoming = ep.accept().await.anyerr()?; -2041 let conn = incoming.await.anyerr()?; -2042 let mut stream = conn.accept_uni().await.anyerr()?; -2043 let mut buf = [0u8; 5]; -2044 stream.read_exact(&mut buf).await.anyerr()?; -2045 info!("Accepted 1 stream, received {buf:?}. Closing now."); -2046 // close the connection -2047 conn.close(7u8.into(), b"bye"); -2048 -2049 let res = conn.accept_uni().await; -2050 assert_eq!(res.unwrap_err(), ConnectionError::LocallyClosed); -2051 -2052 let res = stream.read_to_end(10).await; -2053 assert_eq!( -2054 res.unwrap_err(), -2055 noq::ReadToEndError::Read(noq::ReadError::ConnectionLost( -2056 ConnectionError::LocallyClosed -2057 )) -2058 ); -2059 info!("Closing the endpoint"); -2060 ep.close().await; -2061 info!("server test completed"); -2062 Ok::<_, Error>(()) -2063 } -2064 .instrument(info_span!("test-server")), -2065 ); -2066 -2067 let client = tokio::spawn( -2068 async move { -2069 let ep = Endpoint::builder(presets::Minimal) -2070 .relay_mode(RelayMode::Custom(relay_map)) -2071 .alpns(vec![TEST_ALPN.to_vec()]) -2072 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2073 .transport_config(qlog.create("client")?) -2074 .bind() -2075 .await?; -2076 info!("client connecting"); -2077 let endpoint_addr = EndpointAddr::new(server_peer_id).with_relay_url(relay_url); -2078 let conn = ep.connect(endpoint_addr, TEST_ALPN).await?; -2079 let mut stream = conn.open_uni().await.anyerr()?; -2080 -2081 // First write is accepted by server. We need this bit of synchronisation -2082 // because if the server closes after simply accepting the connection we can -2083 // not be sure our .open_uni() call would succeed as it may already receive -2084 // the error. -2085 stream.write_all(b"hello").await.anyerr()?; -2086 -2087 info!("waiting for closed"); -2088 // Remote now closes the connection, we should see an error sometime soon. -2089 let err = conn.closed().await; -2090 let expected_err = ConnectionError::ApplicationClosed(ApplicationClose { -2091 error_code: 7u8.into(), -2092 reason: b"bye".to_vec().into(), -2093 }); -2094 assert_eq!(err, expected_err); -2095 -2096 info!("opening new - expect it to fail"); -2097 let res = conn.open_uni().await; -2098 assert_eq!(res.unwrap_err(), expected_err); -2099 info!("Closing the client"); -2100 ep.close().await; -2101 info!("client test completed"); -2102 Ok::<_, Error>(()) -2103 } -2104 .instrument(info_span!("test-client")), -2105 ); -2106 -2107 let (server, client) = tokio::time::timeout( -2108 Duration::from_secs(30), -2109 n0_future::future::zip(server, client), -2110 ) -2111 .await -2112 .anyerr()?; -2113 server.anyerr()??; -2114 client.anyerr()??; -2115 Ok(()) -2116 } -2117 -2118 #[tokio::test] -2119 #[traced_test] -2120 async fn endpoint_relay_connect_loop() -> Result { -2121 let test_start = Instant::now(); -2122 let n_clients = 5; -2123 let n_chunks_per_client = 2; -2124 let chunk_size = 100; -2125 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); -2126 let (relay_map, relay_url, _relay_guard) = run_relay_server().await.unwrap(); -2127 let server_secret_key = SecretKey::from_bytes(&rng.random()); -2128 let server_endpoint_id = server_secret_key.public(); -2129 -2130 // Make sure the server is bound before having clients connect to it: -2131 let ep = Endpoint::builder(presets::Minimal) -2132 .relay_mode(RelayMode::Custom(relay_map.clone())) -2133 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2134 .secret_key(server_secret_key) -2135 .alpns(vec![TEST_ALPN.to_vec()]) -2136 .bind() -2137 .await?; -2138 // Also make sure the server has a working relay connection -2139 ep.online().await; -2140 -2141 info!(time = ?test_start.elapsed(), "test setup done"); +2025 let qlog = QlogFileGroup::from_env("endpoint_connect_close"); +2026 +2027 // Wait for the endpoint to be started to make sure it's up before clients try to connect +2028 let ep = Endpoint::builder(presets::Minimal) +2029 .relay_mode(RelayMode::Custom(relay_map.clone())) +2030 .secret_key(server_secret_key) +2031 .transport_config(qlog.create("server")?) +2032 .alpns(vec![TEST_ALPN.to_vec()]) +2033 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2034 .bind() +2035 .await?; +2036 // Wait for the endpoint to be reachable via relay +2037 ep.online().await; +2038 +2039 let server = tokio::spawn( +2040 async move { +2041 info!("accepting connection"); +2042 let incoming = ep.accept().await.anyerr()?; +2043 let conn = incoming.await.anyerr()?; +2044 let mut stream = conn.accept_uni().await.anyerr()?; +2045 let mut buf = [0u8; 5]; +2046 stream.read_exact(&mut buf).await.anyerr()?; +2047 info!("Accepted 1 stream, received {buf:?}. Closing now."); +2048 // close the connection +2049 conn.close(7u8.into(), b"bye"); +2050 +2051 let res = conn.accept_uni().await; +2052 assert_eq!(res.unwrap_err(), ConnectionError::LocallyClosed); +2053 +2054 let res = stream.read_to_end(10).await; +2055 assert_eq!( +2056 res.unwrap_err(), +2057 noq::ReadToEndError::Read(noq::ReadError::ConnectionLost( +2058 ConnectionError::LocallyClosed +2059 )) +2060 ); +2061 info!("Closing the endpoint"); +2062 ep.close().await; +2063 info!("server test completed"); +2064 Ok::<_, Error>(()) +2065 } +2066 .instrument(info_span!("test-server")), +2067 ); +2068 +2069 let client = tokio::spawn( +2070 async move { +2071 let ep = Endpoint::builder(presets::Minimal) +2072 .relay_mode(RelayMode::Custom(relay_map)) +2073 .alpns(vec![TEST_ALPN.to_vec()]) +2074 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2075 .transport_config(qlog.create("client")?) +2076 .bind() +2077 .await?; +2078 info!("client connecting"); +2079 let endpoint_addr = EndpointAddr::new(server_peer_id).with_relay_url(relay_url); +2080 let conn = ep.connect(endpoint_addr, TEST_ALPN).await?; +2081 let mut stream = conn.open_uni().await.anyerr()?; +2082 +2083 // First write is accepted by server. We need this bit of synchronisation +2084 // because if the server closes after simply accepting the connection we can +2085 // not be sure our .open_uni() call would succeed as it may already receive +2086 // the error. +2087 stream.write_all(b"hello").await.anyerr()?; +2088 +2089 info!("waiting for closed"); +2090 // Remote now closes the connection, we should see an error sometime soon. +2091 let err = conn.closed().await; +2092 let expected_err = ConnectionError::ApplicationClosed(ApplicationClose { +2093 error_code: 7u8.into(), +2094 reason: b"bye".to_vec().into(), +2095 }); +2096 assert_eq!(err, expected_err); +2097 +2098 info!("opening new - expect it to fail"); +2099 let res = conn.open_uni().await; +2100 assert_eq!(res.unwrap_err(), expected_err); +2101 info!("Closing the client"); +2102 ep.close().await; +2103 info!("client test completed"); +2104 Ok::<_, Error>(()) +2105 } +2106 .instrument(info_span!("test-client")), +2107 ); +2108 +2109 let (server, client) = tokio::time::timeout( +2110 Duration::from_secs(30), +2111 n0_future::future::zip(server, client), +2112 ) +2113 .await +2114 .anyerr()?; +2115 server.anyerr()??; +2116 client.anyerr()??; +2117 Ok(()) +2118 } +2119 +2120 #[tokio::test] +2121 #[traced_test] +2122 async fn endpoint_relay_connect_loop() -> Result { +2123 let test_start = Instant::now(); +2124 let n_clients = 5; +2125 let n_chunks_per_client = 2; +2126 let chunk_size = 100; +2127 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); +2128 let (relay_map, relay_url, _relay_guard) = run_relay_server().await.unwrap(); +2129 let server_secret_key = SecretKey::from_bytes(&rng.random()); +2130 let server_endpoint_id = server_secret_key.public(); +2131 +2132 // Make sure the server is bound before having clients connect to it: +2133 let ep = Endpoint::builder(presets::Minimal) +2134 .relay_mode(RelayMode::Custom(relay_map.clone())) +2135 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2136 .secret_key(server_secret_key) +2137 .alpns(vec![TEST_ALPN.to_vec()]) +2138 .bind() +2139 .await?; +2140 // Also make sure the server has a working relay connection +2141 ep.online().await; 2142 -2143 // The server accepts the connections of the clients sequentially. -2144 let server = tokio::spawn( -2145 async move { -2146 let eps = ep.bound_sockets(); -2147 -2148 info!(me = %ep.id().fmt_short(), eps = ?eps, "server listening on"); -2149 for i in 0..n_clients { -2150 let res = tokio::time::timeout(Duration::from_secs(5), async { -2151 let round_start = Instant::now(); -2152 info!("[server] round {i}"); -2153 let incoming = ep.accept().await.anyerr()?; -2154 let conn = incoming.await.anyerr()?; -2155 let endpoint_id = conn.remote_id(); -2156 info!(%i, peer = %endpoint_id.fmt_short(), "accepted connection"); -2157 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; -2158 let mut buf = vec![0u8; chunk_size]; -2159 for _i in 0..n_chunks_per_client { -2160 recv.read_exact(&mut buf).await.anyerr()?; -2161 send.write_all(&buf).await.anyerr()?; -2162 } -2163 info!(%i, peer = %endpoint_id.fmt_short(), "finishing"); -2164 send.finish().anyerr()?; -2165 conn.closed().await; // we're the last to send data, so we wait for the other side to close -2166 info!(%i, peer = %endpoint_id.fmt_short(), "finished"); -2167 info!("[server] round {i} done in {:?}", round_start.elapsed()); -2168 Ok::<_, Error>(()) -2169 }) -2170 .await -2171 .std_context("timeout"); -2172 match res { -2173 Err(err) | Ok(Err(err)) => { -2174 // ensure we close the endpoint before returning early -2175 // on error -2176 ep.close().await; -2177 return Err(err); -2178 } -2179 _ => { -2180 // if this round went `Ok` don't close the endpoint yet -2181 } -2182 } -2183 } -2184 // close the endpoint before dropping the server task -2185 ep.close().await; -2186 Ok::<_, Error>(()) -2187 } -2188 .instrument(debug_span!("server")), -2189 ); -2190 -2191 let client = tokio::spawn(async move { -2192 for i in 0..n_clients { -2193 let round_start = Instant::now(); -2194 info!("[client] round {i}"); -2195 let client_secret_key = SecretKey::from_bytes(&rng.random()); -2196 let ep = Endpoint::builder(presets::Minimal) -2197 .relay_mode(RelayMode::Custom(relay_map.clone())) -2198 .alpns(vec![TEST_ALPN.to_vec()]) -2199 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2200 .secret_key(client_secret_key) -2201 .bind() -2202 .await?; -2203 let ep_1 = ep.clone(); -2204 let res = tokio::time::timeout( -2205 Duration::from_secs(5), -2206 async { -2207 info!("client binding"); -2208 let eps = ep.bound_sockets(); -2209 -2210 info!(me = %ep.id().fmt_short(), eps=?eps, "client bound"); -2211 let endpoint_addr = -2212 EndpointAddr::new(server_endpoint_id).with_relay_url(relay_url.clone()); -2213 info!(to = ?endpoint_addr, "client connecting"); -2214 let conn = ep.connect(endpoint_addr, TEST_ALPN).await.anyerr()?; -2215 info!("client connected"); -2216 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; -2217 -2218 for i in 0..n_chunks_per_client { -2219 let mut buf = vec![i; chunk_size]; -2220 send.write_all(&buf).await.anyerr()?; -2221 recv.read_exact(&mut buf).await.anyerr()?; -2222 assert_eq!(buf, vec![i; chunk_size]); -2223 } -2224 // we're the last to receive data, so we close -2225 conn.close(0u32.into(), b"bye!"); -2226 info!("client finished"); -2227 Ok::<_, Error>(()) -2228 } -2229 .instrument(debug_span!("client", %i)), -2230 ) -2231 .await -2232 .std_context("timeout"); -2233 ep_1.close().await; -2234 info!("client endpoint closed"); -2235 res??; -2236 info!("[client] round {i} done in {:?}", round_start.elapsed()); -2237 } -2238 Ok::<_, Error>(()) -2239 }); -2240 -2241 server.await.anyerr()??; -2242 client.await.anyerr()??; -2243 Ok(()) -2244 } -2245 -2246 #[tokio::test] -2247 #[traced_test] -2248 async fn endpoint_send_relay() -> Result { -2249 let (relay_map, _relay_url, _guard) = run_relay_server().await?; -2250 let client = Endpoint::builder(presets::Minimal) -2251 .relay_mode(RelayMode::Custom(relay_map.clone())) -2252 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2253 .bind() -2254 .await?; -2255 let server = Endpoint::builder(presets::Minimal) -2256 .relay_mode(RelayMode::Custom(relay_map)) -2257 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2258 .alpns(vec![TEST_ALPN.to_vec()]) -2259 .bind() -2260 .await?; -2261 -2262 let task = tokio::spawn({ -2263 let server = server.clone(); -2264 async move { -2265 let Some(conn) = server.accept().await else { -2266 n0_error::bail_any!("Expected an incoming connection"); -2267 }; -2268 let conn = conn.await.anyerr()?; -2269 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; -2270 let data = recv.read_to_end(1000).await.anyerr()?; -2271 send.write_all(&data).await.anyerr()?; -2272 send.finish().anyerr()?; -2273 conn.closed().await; -2274 -2275 Ok::<_, Error>(()) -2276 } -2277 }); -2278 -2279 let addr = server.addr(); -2280 let conn = client.connect(addr, TEST_ALPN).await?; -2281 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; -2282 send.write_all(b"Hello, world!").await.anyerr()?; -2283 send.finish().anyerr()?; -2284 let data = recv.read_to_end(1000).await.anyerr()?; -2285 conn.close(0u32.into(), b"bye!"); -2286 -2287 task.await.anyerr()??; +2143 info!(time = ?test_start.elapsed(), "test setup done"); +2144 +2145 // The server accepts the connections of the clients sequentially. +2146 let server = tokio::spawn( +2147 async move { +2148 let eps = ep.bound_sockets(); +2149 +2150 info!(me = %ep.id().fmt_short(), eps = ?eps, "server listening on"); +2151 for i in 0..n_clients { +2152 let res = tokio::time::timeout(Duration::from_secs(5), async { +2153 let round_start = Instant::now(); +2154 info!("[server] round {i}"); +2155 let incoming = ep.accept().await.anyerr()?; +2156 let conn = incoming.await.anyerr()?; +2157 let endpoint_id = conn.remote_id(); +2158 info!(%i, peer = %endpoint_id.fmt_short(), "accepted connection"); +2159 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; +2160 let mut buf = vec![0u8; chunk_size]; +2161 for _i in 0..n_chunks_per_client { +2162 recv.read_exact(&mut buf).await.anyerr()?; +2163 send.write_all(&buf).await.anyerr()?; +2164 } +2165 info!(%i, peer = %endpoint_id.fmt_short(), "finishing"); +2166 send.finish().anyerr()?; +2167 conn.closed().await; // we're the last to send data, so we wait for the other side to close +2168 info!(%i, peer = %endpoint_id.fmt_short(), "finished"); +2169 info!("[server] round {i} done in {:?}", round_start.elapsed()); +2170 Ok::<_, Error>(()) +2171 }) +2172 .await +2173 .std_context("timeout"); +2174 match res { +2175 Err(err) | Ok(Err(err)) => { +2176 // ensure we close the endpoint before returning early +2177 // on error +2178 ep.close().await; +2179 return Err(err); +2180 } +2181 _ => { +2182 // if this round went `Ok` don't close the endpoint yet +2183 } +2184 } +2185 } +2186 // close the endpoint before dropping the server task +2187 ep.close().await; +2188 Ok::<_, Error>(()) +2189 } +2190 .instrument(debug_span!("server")), +2191 ); +2192 +2193 let client = tokio::spawn(async move { +2194 for i in 0..n_clients { +2195 let round_start = Instant::now(); +2196 info!("[client] round {i}"); +2197 let client_secret_key = SecretKey::from_bytes(&rng.random()); +2198 let ep = Endpoint::builder(presets::Minimal) +2199 .relay_mode(RelayMode::Custom(relay_map.clone())) +2200 .alpns(vec![TEST_ALPN.to_vec()]) +2201 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2202 .secret_key(client_secret_key) +2203 .bind() +2204 .await?; +2205 let ep_1 = ep.clone(); +2206 let res = tokio::time::timeout( +2207 Duration::from_secs(5), +2208 async { +2209 info!("client binding"); +2210 let eps = ep.bound_sockets(); +2211 +2212 info!(me = %ep.id().fmt_short(), eps=?eps, "client bound"); +2213 let endpoint_addr = +2214 EndpointAddr::new(server_endpoint_id).with_relay_url(relay_url.clone()); +2215 info!(to = ?endpoint_addr, "client connecting"); +2216 let conn = ep.connect(endpoint_addr, TEST_ALPN).await.anyerr()?; +2217 info!("client connected"); +2218 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; +2219 +2220 for i in 0..n_chunks_per_client { +2221 let mut buf = vec![i; chunk_size]; +2222 send.write_all(&buf).await.anyerr()?; +2223 recv.read_exact(&mut buf).await.anyerr()?; +2224 assert_eq!(buf, vec![i; chunk_size]); +2225 } +2226 // we're the last to receive data, so we close +2227 conn.close(0u32.into(), b"bye!"); +2228 info!("client finished"); +2229 Ok::<_, Error>(()) +2230 } +2231 .instrument(debug_span!("client", %i)), +2232 ) +2233 .await +2234 .std_context("timeout"); +2235 ep_1.close().await; +2236 info!("client endpoint closed"); +2237 res??; +2238 info!("[client] round {i} done in {:?}", round_start.elapsed()); +2239 } +2240 Ok::<_, Error>(()) +2241 }); +2242 +2243 server.await.anyerr()??; +2244 client.await.anyerr()??; +2245 Ok(()) +2246 } +2247 +2248 #[tokio::test] +2249 #[traced_test] +2250 async fn endpoint_send_relay() -> Result { +2251 let (relay_map, _relay_url, _guard) = run_relay_server().await?; +2252 let client = Endpoint::builder(presets::Minimal) +2253 .relay_mode(RelayMode::Custom(relay_map.clone())) +2254 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2255 .bind() +2256 .await?; +2257 let server = Endpoint::builder(presets::Minimal) +2258 .relay_mode(RelayMode::Custom(relay_map)) +2259 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2260 .alpns(vec![TEST_ALPN.to_vec()]) +2261 .bind() +2262 .await?; +2263 +2264 let task = tokio::spawn({ +2265 let server = server.clone(); +2266 async move { +2267 let Some(conn) = server.accept().await else { +2268 n0_error::bail_any!("Expected an incoming connection"); +2269 }; +2270 let conn = conn.await.anyerr()?; +2271 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; +2272 let data = recv.read_to_end(1000).await.anyerr()?; +2273 send.write_all(&data).await.anyerr()?; +2274 send.finish().anyerr()?; +2275 conn.closed().await; +2276 +2277 Ok::<_, Error>(()) +2278 } +2279 }); +2280 +2281 let addr = server.addr(); +2282 let conn = client.connect(addr, TEST_ALPN).await?; +2283 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; +2284 send.write_all(b"Hello, world!").await.anyerr()?; +2285 send.finish().anyerr()?; +2286 let data = recv.read_to_end(1000).await.anyerr()?; +2287 conn.close(0u32.into(), b"bye!"); 2288 -2289 client.close().await; -2290 server.close().await; -2291 -2292 assert_eq!(&data, b"Hello, world!"); +2289 task.await.anyerr()??; +2290 +2291 client.close().await; +2292 server.close().await; 2293 -2294 Ok(()) -2295 } -2296 -2297 #[tokio::test] -2298 #[traced_test] -2299 async fn endpoint_two_direct_only() -> Result { -2300 // Connect two endpoints on the same network, without a relay server, without -2301 // Address Lookup. -2302 let ep1 = { -2303 let span = info_span!("server"); -2304 let _guard = span.enter(); -2305 Endpoint::builder(presets::N0) -2306 .alpns(vec![TEST_ALPN.to_vec()]) -2307 .relay_mode(RelayMode::Disabled) -2308 .bind() -2309 .await? -2310 }; -2311 let ep2 = { -2312 let span = info_span!("client"); -2313 let _guard = span.enter(); -2314 Endpoint::builder(presets::N0) -2315 .alpns(vec![TEST_ALPN.to_vec()]) -2316 .relay_mode(RelayMode::Disabled) -2317 .bind() -2318 .await? -2319 }; -2320 let ep1_nodeaddr = ep1.addr(); -2321 -2322 #[instrument(name = "client", skip_all)] -2323 async fn connect(ep: Endpoint, dst: EndpointAddr) -> Result<ConnectionError> { -2324 info!(me = %ep.id().fmt_short(), "client starting"); -2325 let conn = ep.connect(dst, TEST_ALPN).await?; -2326 let mut send = conn.open_uni().await.anyerr()?; -2327 send.write_all(b"hello").await.anyerr()?; -2328 send.finish().anyerr()?; -2329 Ok(conn.closed().await) -2330 } -2331 -2332 #[instrument(name = "server", skip_all)] -2333 async fn accept(ep: Endpoint, src: EndpointId) -> Result { -2334 info!(me = %ep.id().fmt_short(), "server starting"); -2335 let conn = ep.accept().await.anyerr()?.await.anyerr()?; -2336 let node_id = conn.remote_id(); -2337 assert_eq!(node_id, src); -2338 let mut recv = conn.accept_uni().await.anyerr()?; -2339 let msg = recv.read_to_end(100).await.anyerr()?; -2340 assert_eq!(msg, b"hello"); -2341 // Dropping the connection closes it just fine. -2342 Ok(()) -2343 } -2344 -2345 let ep1_accept = tokio::spawn(accept(ep1.clone(), ep2.id())); -2346 let ep2_connect = tokio::spawn(connect(ep2.clone(), ep1_nodeaddr)); -2347 -2348 ep1_accept.await.anyerr()??; -2349 let conn_closed = dbg!(ep2_connect.await.anyerr()??); -2350 assert!(matches!( -2351 conn_closed, -2352 ConnectionError::ApplicationClosed(ApplicationClose { .. }) -2353 )); -2354 -2355 Ok(()) -2356 } -2357 -2358 #[tokio::test] -2359 #[traced_test] -2360 async fn endpoint_two_relay_only_becomes_direct() -> Result { -2361 // Connect two endpoints on the same network, via a relay server, without -2362 // Address Lookup. Wait until there is a direct connection. -2363 let (relay_map, _relay_url, _relay_server_guard) = run_relay_server().await?; -2364 let (node_addr_tx, node_addr_rx) = oneshot::channel(); -2365 let qlog = Arc::new(QlogFileGroup::from_env("two_relay_only_becomes_direct")); -2366 -2367 #[instrument(name = "client", skip_all)] -2368 async fn connect( -2369 relay_map: RelayMap, -2370 node_addr_rx: oneshot::Receiver<EndpointAddr>, -2371 qlog: Arc<QlogFileGroup>, -2372 ) -> Result<ConnectionError> { -2373 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -2374 let secret = SecretKey::from_bytes(&rng.random()); -2375 let ep = Endpoint::builder(presets::N0) -2376 .secret_key(secret) -2377 .alpns(vec![TEST_ALPN.to_vec()]) -2378 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2379 .relay_mode(RelayMode::Custom(relay_map)) -2380 .transport_config(qlog.create("client")?) -2381 .bind() -2382 .await?; -2383 info!(me = %ep.id().fmt_short(), "client starting"); -2384 let dst = node_addr_rx.await.anyerr()?; -2385 -2386 info!(me = %ep.id().fmt_short(), "client connecting"); -2387 let conn = ep.connect(dst, TEST_ALPN).await?; -2388 let mut send = conn.open_uni().await.anyerr()?; -2389 send.write_all(b"hello").await.anyerr()?; -2390 let mut paths = conn.paths_stream(); -2391 info!("Waiting for direct connection"); -2392 while let Some(infos) = paths.next().await { -2393 info!(?infos, "new PathInfos"); -2394 if infos.iter().any(|info| info.is_ip()) { -2395 break; -2396 } -2397 } -2398 info!("Have direct connection"); -2399 #[cfg(feature = "metrics")] -2400 { -2401 // Validate holepunch metrics. -2402 assert_eq!(ep.metrics().socket.num_conns_opened.get(), 1); -2403 assert_eq!(ep.metrics().socket.num_conns_direct.get(), 1); -2404 } -2405 -2406 send.write_all(b"close please").await.anyerr()?; -2407 send.finish().anyerr()?; -2408 -2409 let res = conn.closed().await; -2410 ep.close().await; -2411 Ok(res) -2412 } -2413 -2414 #[instrument(name = "server", skip_all)] -2415 async fn accept( -2416 relay_map: RelayMap, -2417 node_addr_tx: oneshot::Sender<EndpointAddr>, -2418 qlog: Arc<QlogFileGroup>, -2419 ) -> Result { -2420 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(1u64); -2421 let secret = SecretKey::from_bytes(&rng.random()); -2422 let ep = Endpoint::builder(presets::N0) -2423 .secret_key(secret) -2424 .alpns(vec![TEST_ALPN.to_vec()]) -2425 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2426 .transport_config(qlog.create("server")?) -2427 .relay_mode(RelayMode::Custom(relay_map)) -2428 .bind() -2429 .await?; -2430 ep.online().await; -2431 let mut node_addr = ep.addr(); -2432 node_addr.addrs.retain(|addr| addr.is_relay()); -2433 node_addr_tx.send(node_addr).unwrap(); -2434 -2435 info!(me = %ep.id().fmt_short(), "server starting"); -2436 let conn = ep.accept().await.anyerr()?.await.anyerr()?; -2437 // let node_id = conn.remote_node_id()?; -2438 // assert_eq!(node_id, src); -2439 let mut recv = conn.accept_uni().await.anyerr()?; -2440 let mut msg = [0u8; 5]; -2441 recv.read_exact(&mut msg).await.anyerr()?; -2442 assert_eq!(&msg, b"hello"); -2443 info!("received hello"); -2444 let msg = recv.read_to_end(100).await.anyerr()?; -2445 assert_eq!(msg, b"close please"); -2446 info!("received 'close please'"); -2447 // Closing the endpoint closes all connections. -2448 ep.close().await; -2449 Ok(()) -2450 } -2451 -2452 let server_task = tokio::spawn(accept(relay_map.clone(), node_addr_tx, qlog.clone())); -2453 let client_task = tokio::spawn(connect(relay_map, node_addr_rx, qlog)); -2454 -2455 server_task.await.anyerr()??; -2456 let conn_closed = dbg!(client_task.await.anyerr()??); -2457 assert!(matches!( -2458 conn_closed, -2459 ConnectionError::ApplicationClosed(ApplicationClose { .. }) -2460 )); -2461 -2462 Ok(()) -2463 } -2464 -2465 #[tokio::test] -2466 #[traced_test] -2467 async fn endpoint_two_relay_only_no_ip() -> Result { -2468 // Connect two endpoints on the same network, via a relay server, without -2469 // Address Lookup. -2470 let (relay_map, _relay_url, _relay_server_guard) = run_relay_server().await?; -2471 let (node_addr_tx, node_addr_rx) = oneshot::channel(); -2472 -2473 #[instrument(name = "client", skip_all)] -2474 async fn connect( -2475 relay_map: RelayMap, -2476 node_addr_rx: oneshot::Receiver<EndpointAddr>, -2477 ) -> Result<ConnectionError> { -2478 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -2479 let secret = SecretKey::from_bytes(&rng.random()); -2480 let ep = Endpoint::builder(presets::N0) -2481 .secret_key(secret) -2482 .alpns(vec![TEST_ALPN.to_vec()]) -2483 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2484 .relay_mode(RelayMode::Custom(relay_map)) -2485 .clear_ip_transports() // disable direct -2486 .bind() -2487 .await?; -2488 info!(me = %ep.id().fmt_short(), "client starting"); -2489 let dst = node_addr_rx.await.anyerr()?; -2490 -2491 info!(me = %ep.id().fmt_short(), "client connecting"); -2492 let conn = ep.connect(dst, TEST_ALPN).await?; -2493 let mut send = conn.open_uni().await.anyerr()?; -2494 send.write_all(b"hello").await.anyerr()?; -2495 let mut paths = conn.paths_stream(); -2496 info!("Waiting for connection"); -2497 'outer: while let Some(infos) = paths.next().await { -2498 info!(?infos, "new PathInfos"); -2499 for info in infos.iter() { -2500 if info.is_ip() { -2501 panic!("should not happen: {:?}", info); -2502 } -2503 if info.is_relay() { -2504 break 'outer; -2505 } -2506 } -2507 } -2508 info!("Have relay connection"); -2509 -2510 send.write_all(b"close please").await.anyerr()?; -2511 send.finish().anyerr()?; -2512 let res = conn.closed().await; -2513 ep.close().await; -2514 Ok(res) -2515 } -2516 -2517 #[instrument(name = "server", skip_all)] -2518 async fn accept( -2519 relay_map: RelayMap, -2520 node_addr_tx: oneshot::Sender<EndpointAddr>, -2521 ) -> Result { -2522 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(1u64); -2523 let secret = SecretKey::from_bytes(&rng.random()); -2524 let ep = Endpoint::builder(presets::N0) -2525 .secret_key(secret) -2526 .alpns(vec![TEST_ALPN.to_vec()]) -2527 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2528 .relay_mode(RelayMode::Custom(relay_map)) -2529 .clear_ip_transports() -2530 .bind() -2531 .await?; -2532 ep.online().await; -2533 let node_addr = ep.addr(); -2534 node_addr_tx.send(node_addr).unwrap(); -2535 -2536 info!(me = %ep.id().fmt_short(), "server starting"); -2537 let conn = ep.accept().await.anyerr()?.await.anyerr()?; -2538 // let node_id = conn.remote_node_id()?; -2539 // assert_eq!(node_id, src); -2540 let mut recv = conn.accept_uni().await.anyerr()?; -2541 let mut msg = [0u8; 5]; -2542 recv.read_exact(&mut msg).await.anyerr()?; -2543 assert_eq!(&msg, b"hello"); -2544 info!("received hello"); -2545 let msg = recv.read_to_end(100).await.anyerr()?; -2546 assert_eq!(msg, b"close please"); -2547 info!("received 'close please'"); -2548 // Closing the endpoint closes all connections. -2549 ep.close().await; -2550 Ok(()) -2551 } -2552 -2553 let server_task = tokio::spawn(accept(relay_map.clone(), node_addr_tx)); -2554 let client_task = tokio::spawn(connect(relay_map, node_addr_rx)); -2555 -2556 server_task.await.anyerr()??; -2557 let conn_closed = dbg!(client_task.await.anyerr()??); -2558 assert!(matches!( -2559 conn_closed, -2560 ConnectionError::ApplicationClosed(ApplicationClose { .. }) -2561 )); -2562 -2563 Ok(()) -2564 } -2565 -2566 #[tokio::test] -2567 #[traced_test] -2568 async fn endpoint_two_direct_add_relay() -> Result { -2569 // Connect two endpoints on the same network, without relay server and without -2570 // Address Lookup. Add a relay connection later. -2571 let (relay_map, _relay_url, _relay_server_guard) = run_relay_server().await?; -2572 let (node_addr_tx, node_addr_rx) = oneshot::channel(); -2573 -2574 #[instrument(name = "client", skip_all)] -2575 async fn connect( -2576 relay_map: RelayMap, -2577 node_addr_rx: oneshot::Receiver<EndpointAddr>, -2578 ) -> Result<()> { -2579 let secret = SecretKey::from([0u8; 32]); -2580 let ep = Endpoint::builder(presets::N0) -2581 .secret_key(secret) -2582 .alpns(vec![TEST_ALPN.to_vec()]) -2583 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2584 .relay_mode(RelayMode::Custom(relay_map)) -2585 .bind() -2586 .await?; -2587 info!(me = %ep.id().fmt_short(), "client starting"); -2588 let dst = node_addr_rx.await.anyerr()?; -2589 -2590 info!(me = %ep.id().fmt_short(), "client connecting"); -2591 let conn = ep.connect(dst, TEST_ALPN).await?; -2592 info!(me = %ep.id().fmt_short(), "client connected"); -2593 -2594 // We should be connected via IP, because it is faster than the relay server. -2595 // TODO: Maybe not panic if this is not true? -2596 -2597 let path_info = conn.paths(); -2598 assert_eq!(path_info.len(), 1); -2599 assert!(path_info.iter().next().unwrap().is_ip()); -2600 -2601 let mut paths = conn.paths_stream(); -2602 time::timeout(Duration::from_secs(5), async move { -2603 while let Some(infos) = paths.next().await { -2604 info!(?infos, "new PathInfos"); -2605 if infos.iter().any(|info| info.is_relay()) { -2606 info!("client has a relay path"); -2607 break; -2608 } -2609 } -2610 }) -2611 .await -2612 .anyerr()?; -2613 -2614 // wait for the server to signal it has the relay connection -2615 let mut stream = conn.accept_uni().await.anyerr()?; -2616 stream.read_to_end(100).await.anyerr()?; -2617 -2618 info!("client closing"); -2619 conn.close(0u8.into(), b""); -2620 ep.close().await; -2621 Ok(()) -2622 } -2623 -2624 #[instrument(name = "server", skip_all)] -2625 async fn accept( -2626 relay_map: RelayMap, -2627 node_addr_tx: oneshot::Sender<EndpointAddr>, -2628 ) -> Result<ConnectionError> { -2629 let secret = SecretKey::from([1u8; 32]); -2630 let ep = Endpoint::builder(presets::N0) -2631 .secret_key(secret) -2632 .alpns(vec![TEST_ALPN.to_vec()]) -2633 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2634 .relay_mode(RelayMode::Custom(relay_map)) -2635 .bind() -2636 .await?; -2637 ep.online().await; -2638 let node_addr = ep.addr(); -2639 node_addr_tx.send(node_addr).unwrap(); -2640 -2641 info!(me = %ep.id().fmt_short(), "server starting"); -2642 let conn = ep.accept().await.anyerr()?.await.anyerr()?; -2643 info!(me = %ep.id().fmt_short(), "server accepted connection"); -2644 -2645 // Wait for a relay connection to be added. Client does all the asserting here, -2646 // we just want to wait so we get to see all the mechanics of the connection -2647 // being added on this side too. -2648 let mut paths = conn.paths_stream(); -2649 time::timeout(Duration::from_secs(5), async move { -2650 while let Some(infos) = paths.next().await { -2651 info!(?infos, "new PathInfos"); -2652 if infos.iter().any(|path| path.is_relay()) { -2653 info!("server has a relay path"); -2654 break; -2655 } -2656 } -2657 }) -2658 .await -2659 .anyerr()?; -2660 -2661 let mut stream = conn.open_uni().await.anyerr()?; -2662 stream.write_all(b"have relay").await.anyerr()?; -2663 stream.finish().anyerr()?; -2664 info!("waiting conn.closed()"); -2665 -2666 Ok(conn.closed().await) -2667 } -2668 -2669 let server_task = tokio::spawn(accept(relay_map.clone(), node_addr_tx)); -2670 let client_task = tokio::spawn(connect(relay_map, node_addr_rx)); -2671 -2672 client_task.await.anyerr()??; -2673 let conn_closed = dbg!(server_task.await.anyerr()??); -2674 assert!(matches!( -2675 conn_closed, -2676 ConnectionError::ApplicationClosed(ApplicationClose { .. }) -2677 )); -2678 -2679 Ok(()) -2680 } -2681 -2682 #[tokio::test] -2683 #[traced_test] -2684 async fn endpoint_relay_map_change() -> Result { -2685 let (relay_map, relay_url, _guard1) = run_relay_server().await?; -2686 let client = Endpoint::builder(presets::Minimal) -2687 .relay_mode(RelayMode::Custom(relay_map.clone())) -2688 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2689 .bind() -2690 .await?; -2691 let server = Endpoint::builder(presets::Minimal) -2692 .relay_mode(RelayMode::Custom(relay_map)) -2693 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2694 .alpns(vec![TEST_ALPN.to_vec()]) -2695 .bind() -2696 .await?; -2697 -2698 let task = tokio::spawn({ -2699 let server = server.clone(); -2700 async move { -2701 for i in 0..2 { -2702 println!("accept: round {i}"); -2703 let Some(conn) = server.accept().await else { -2704 n0_error::bail_any!("Expected an incoming connection"); -2705 }; -2706 let conn = conn.await.anyerr()?; -2707 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; -2708 let data = recv.read_to_end(1000).await.anyerr()?; -2709 send.write_all(&data).await.anyerr()?; -2710 send.finish().anyerr()?; -2711 conn.closed().await; -2712 } -2713 Ok::<_, Error>(()) -2714 } -2715 }); -2716 -2717 server.online().await; +2294 assert_eq!(&data, b"Hello, world!"); +2295 +2296 Ok(()) +2297 } +2298 +2299 #[tokio::test] +2300 #[traced_test] +2301 async fn endpoint_two_direct_only() -> Result { +2302 // Connect two endpoints on the same network, without a relay server, without +2303 // Address Lookup. +2304 let ep1 = { +2305 let span = info_span!("server"); +2306 let _guard = span.enter(); +2307 Endpoint::builder(presets::N0) +2308 .alpns(vec![TEST_ALPN.to_vec()]) +2309 .relay_mode(RelayMode::Disabled) +2310 .bind() +2311 .await? +2312 }; +2313 let ep2 = { +2314 let span = info_span!("client"); +2315 let _guard = span.enter(); +2316 Endpoint::builder(presets::N0) +2317 .alpns(vec![TEST_ALPN.to_vec()]) +2318 .relay_mode(RelayMode::Disabled) +2319 .bind() +2320 .await? +2321 }; +2322 let ep1_nodeaddr = ep1.addr(); +2323 +2324 #[instrument(name = "client", skip_all)] +2325 async fn connect(ep: Endpoint, dst: EndpointAddr) -> Result<ConnectionError> { +2326 info!(me = %ep.id().fmt_short(), "client starting"); +2327 let conn = ep.connect(dst, TEST_ALPN).await?; +2328 let mut send = conn.open_uni().await.anyerr()?; +2329 send.write_all(b"hello").await.anyerr()?; +2330 send.finish().anyerr()?; +2331 Ok(conn.closed().await) +2332 } +2333 +2334 #[instrument(name = "server", skip_all)] +2335 async fn accept(ep: Endpoint, src: EndpointId) -> Result { +2336 info!(me = %ep.id().fmt_short(), "server starting"); +2337 let conn = ep.accept().await.anyerr()?.await.anyerr()?; +2338 let node_id = conn.remote_id(); +2339 assert_eq!(node_id, src); +2340 let mut recv = conn.accept_uni().await.anyerr()?; +2341 let msg = recv.read_to_end(100).await.anyerr()?; +2342 assert_eq!(msg, b"hello"); +2343 // Dropping the connection closes it just fine. +2344 Ok(()) +2345 } +2346 +2347 let ep1_accept = tokio::spawn(accept(ep1.clone(), ep2.id())); +2348 let ep2_connect = tokio::spawn(connect(ep2.clone(), ep1_nodeaddr)); +2349 +2350 ep1_accept.await.anyerr()??; +2351 let conn_closed = dbg!(ep2_connect.await.anyerr()??); +2352 assert!(matches!( +2353 conn_closed, +2354 ConnectionError::ApplicationClosed(ApplicationClose { .. }) +2355 )); +2356 +2357 Ok(()) +2358 } +2359 +2360 #[tokio::test] +2361 #[traced_test] +2362 async fn endpoint_two_relay_only_becomes_direct() -> Result { +2363 // Connect two endpoints on the same network, via a relay server, without +2364 // Address Lookup. Wait until there is a direct connection. +2365 let (relay_map, _relay_url, _relay_server_guard) = run_relay_server().await?; +2366 let (node_addr_tx, node_addr_rx) = oneshot::channel(); +2367 let qlog = Arc::new(QlogFileGroup::from_env("two_relay_only_becomes_direct")); +2368 +2369 #[instrument(name = "client", skip_all)] +2370 async fn connect( +2371 relay_map: RelayMap, +2372 node_addr_rx: oneshot::Receiver<EndpointAddr>, +2373 qlog: Arc<QlogFileGroup>, +2374 ) -> Result<ConnectionError> { +2375 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2376 let secret = SecretKey::from_bytes(&rng.random()); +2377 let ep = Endpoint::builder(presets::N0) +2378 .secret_key(secret) +2379 .alpns(vec![TEST_ALPN.to_vec()]) +2380 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2381 .relay_mode(RelayMode::Custom(relay_map)) +2382 .transport_config(qlog.create("client")?) +2383 .bind() +2384 .await?; +2385 info!(me = %ep.id().fmt_short(), "client starting"); +2386 let dst = node_addr_rx.await.anyerr()?; +2387 +2388 info!(me = %ep.id().fmt_short(), "client connecting"); +2389 let conn = ep.connect(dst, TEST_ALPN).await?; +2390 let mut send = conn.open_uni().await.anyerr()?; +2391 send.write_all(b"hello").await.anyerr()?; +2392 let mut paths = conn.paths_stream(); +2393 info!("Waiting for direct connection"); +2394 while let Some(infos) = paths.next().await { +2395 info!(?infos, "new PathInfos"); +2396 if infos.iter().any(|info| info.is_ip()) { +2397 break; +2398 } +2399 } +2400 info!("Have direct connection"); +2401 #[cfg(feature = "metrics")] +2402 { +2403 // Validate holepunch metrics. +2404 assert_eq!(ep.metrics().socket.num_conns_opened.get(), 1); +2405 assert_eq!(ep.metrics().socket.num_conns_direct.get(), 1); +2406 } +2407 +2408 send.write_all(b"close please").await.anyerr()?; +2409 send.finish().anyerr()?; +2410 +2411 let res = conn.closed().await; +2412 ep.close().await; +2413 Ok(res) +2414 } +2415 +2416 #[instrument(name = "server", skip_all)] +2417 async fn accept( +2418 relay_map: RelayMap, +2419 node_addr_tx: oneshot::Sender<EndpointAddr>, +2420 qlog: Arc<QlogFileGroup>, +2421 ) -> Result { +2422 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(1u64); +2423 let secret = SecretKey::from_bytes(&rng.random()); +2424 let ep = Endpoint::builder(presets::N0) +2425 .secret_key(secret) +2426 .alpns(vec![TEST_ALPN.to_vec()]) +2427 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2428 .transport_config(qlog.create("server")?) +2429 .relay_mode(RelayMode::Custom(relay_map)) +2430 .bind() +2431 .await?; +2432 ep.online().await; +2433 let mut node_addr = ep.addr(); +2434 node_addr.addrs.retain(|addr| addr.is_relay()); +2435 node_addr_tx.send(node_addr).unwrap(); +2436 +2437 info!(me = %ep.id().fmt_short(), "server starting"); +2438 let conn = ep.accept().await.anyerr()?.await.anyerr()?; +2439 // let node_id = conn.remote_node_id()?; +2440 // assert_eq!(node_id, src); +2441 let mut recv = conn.accept_uni().await.anyerr()?; +2442 let mut msg = [0u8; 5]; +2443 recv.read_exact(&mut msg).await.anyerr()?; +2444 assert_eq!(&msg, b"hello"); +2445 info!("received hello"); +2446 let msg = recv.read_to_end(100).await.anyerr()?; +2447 assert_eq!(msg, b"close please"); +2448 info!("received 'close please'"); +2449 // Closing the endpoint closes all connections. +2450 ep.close().await; +2451 Ok(()) +2452 } +2453 +2454 let server_task = tokio::spawn(accept(relay_map.clone(), node_addr_tx, qlog.clone())); +2455 let client_task = tokio::spawn(connect(relay_map, node_addr_rx, qlog)); +2456 +2457 server_task.await.anyerr()??; +2458 let conn_closed = dbg!(client_task.await.anyerr()??); +2459 assert!(matches!( +2460 conn_closed, +2461 ConnectionError::ApplicationClosed(ApplicationClose { .. }) +2462 )); +2463 +2464 Ok(()) +2465 } +2466 +2467 #[tokio::test] +2468 #[traced_test] +2469 async fn endpoint_two_relay_only_no_ip() -> Result { +2470 // Connect two endpoints on the same network, via a relay server, without +2471 // Address Lookup. +2472 let (relay_map, _relay_url, _relay_server_guard) = run_relay_server().await?; +2473 let (node_addr_tx, node_addr_rx) = oneshot::channel(); +2474 +2475 #[instrument(name = "client", skip_all)] +2476 async fn connect( +2477 relay_map: RelayMap, +2478 node_addr_rx: oneshot::Receiver<EndpointAddr>, +2479 ) -> Result<ConnectionError> { +2480 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2481 let secret = SecretKey::from_bytes(&rng.random()); +2482 let ep = Endpoint::builder(presets::N0) +2483 .secret_key(secret) +2484 .alpns(vec![TEST_ALPN.to_vec()]) +2485 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2486 .relay_mode(RelayMode::Custom(relay_map)) +2487 .clear_ip_transports() // disable direct +2488 .bind() +2489 .await?; +2490 info!(me = %ep.id().fmt_short(), "client starting"); +2491 let dst = node_addr_rx.await.anyerr()?; +2492 +2493 info!(me = %ep.id().fmt_short(), "client connecting"); +2494 let conn = ep.connect(dst, TEST_ALPN).await?; +2495 let mut send = conn.open_uni().await.anyerr()?; +2496 send.write_all(b"hello").await.anyerr()?; +2497 let mut paths = conn.paths_stream(); +2498 info!("Waiting for connection"); +2499 'outer: while let Some(infos) = paths.next().await { +2500 info!(?infos, "new PathInfos"); +2501 for info in infos.iter() { +2502 if info.is_ip() { +2503 panic!("should not happen: {:?}", info); +2504 } +2505 if info.is_relay() { +2506 break 'outer; +2507 } +2508 } +2509 } +2510 info!("Have relay connection"); +2511 +2512 send.write_all(b"close please").await.anyerr()?; +2513 send.finish().anyerr()?; +2514 let res = conn.closed().await; +2515 ep.close().await; +2516 Ok(res) +2517 } +2518 +2519 #[instrument(name = "server", skip_all)] +2520 async fn accept( +2521 relay_map: RelayMap, +2522 node_addr_tx: oneshot::Sender<EndpointAddr>, +2523 ) -> Result { +2524 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(1u64); +2525 let secret = SecretKey::from_bytes(&rng.random()); +2526 let ep = Endpoint::builder(presets::N0) +2527 .secret_key(secret) +2528 .alpns(vec![TEST_ALPN.to_vec()]) +2529 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2530 .relay_mode(RelayMode::Custom(relay_map)) +2531 .clear_ip_transports() +2532 .bind() +2533 .await?; +2534 ep.online().await; +2535 let node_addr = ep.addr(); +2536 node_addr_tx.send(node_addr).unwrap(); +2537 +2538 info!(me = %ep.id().fmt_short(), "server starting"); +2539 let conn = ep.accept().await.anyerr()?.await.anyerr()?; +2540 // let node_id = conn.remote_node_id()?; +2541 // assert_eq!(node_id, src); +2542 let mut recv = conn.accept_uni().await.anyerr()?; +2543 let mut msg = [0u8; 5]; +2544 recv.read_exact(&mut msg).await.anyerr()?; +2545 assert_eq!(&msg, b"hello"); +2546 info!("received hello"); +2547 let msg = recv.read_to_end(100).await.anyerr()?; +2548 assert_eq!(msg, b"close please"); +2549 info!("received 'close please'"); +2550 // Closing the endpoint closes all connections. +2551 ep.close().await; +2552 Ok(()) +2553 } +2554 +2555 let server_task = tokio::spawn(accept(relay_map.clone(), node_addr_tx)); +2556 let client_task = tokio::spawn(connect(relay_map, node_addr_rx)); +2557 +2558 server_task.await.anyerr()??; +2559 let conn_closed = dbg!(client_task.await.anyerr()??); +2560 assert!(matches!( +2561 conn_closed, +2562 ConnectionError::ApplicationClosed(ApplicationClose { .. }) +2563 )); +2564 +2565 Ok(()) +2566 } +2567 +2568 #[tokio::test] +2569 #[traced_test] +2570 async fn endpoint_two_direct_add_relay() -> Result { +2571 // Connect two endpoints on the same network, without relay server and without +2572 // Address Lookup. Add a relay connection later. +2573 let (relay_map, _relay_url, _relay_server_guard) = run_relay_server().await?; +2574 let (node_addr_tx, node_addr_rx) = oneshot::channel(); +2575 +2576 #[instrument(name = "client", skip_all)] +2577 async fn connect( +2578 relay_map: RelayMap, +2579 node_addr_rx: oneshot::Receiver<EndpointAddr>, +2580 ) -> Result<()> { +2581 let secret = SecretKey::from([0u8; 32]); +2582 let ep = Endpoint::builder(presets::N0) +2583 .secret_key(secret) +2584 .alpns(vec![TEST_ALPN.to_vec()]) +2585 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2586 .relay_mode(RelayMode::Custom(relay_map)) +2587 .bind() +2588 .await?; +2589 info!(me = %ep.id().fmt_short(), "client starting"); +2590 let dst = node_addr_rx.await.anyerr()?; +2591 +2592 info!(me = %ep.id().fmt_short(), "client connecting"); +2593 let conn = ep.connect(dst, TEST_ALPN).await?; +2594 info!(me = %ep.id().fmt_short(), "client connected"); +2595 +2596 // We should be connected via IP, because it is faster than the relay server. +2597 // TODO: Maybe not panic if this is not true? +2598 +2599 let path_info = conn.paths(); +2600 assert_eq!(path_info.len(), 1); +2601 assert!(path_info.iter().next().unwrap().is_ip()); +2602 +2603 let mut paths = conn.paths_stream(); +2604 time::timeout(Duration::from_secs(5), async move { +2605 while let Some(infos) = paths.next().await { +2606 info!(?infos, "new PathInfos"); +2607 if infos.iter().any(|info| info.is_relay()) { +2608 info!("client has a relay path"); +2609 break; +2610 } +2611 } +2612 }) +2613 .await +2614 .anyerr()?; +2615 +2616 // wait for the server to signal it has the relay connection +2617 let mut stream = conn.accept_uni().await.anyerr()?; +2618 stream.read_to_end(100).await.anyerr()?; +2619 +2620 info!("client closing"); +2621 conn.close(0u8.into(), b""); +2622 ep.close().await; +2623 Ok(()) +2624 } +2625 +2626 #[instrument(name = "server", skip_all)] +2627 async fn accept( +2628 relay_map: RelayMap, +2629 node_addr_tx: oneshot::Sender<EndpointAddr>, +2630 ) -> Result<ConnectionError> { +2631 let secret = SecretKey::from([1u8; 32]); +2632 let ep = Endpoint::builder(presets::N0) +2633 .secret_key(secret) +2634 .alpns(vec![TEST_ALPN.to_vec()]) +2635 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2636 .relay_mode(RelayMode::Custom(relay_map)) +2637 .bind() +2638 .await?; +2639 ep.online().await; +2640 let node_addr = ep.addr(); +2641 node_addr_tx.send(node_addr).unwrap(); +2642 +2643 info!(me = %ep.id().fmt_short(), "server starting"); +2644 let conn = ep.accept().await.anyerr()?.await.anyerr()?; +2645 info!(me = %ep.id().fmt_short(), "server accepted connection"); +2646 +2647 // Wait for a relay connection to be added. Client does all the asserting here, +2648 // we just want to wait so we get to see all the mechanics of the connection +2649 // being added on this side too. +2650 let mut paths = conn.paths_stream(); +2651 time::timeout(Duration::from_secs(5), async move { +2652 while let Some(infos) = paths.next().await { +2653 info!(?infos, "new PathInfos"); +2654 if infos.iter().any(|path| path.is_relay()) { +2655 info!("server has a relay path"); +2656 break; +2657 } +2658 } +2659 }) +2660 .await +2661 .anyerr()?; +2662 +2663 let mut stream = conn.open_uni().await.anyerr()?; +2664 stream.write_all(b"have relay").await.anyerr()?; +2665 stream.finish().anyerr()?; +2666 info!("waiting conn.closed()"); +2667 +2668 Ok(conn.closed().await) +2669 } +2670 +2671 let server_task = tokio::spawn(accept(relay_map.clone(), node_addr_tx)); +2672 let client_task = tokio::spawn(connect(relay_map, node_addr_rx)); +2673 +2674 client_task.await.anyerr()??; +2675 let conn_closed = dbg!(server_task.await.anyerr()??); +2676 assert!(matches!( +2677 conn_closed, +2678 ConnectionError::ApplicationClosed(ApplicationClose { .. }) +2679 )); +2680 +2681 Ok(()) +2682 } +2683 +2684 #[tokio::test] +2685 #[traced_test] +2686 async fn endpoint_relay_map_change() -> Result { +2687 let (relay_map, relay_url, _guard1) = run_relay_server().await?; +2688 let client = Endpoint::builder(presets::Minimal) +2689 .relay_mode(RelayMode::Custom(relay_map.clone())) +2690 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2691 .bind() +2692 .await?; +2693 let server = Endpoint::builder(presets::Minimal) +2694 .relay_mode(RelayMode::Custom(relay_map)) +2695 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2696 .alpns(vec![TEST_ALPN.to_vec()]) +2697 .bind() +2698 .await?; +2699 +2700 let task = tokio::spawn({ +2701 let server = server.clone(); +2702 async move { +2703 for i in 0..2 { +2704 println!("accept: round {i}"); +2705 let Some(conn) = server.accept().await else { +2706 n0_error::bail_any!("Expected an incoming connection"); +2707 }; +2708 let conn = conn.await.anyerr()?; +2709 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; +2710 let data = recv.read_to_end(1000).await.anyerr()?; +2711 send.write_all(&data).await.anyerr()?; +2712 send.finish().anyerr()?; +2713 conn.closed().await; +2714 } +2715 Ok::<_, Error>(()) +2716 } +2717 }); 2718 -2719 let mut addr = server.addr(); -2720 println!("round1: {:?}", addr); -2721 -2722 // remove direct addrs to force relay usage -2723 addr.addrs -2724 .retain(|addr| !matches!(addr, TransportAddr::Ip(_))); -2725 -2726 let conn = client.connect(addr, TEST_ALPN).await?; -2727 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; -2728 send.write_all(b"Hello, world!").await.anyerr()?; -2729 send.finish().anyerr()?; -2730 let data = recv.read_to_end(1000).await.anyerr()?; -2731 conn.close(0u32.into(), b"bye!"); -2732 -2733 assert_eq!(&data, b"Hello, world!"); +2719 server.online().await; +2720 +2721 let mut addr = server.addr(); +2722 println!("round1: {:?}", addr); +2723 +2724 // remove direct addrs to force relay usage +2725 addr.addrs +2726 .retain(|addr| !matches!(addr, TransportAddr::Ip(_))); +2727 +2728 let conn = client.connect(addr, TEST_ALPN).await?; +2729 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; +2730 send.write_all(b"Hello, world!").await.anyerr()?; +2731 send.finish().anyerr()?; +2732 let data = recv.read_to_end(1000).await.anyerr()?; +2733 conn.close(0u32.into(), b"bye!"); 2734 -2735 // setup a second relay server -2736 let (new_relay_map, new_relay_url, _guard2) = run_relay_server().await?; -2737 let new_endpoint = new_relay_map -2738 .get(&new_relay_url) -2739 .expect("missing endpoint") -2740 .clone(); -2741 dbg!(&new_relay_map); -2742 -2743 let addr_watcher = server.watch_addr(); +2735 assert_eq!(&data, b"Hello, world!"); +2736 +2737 // setup a second relay server +2738 let (new_relay_map, new_relay_url, _guard2) = run_relay_server().await?; +2739 let new_endpoint = new_relay_map +2740 .get(&new_relay_url) +2741 .expect("missing endpoint") +2742 .clone(); +2743 dbg!(&new_relay_map); 2744 -2745 // add new new relay -2746 assert!( -2747 server -2748 .insert_relay(new_relay_url.clone(), new_endpoint.clone()) -2749 .await -2750 .is_none() -2751 ); -2752 // remove the old relay -2753 assert!(server.remove_relay(&relay_url).await.is_some()); -2754 -2755 println!("------- changed ----- "); +2745 let addr_watcher = server.watch_addr(); +2746 +2747 // add new new relay +2748 assert!( +2749 server +2750 .insert_relay(new_relay_url.clone(), new_endpoint.clone()) +2751 .await +2752 .is_none() +2753 ); +2754 // remove the old relay +2755 assert!(server.remove_relay(&relay_url).await.is_some()); 2756 -2757 let mut addr = tokio::time::timeout(Duration::from_secs(10), async move { -2758 let mut stream = addr_watcher.stream(); -2759 while let Some(addr) = stream.next().await { -2760 if addr.relay_urls().next() != Some(&relay_url) { -2761 return addr; -2762 } -2763 } -2764 panic!("failed to change relay"); -2765 }) -2766 .await -2767 .anyerr()?; -2768 -2769 println!("round2: {:?}", addr); -2770 assert_eq!(addr.relay_urls().next(), Some(&new_relay_url)); -2771 -2772 // remove direct addrs to force relay usage -2773 addr.addrs -2774 .retain(|addr| !matches!(addr, TransportAddr::Ip(_))); -2775 -2776 let conn = client.connect(addr, TEST_ALPN).await?; -2777 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; -2778 send.write_all(b"Hello, world!").await.anyerr()?; -2779 send.finish().anyerr()?; -2780 let data = recv.read_to_end(1000).await.anyerr()?; -2781 conn.close(0u32.into(), b"bye!"); -2782 -2783 task.await.anyerr()??; +2757 println!("------- changed ----- "); +2758 +2759 let mut addr = tokio::time::timeout(Duration::from_secs(10), async move { +2760 let mut stream = addr_watcher.stream(); +2761 while let Some(addr) = stream.next().await { +2762 if addr.relay_urls().next() != Some(&relay_url) { +2763 return addr; +2764 } +2765 } +2766 panic!("failed to change relay"); +2767 }) +2768 .await +2769 .anyerr()?; +2770 +2771 println!("round2: {:?}", addr); +2772 assert_eq!(addr.relay_urls().next(), Some(&new_relay_url)); +2773 +2774 // remove direct addrs to force relay usage +2775 addr.addrs +2776 .retain(|addr| !matches!(addr, TransportAddr::Ip(_))); +2777 +2778 let conn = client.connect(addr, TEST_ALPN).await?; +2779 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; +2780 send.write_all(b"Hello, world!").await.anyerr()?; +2781 send.finish().anyerr()?; +2782 let data = recv.read_to_end(1000).await.anyerr()?; +2783 conn.close(0u32.into(), b"bye!"); 2784 -2785 client.close().await; -2786 server.close().await; -2787 -2788 assert_eq!(&data, b"Hello, world!"); +2785 task.await.anyerr()??; +2786 +2787 client.close().await; +2788 server.close().await; 2789 -2790 Ok(()) -2791 } -2792 -2793 #[tokio::test] -2794 #[traced_test] -2795 async fn endpoint_bidi_send_recv() -> Result { -2796 let disco = MemoryLookup::new(); -2797 let ep1 = Endpoint::builder(presets::Minimal) -2798 .address_lookup(disco.clone()) -2799 .alpns(vec![TEST_ALPN.to_vec()]) -2800 .bind() -2801 .await?; -2802 -2803 let ep2 = Endpoint::builder(presets::Minimal) -2804 .address_lookup(disco.clone()) -2805 .alpns(vec![TEST_ALPN.to_vec()]) -2806 .bind() -2807 .await?; -2808 -2809 disco.add_endpoint_info(ep1.addr()); -2810 disco.add_endpoint_info(ep2.addr()); -2811 -2812 let ep1_endpointid = ep1.id(); -2813 let ep2_endpointid = ep2.id(); -2814 eprintln!("endpoint id 1 {ep1_endpointid}"); -2815 eprintln!("endpoint id 2 {ep2_endpointid}"); -2816 -2817 async fn connect_hello(ep: Endpoint, dst: EndpointId) -> Result { -2818 let conn = ep.connect(dst, TEST_ALPN).await?; -2819 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; -2820 info!("sending hello"); -2821 send.write_all(b"hello").await.anyerr()?; -2822 send.finish().anyerr()?; -2823 info!("receiving world"); -2824 let m = recv.read_to_end(100).await.anyerr()?; -2825 assert_eq!(m, b"world"); -2826 conn.close(1u8.into(), b"done"); -2827 Ok(()) -2828 } -2829 -2830 async fn accept_world(ep: Endpoint, src: EndpointId) -> Result { -2831 let incoming = ep.accept().await.anyerr()?; -2832 let mut iconn = incoming.accept().anyerr()?; -2833 let alpn = iconn.alpn().await?; -2834 let conn = iconn.await.anyerr()?; -2835 let endpoint_id = conn.remote_id(); -2836 assert_eq!(endpoint_id, src); -2837 assert_eq!(alpn, TEST_ALPN); -2838 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; -2839 info!("receiving hello"); -2840 let m = recv.read_to_end(100).await.anyerr()?; -2841 assert_eq!(m, b"hello"); -2842 info!("sending hello"); -2843 send.write_all(b"world").await.anyerr()?; -2844 send.finish().anyerr()?; -2845 match conn.closed().await { -2846 ConnectionError::ApplicationClosed(closed) => { -2847 assert_eq!(closed.error_code, 1u8.into()); -2848 Ok(()) -2849 } -2850 _ => panic!("wrong close error"), -2851 } -2852 } -2853 -2854 let p1_accept = tokio::spawn(accept_world(ep1.clone(), ep2_endpointid).instrument( -2855 info_span!( -2856 "p1_accept", -2857 ep1 = %ep1.id().fmt_short(), -2858 dst = %ep2_endpointid.fmt_short(), -2859 ), -2860 )); -2861 let p2_accept = tokio::spawn(accept_world(ep2.clone(), ep1_endpointid).instrument( -2862 info_span!( -2863 "p2_accept", -2864 ep2 = %ep2.id().fmt_short(), -2865 dst = %ep1_endpointid.fmt_short(), -2866 ), -2867 )); -2868 let p1_connect = tokio::spawn(connect_hello(ep1.clone(), ep2_endpointid).instrument( -2869 info_span!( -2870 "p1_connect", -2871 ep1 = %ep1.id().fmt_short(), -2872 dst = %ep2_endpointid.fmt_short(), -2873 ), -2874 )); -2875 let p2_connect = tokio::spawn(connect_hello(ep2.clone(), ep1_endpointid).instrument( -2876 info_span!( -2877 "p2_connect", -2878 ep2 = %ep2.id().fmt_short(), -2879 dst = %ep1_endpointid.fmt_short(), -2880 ), -2881 )); -2882 -2883 p1_accept.await.anyerr()??; -2884 p2_accept.await.anyerr()??; -2885 p1_connect.await.anyerr()??; -2886 p2_connect.await.anyerr()??; -2887 -2888 Ok(()) -2889 } -2890 -2891 #[tokio::test] -2892 #[traced_test] -2893 async fn test_direct_addresses_no_qad_relay() -> Result { -2894 let (relay_map, _, _guard) = run_relay_server_with(false).await.unwrap(); -2895 -2896 let ep = Endpoint::builder(presets::Minimal) -2897 .relay_mode(RelayMode::Custom(relay_map)) -2898 .alpns(vec![TEST_ALPN.to_vec()]) -2899 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -2900 .bind() -2901 .await?; -2902 -2903 assert!(ep.addr().ip_addrs().count() > 0); +2790 assert_eq!(&data, b"Hello, world!"); +2791 +2792 Ok(()) +2793 } +2794 +2795 #[tokio::test] +2796 #[traced_test] +2797 async fn endpoint_bidi_send_recv() -> Result { +2798 let disco = MemoryLookup::new(); +2799 let ep1 = Endpoint::builder(presets::Minimal) +2800 .address_lookup(disco.clone()) +2801 .alpns(vec![TEST_ALPN.to_vec()]) +2802 .bind() +2803 .await?; +2804 +2805 let ep2 = Endpoint::builder(presets::Minimal) +2806 .address_lookup(disco.clone()) +2807 .alpns(vec![TEST_ALPN.to_vec()]) +2808 .bind() +2809 .await?; +2810 +2811 disco.add_endpoint_info(ep1.addr()); +2812 disco.add_endpoint_info(ep2.addr()); +2813 +2814 let ep1_endpointid = ep1.id(); +2815 let ep2_endpointid = ep2.id(); +2816 eprintln!("endpoint id 1 {ep1_endpointid}"); +2817 eprintln!("endpoint id 2 {ep2_endpointid}"); +2818 +2819 async fn connect_hello(ep: Endpoint, dst: EndpointId) -> Result { +2820 let conn = ep.connect(dst, TEST_ALPN).await?; +2821 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; +2822 info!("sending hello"); +2823 send.write_all(b"hello").await.anyerr()?; +2824 send.finish().anyerr()?; +2825 info!("receiving world"); +2826 let m = recv.read_to_end(100).await.anyerr()?; +2827 assert_eq!(m, b"world"); +2828 conn.close(1u8.into(), b"done"); +2829 Ok(()) +2830 } +2831 +2832 async fn accept_world(ep: Endpoint, src: EndpointId) -> Result { +2833 let incoming = ep.accept().await.anyerr()?; +2834 let mut iconn = incoming.accept().anyerr()?; +2835 let alpn = iconn.alpn().await?; +2836 let conn = iconn.await.anyerr()?; +2837 let endpoint_id = conn.remote_id(); +2838 assert_eq!(endpoint_id, src); +2839 assert_eq!(alpn, TEST_ALPN); +2840 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; +2841 info!("receiving hello"); +2842 let m = recv.read_to_end(100).await.anyerr()?; +2843 assert_eq!(m, b"hello"); +2844 info!("sending hello"); +2845 send.write_all(b"world").await.anyerr()?; +2846 send.finish().anyerr()?; +2847 match conn.closed().await { +2848 ConnectionError::ApplicationClosed(closed) => { +2849 assert_eq!(closed.error_code, 1u8.into()); +2850 Ok(()) +2851 } +2852 _ => panic!("wrong close error"), +2853 } +2854 } +2855 +2856 let p1_accept = tokio::spawn(accept_world(ep1.clone(), ep2_endpointid).instrument( +2857 info_span!( +2858 "p1_accept", +2859 ep1 = %ep1.id().fmt_short(), +2860 dst = %ep2_endpointid.fmt_short(), +2861 ), +2862 )); +2863 let p2_accept = tokio::spawn(accept_world(ep2.clone(), ep1_endpointid).instrument( +2864 info_span!( +2865 "p2_accept", +2866 ep2 = %ep2.id().fmt_short(), +2867 dst = %ep1_endpointid.fmt_short(), +2868 ), +2869 )); +2870 let p1_connect = tokio::spawn(connect_hello(ep1.clone(), ep2_endpointid).instrument( +2871 info_span!( +2872 "p1_connect", +2873 ep1 = %ep1.id().fmt_short(), +2874 dst = %ep2_endpointid.fmt_short(), +2875 ), +2876 )); +2877 let p2_connect = tokio::spawn(connect_hello(ep2.clone(), ep1_endpointid).instrument( +2878 info_span!( +2879 "p2_connect", +2880 ep2 = %ep2.id().fmt_short(), +2881 dst = %ep1_endpointid.fmt_short(), +2882 ), +2883 )); +2884 +2885 p1_accept.await.anyerr()??; +2886 p2_accept.await.anyerr()??; +2887 p1_connect.await.anyerr()??; +2888 p2_connect.await.anyerr()??; +2889 +2890 Ok(()) +2891 } +2892 +2893 #[tokio::test] +2894 #[traced_test] +2895 async fn test_direct_addresses_no_qad_relay() -> Result { +2896 let (relay_map, _, _guard) = run_relay_server_with(false).await.unwrap(); +2897 +2898 let ep = Endpoint::builder(presets::Minimal) +2899 .relay_mode(RelayMode::Custom(relay_map)) +2900 .alpns(vec![TEST_ALPN.to_vec()]) +2901 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +2902 .bind() +2903 .await?; 2904 -2905 Ok(()) -2906 } -2907 -2908 /// Test that configured external addresses are included in the endpoint's -2909 /// direct addresses, both when set via builder and at runtime. -2910 #[tokio::test(flavor = "current_thread", start_paused = true)] -2911 #[traced_test] -2912 async fn test_external_addr() -> Result { -2913 let configured_addr = SocketAddr::from(SocketAddrV4::new(Ipv4Addr::new(1, 2, 3, 4), 12345)); -2914 -2915 // Test builder-configured external address -2916 let ep = Endpoint::builder(presets::Minimal) -2917 .external_addr(configured_addr) -2918 .bind() -2919 .await?; -2920 -2921 let addr = ep.addr(); -2922 assert!( -2923 addr.ip_addrs().any(|a| *a == configured_addr), -2924 "builder-configured external addr {configured_addr} not found in endpoint addr: {addr:?}" -2925 ); -2926 -2927 // Test runtime add -2928 let runtime_addr = SocketAddr::from(SocketAddrV4::new(Ipv4Addr::new(5, 6, 7, 8), 54321)); -2929 ep.add_external_addr(runtime_addr).await; -2930 tokio::time::sleep(Duration::from_millis(100)).await; -2931 -2932 let addr = ep.addr(); -2933 assert!( -2934 addr.ip_addrs().any(|a| *a == runtime_addr), -2935 "runtime-added external addr {runtime_addr} not found in endpoint addr: {addr:?}" -2936 ); -2937 -2938 // Test runtime remove -2939 let removed = ep.remove_external_addr(&runtime_addr).await; -2940 assert!(removed); -2941 tokio::time::sleep(Duration::from_millis(100)).await; -2942 -2943 let addr = ep.addr(); -2944 assert!( -2945 !addr.ip_addrs().any(|a| *a == runtime_addr), -2946 "removed external addr {runtime_addr} still found in endpoint addr: {addr:?}" -2947 ); -2948 assert!( -2949 addr.ip_addrs().any(|a| *a == configured_addr), -2950 "builder-configured external addr should still be present: {addr:?}" -2951 ); -2952 -2953 ep.close().await; -2954 Ok(()) -2955 } -2956 -2957 #[tokio::test] -2958 #[traced_test] -2959 async fn graceful_close() -> Result { -2960 let client = Endpoint::bind(presets::Minimal).await?; -2961 let server = Endpoint::builder(presets::Minimal) -2962 .alpns(vec![TEST_ALPN.to_vec()]) -2963 .bind() -2964 .await?; -2965 let server_addr = server.addr(); -2966 let server_task = tokio::spawn(async move { -2967 let incoming = server.accept().await.anyerr()?; -2968 let conn = incoming.await.anyerr()?; -2969 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; -2970 let msg = recv.read_to_end(1_000).await.anyerr()?; -2971 send.write_all(&msg).await.anyerr()?; -2972 send.finish().anyerr()?; -2973 let close_reason = conn.closed().await; -2974 Ok::<_, Error>(close_reason) -2975 }); -2976 -2977 let conn = client.connect(server_addr, TEST_ALPN).await?; -2978 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; -2979 send.write_all(b"Hello, world!").await.anyerr()?; -2980 send.finish().anyerr()?; -2981 recv.read_to_end(1_000).await.anyerr()?; -2982 conn.close(42u32.into(), b"thanks, bye!"); -2983 client.close().await; -2984 -2985 let close_err = server_task.await.anyerr()??; -2986 let ConnectionError::ApplicationClosed(app_close) = close_err else { -2987 panic!("Unexpected close reason: {close_err:?}"); -2988 }; -2989 -2990 assert_eq!(app_close.error_code, 42u32.into()); -2991 assert_eq!(app_close.reason.as_ref(), b"thanks, bye!"); -2992 -2993 Ok(()) -2994 } -2995 -2996 #[cfg(feature = "metrics")] -2997 #[tokio::test] -2998 #[traced_test] -2999 async fn metrics_smoke() -> Result { -3000 use iroh_metrics::Registry; -3001 -3002 let secret_key = SecretKey::from_bytes(&[0u8; 32]); -3003 let client = Endpoint::builder(presets::Minimal) -3004 .secret_key(secret_key) -3005 .bind() -3006 .await?; -3007 let secret_key = SecretKey::from_bytes(&[1u8; 32]); -3008 let server = Endpoint::builder(presets::Minimal) -3009 .secret_key(secret_key) -3010 .alpns(vec![TEST_ALPN.to_vec()]) -3011 .bind() -3012 .await?; -3013 let server_addr = server.addr(); -3014 let server_task = tokio::task::spawn(async move { -3015 let conn = server.accept().await.anyerr()?.await.anyerr()?; -3016 let mut uni = conn.accept_uni().await.anyerr()?; -3017 uni.read_to_end(10).await.anyerr()?; -3018 drop(conn); -3019 Ok::<_, Error>(server) -3020 }); -3021 let conn = client.connect(server_addr, TEST_ALPN).await?; -3022 let mut uni = conn.open_uni().await.anyerr()?; -3023 uni.write_all(b"helloworld").await.anyerr()?; -3024 uni.finish().anyerr()?; -3025 conn.closed().await; -3026 drop(conn); -3027 let server = server_task.await.anyerr()??; -3028 -3029 let m = client.metrics(); -3030 // assert_eq!(m.socket.num_direct_conns_added.get(), 1); -3031 // assert_eq!(m.socket.connection_became_direct.get(), 1); -3032 // assert_eq!(m.socket.connection_handshake_success.get(), 1); -3033 // assert_eq!(m.socket.endpoints_contacted_directly.get(), 1); -3034 assert!(m.socket.recv_datagrams.get() > 0); -3035 -3036 let m = server.metrics(); -3037 // assert_eq!(m.socket.num_direct_conns_added.get(), 1); -3038 // assert_eq!(m.socket.connection_became_direct.get(), 1); -3039 // assert_eq!(m.socket.endpoints_contacted_directly.get(), 1); -3040 // assert_eq!(m.socket.connection_handshake_success.get(), 1); -3041 assert!(m.socket.recv_datagrams.get() > 0); -3042 -3043 // test openmetrics encoding with labeled subregistries per endpoint -3044 fn register_endpoint(registry: &mut Registry, endpoint: &Endpoint) { -3045 let id = endpoint.id().fmt_short(); -3046 let sub_registry = registry.sub_registry_with_label("id", id.to_string()); -3047 sub_registry.register_all(endpoint.metrics()); -3048 } -3049 let mut registry = Registry::default(); -3050 register_endpoint(&mut registry, &client); -3051 register_endpoint(&mut registry, &server); -3052 // let s = registry.encode_openmetrics_to_string().anyerr()?; -3053 // assert!(s.contains(r#"socket_endpoints_contacted_directly_total{id="3b6a27bcce"} 1"#)); -3054 // assert!(s.contains(r#"socket_endpoints_contacted_directly_total{id="8a88e3dd74"} 1"#)); -3055 Ok(()) -3056 } -3057 -3058 /// Configures the accept side to take `accept_alpns` ALPNs, then connects to it with `primary_connect_alpn` -3059 /// with `secondary_connect_alpns` set, and finally returns the negotiated ALPN. -3060 async fn alpn_connection_test( -3061 accept_alpns: Vec<Vec<u8>>, -3062 primary_connect_alpn: &[u8], -3063 secondary_connect_alpns: Vec<Vec<u8>>, -3064 ) -> Result<Vec<u8>> { -3065 let client = Endpoint::bind(presets::Minimal).await?; -3066 let server = Endpoint::builder(presets::Minimal) -3067 .alpns(accept_alpns) -3068 .bind() -3069 .await?; -3070 let server_addr = server.addr(); -3071 let server_task = tokio::spawn({ -3072 let server = server.clone(); -3073 async move { -3074 let incoming = server.accept().await.anyerr()?; -3075 let conn = incoming.await.anyerr()?; -3076 conn.close(0u32.into(), b"bye!"); -3077 n0_error::Ok(conn.alpn().to_vec()) -3078 } -3079 }); -3080 -3081 let conn = client -3082 .connect_with_opts( -3083 server_addr, -3084 primary_connect_alpn, -3085 ConnectOptions::new().with_additional_alpns(secondary_connect_alpns), -3086 ) -3087 .await?; -3088 let conn = conn.await.anyerr()?; -3089 let client_alpn = conn.alpn(); -3090 conn.closed().await; -3091 client.close().await; -3092 server.close().await; -3093 -3094 let server_alpn = server_task.await.anyerr()??; +2905 assert!(ep.addr().ip_addrs().count() > 0); +2906 +2907 Ok(()) +2908 } +2909 +2910 /// Test that configured external addresses are included in the endpoint's +2911 /// direct addresses, both when set via builder and at runtime. +2912 #[tokio::test(flavor = "current_thread", start_paused = true)] +2913 #[traced_test] +2914 async fn test_external_addr() -> Result { +2915 let configured_addr = SocketAddr::from(SocketAddrV4::new(Ipv4Addr::new(1, 2, 3, 4), 12345)); +2916 +2917 // Test builder-configured external address +2918 let ep = Endpoint::builder(presets::Minimal) +2919 .external_addr(configured_addr) +2920 .bind() +2921 .await?; +2922 +2923 let addr = ep.addr(); +2924 assert!( +2925 addr.ip_addrs().any(|a| *a == configured_addr), +2926 "builder-configured external addr {configured_addr} not found in endpoint addr: {addr:?}" +2927 ); +2928 +2929 // Test runtime add +2930 let runtime_addr = SocketAddr::from(SocketAddrV4::new(Ipv4Addr::new(5, 6, 7, 8), 54321)); +2931 ep.add_external_addr(runtime_addr).await; +2932 tokio::time::sleep(Duration::from_millis(100)).await; +2933 +2934 let addr = ep.addr(); +2935 assert!( +2936 addr.ip_addrs().any(|a| *a == runtime_addr), +2937 "runtime-added external addr {runtime_addr} not found in endpoint addr: {addr:?}" +2938 ); +2939 +2940 // Test runtime remove +2941 let removed = ep.remove_external_addr(&runtime_addr).await; +2942 assert!(removed); +2943 tokio::time::sleep(Duration::from_millis(100)).await; +2944 +2945 let addr = ep.addr(); +2946 assert!( +2947 !addr.ip_addrs().any(|a| *a == runtime_addr), +2948 "removed external addr {runtime_addr} still found in endpoint addr: {addr:?}" +2949 ); +2950 assert!( +2951 addr.ip_addrs().any(|a| *a == configured_addr), +2952 "builder-configured external addr should still be present: {addr:?}" +2953 ); +2954 +2955 ep.close().await; +2956 Ok(()) +2957 } +2958 +2959 #[tokio::test] +2960 #[traced_test] +2961 async fn graceful_close() -> Result { +2962 let client = Endpoint::bind(presets::Minimal).await?; +2963 let server = Endpoint::builder(presets::Minimal) +2964 .alpns(vec![TEST_ALPN.to_vec()]) +2965 .bind() +2966 .await?; +2967 let server_addr = server.addr(); +2968 let server_task = tokio::spawn(async move { +2969 let incoming = server.accept().await.anyerr()?; +2970 let conn = incoming.await.anyerr()?; +2971 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; +2972 let msg = recv.read_to_end(1_000).await.anyerr()?; +2973 send.write_all(&msg).await.anyerr()?; +2974 send.finish().anyerr()?; +2975 let close_reason = conn.closed().await; +2976 Ok::<_, Error>(close_reason) +2977 }); +2978 +2979 let conn = client.connect(server_addr, TEST_ALPN).await?; +2980 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; +2981 send.write_all(b"Hello, world!").await.anyerr()?; +2982 send.finish().anyerr()?; +2983 recv.read_to_end(1_000).await.anyerr()?; +2984 conn.close(42u32.into(), b"thanks, bye!"); +2985 client.close().await; +2986 +2987 let close_err = server_task.await.anyerr()??; +2988 let ConnectionError::ApplicationClosed(app_close) = close_err else { +2989 panic!("Unexpected close reason: {close_err:?}"); +2990 }; +2991 +2992 assert_eq!(app_close.error_code, 42u32.into()); +2993 assert_eq!(app_close.reason.as_ref(), b"thanks, bye!"); +2994 +2995 Ok(()) +2996 } +2997 +2998 #[cfg(feature = "metrics")] +2999 #[tokio::test] +3000 #[traced_test] +3001 async fn metrics_smoke() -> Result { +3002 use iroh_metrics::Registry; +3003 +3004 let secret_key = SecretKey::from_bytes(&[0u8; 32]); +3005 let client = Endpoint::builder(presets::Minimal) +3006 .secret_key(secret_key) +3007 .bind() +3008 .await?; +3009 let secret_key = SecretKey::from_bytes(&[1u8; 32]); +3010 let server = Endpoint::builder(presets::Minimal) +3011 .secret_key(secret_key) +3012 .alpns(vec![TEST_ALPN.to_vec()]) +3013 .bind() +3014 .await?; +3015 let server_addr = server.addr(); +3016 let server_task = tokio::task::spawn(async move { +3017 let conn = server.accept().await.anyerr()?.await.anyerr()?; +3018 let mut uni = conn.accept_uni().await.anyerr()?; +3019 uni.read_to_end(10).await.anyerr()?; +3020 drop(conn); +3021 Ok::<_, Error>(server) +3022 }); +3023 let conn = client.connect(server_addr, TEST_ALPN).await?; +3024 let mut uni = conn.open_uni().await.anyerr()?; +3025 uni.write_all(b"helloworld").await.anyerr()?; +3026 uni.finish().anyerr()?; +3027 conn.closed().await; +3028 drop(conn); +3029 let server = server_task.await.anyerr()??; +3030 +3031 let m = client.metrics(); +3032 // assert_eq!(m.socket.num_direct_conns_added.get(), 1); +3033 // assert_eq!(m.socket.connection_became_direct.get(), 1); +3034 // assert_eq!(m.socket.connection_handshake_success.get(), 1); +3035 // assert_eq!(m.socket.endpoints_contacted_directly.get(), 1); +3036 assert!(m.socket.recv_datagrams.get() > 0); +3037 +3038 let m = server.metrics(); +3039 // assert_eq!(m.socket.num_direct_conns_added.get(), 1); +3040 // assert_eq!(m.socket.connection_became_direct.get(), 1); +3041 // assert_eq!(m.socket.endpoints_contacted_directly.get(), 1); +3042 // assert_eq!(m.socket.connection_handshake_success.get(), 1); +3043 assert!(m.socket.recv_datagrams.get() > 0); +3044 +3045 // test openmetrics encoding with labeled subregistries per endpoint +3046 fn register_endpoint(registry: &mut Registry, endpoint: &Endpoint) { +3047 let id = endpoint.id().fmt_short(); +3048 let sub_registry = registry.sub_registry_with_label("id", id.to_string()); +3049 sub_registry.register_all(endpoint.metrics()); +3050 } +3051 let mut registry = Registry::default(); +3052 register_endpoint(&mut registry, &client); +3053 register_endpoint(&mut registry, &server); +3054 // let s = registry.encode_openmetrics_to_string().anyerr()?; +3055 // assert!(s.contains(r#"socket_endpoints_contacted_directly_total{id="3b6a27bcce"} 1"#)); +3056 // assert!(s.contains(r#"socket_endpoints_contacted_directly_total{id="8a88e3dd74"} 1"#)); +3057 Ok(()) +3058 } +3059 +3060 /// Configures the accept side to take `accept_alpns` ALPNs, then connects to it with `primary_connect_alpn` +3061 /// with `secondary_connect_alpns` set, and finally returns the negotiated ALPN. +3062 async fn alpn_connection_test( +3063 accept_alpns: Vec<Vec<u8>>, +3064 primary_connect_alpn: &[u8], +3065 secondary_connect_alpns: Vec<Vec<u8>>, +3066 ) -> Result<Vec<u8>> { +3067 let client = Endpoint::bind(presets::Minimal).await?; +3068 let server = Endpoint::builder(presets::Minimal) +3069 .alpns(accept_alpns) +3070 .bind() +3071 .await?; +3072 let server_addr = server.addr(); +3073 let server_task = tokio::spawn({ +3074 let server = server.clone(); +3075 async move { +3076 let incoming = server.accept().await.anyerr()?; +3077 let conn = incoming.await.anyerr()?; +3078 conn.close(0u32.into(), b"bye!"); +3079 n0_error::Ok(conn.alpn().to_vec()) +3080 } +3081 }); +3082 +3083 let conn = client +3084 .connect_with_opts( +3085 server_addr, +3086 primary_connect_alpn, +3087 ConnectOptions::new().with_additional_alpns(secondary_connect_alpns), +3088 ) +3089 .await?; +3090 let conn = conn.await.anyerr()?; +3091 let client_alpn = conn.alpn(); +3092 conn.closed().await; +3093 client.close().await; +3094 server.close().await; 3095 -3096 assert_eq!(client_alpn, server_alpn); +3096 let server_alpn = server_task.await.anyerr()??; 3097 -3098 Ok(server_alpn.to_vec()) -3099 } -3100 -3101 #[tokio::test] -3102 #[traced_test] -3103 async fn connect_multiple_alpn_negotiated() -> Result { -3104 const ALPN_ONE: &[u8] = b"alpn/1"; -3105 const ALPN_TWO: &[u8] = b"alpn/2"; -3106 -3107 assert_eq!( -3108 alpn_connection_test( -3109 // Prefer version 2 over version 1 on the accept side -3110 vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], -3111 ALPN_TWO, -3112 vec![ALPN_ONE.to_vec()], -3113 ) -3114 .await?, -3115 ALPN_TWO.to_vec(), -3116 "accept side prefers version 2 over 1" -3117 ); -3118 -3119 assert_eq!( -3120 alpn_connection_test( -3121 // Only support the old version -3122 vec![ALPN_ONE.to_vec()], -3123 ALPN_TWO, -3124 vec![ALPN_ONE.to_vec()], -3125 ) -3126 .await?, -3127 ALPN_ONE.to_vec(), -3128 "accept side only supports the old version" -3129 ); -3130 -3131 assert_eq!( -3132 alpn_connection_test( -3133 vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], -3134 ALPN_ONE, -3135 vec![ALPN_TWO.to_vec()], -3136 ) -3137 .await?, -3138 ALPN_TWO.to_vec(), -3139 "connect side ALPN order doesn't matter" -3140 ); -3141 -3142 assert_eq!( -3143 alpn_connection_test(vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], ALPN_ONE, vec![],) -3144 .await?, -3145 ALPN_ONE.to_vec(), -3146 "connect side only supports the old version" -3147 ); -3148 -3149 Ok(()) -3150 } -3151 -3152 #[tokio::test] -3153 #[traced_test] -3154 async fn watch_net_report() -> Result { -3155 let endpoint = Endpoint::builder(presets::Minimal) -3156 .relay_mode(RelayMode::Staging) -3157 .bind() -3158 .await?; -3159 -3160 // can get a first report -3161 endpoint.net_report().updated().await.anyerr()?; -3162 -3163 Ok(()) -3164 } -3165 -3166 /// Tests that initial connection establishment isn't extremely slow compared -3167 /// to subsequent connections. -3168 /// -3169 /// This is a time based test, but uses a very large ratio to reduce flakiness. -3170 /// It also does a number of connections to average out any anomalies. -3171 #[tokio::test] -3172 #[traced_test] -3173 async fn connect_multi_time() -> Result { -3174 let n = 32; -3175 -3176 const NOOP_ALPN: &[u8] = b"noop"; +3098 assert_eq!(client_alpn, server_alpn); +3099 +3100 Ok(server_alpn.to_vec()) +3101 } +3102 +3103 #[tokio::test] +3104 #[traced_test] +3105 async fn connect_multiple_alpn_negotiated() -> Result { +3106 const ALPN_ONE: &[u8] = b"alpn/1"; +3107 const ALPN_TWO: &[u8] = b"alpn/2"; +3108 +3109 assert_eq!( +3110 alpn_connection_test( +3111 // Prefer version 2 over version 1 on the accept side +3112 vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], +3113 ALPN_TWO, +3114 vec![ALPN_ONE.to_vec()], +3115 ) +3116 .await?, +3117 ALPN_TWO.to_vec(), +3118 "accept side prefers version 2 over 1" +3119 ); +3120 +3121 assert_eq!( +3122 alpn_connection_test( +3123 // Only support the old version +3124 vec![ALPN_ONE.to_vec()], +3125 ALPN_TWO, +3126 vec![ALPN_ONE.to_vec()], +3127 ) +3128 .await?, +3129 ALPN_ONE.to_vec(), +3130 "accept side only supports the old version" +3131 ); +3132 +3133 assert_eq!( +3134 alpn_connection_test( +3135 vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], +3136 ALPN_ONE, +3137 vec![ALPN_TWO.to_vec()], +3138 ) +3139 .await?, +3140 ALPN_TWO.to_vec(), +3141 "connect side ALPN order doesn't matter" +3142 ); +3143 +3144 assert_eq!( +3145 alpn_connection_test(vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], ALPN_ONE, vec![],) +3146 .await?, +3147 ALPN_ONE.to_vec(), +3148 "connect side only supports the old version" +3149 ); +3150 +3151 Ok(()) +3152 } +3153 +3154 #[tokio::test] +3155 #[traced_test] +3156 async fn watch_net_report() -> Result { +3157 let endpoint = Endpoint::builder(presets::Minimal) +3158 .relay_mode(RelayMode::Staging) +3159 .bind() +3160 .await?; +3161 +3162 // can get a first report +3163 endpoint.net_report().updated().await.anyerr()?; +3164 +3165 Ok(()) +3166 } +3167 +3168 /// Tests that initial connection establishment isn't extremely slow compared +3169 /// to subsequent connections. +3170 /// +3171 /// This is a time based test, but uses a very large ratio to reduce flakiness. +3172 /// It also does a number of connections to average out any anomalies. +3173 #[tokio::test] +3174 #[traced_test] +3175 async fn connect_multi_time() -> Result { +3176 let n = 32; 3177 -3178 #[derive(Debug, Clone)] -3179 struct Noop; -3180 -3181 impl ProtocolHandler for Noop { -3182 async fn accept(&self, connection: Connection) -> Result<(), AcceptError> { -3183 connection.closed().await; -3184 Ok(()) -3185 } -3186 } -3187 -3188 async fn noop_server() -> Result<(Router, EndpointAddr)> { -3189 let endpoint = Endpoint::bind(presets::Minimal).await.anyerr()?; -3190 let addr = endpoint.addr(); -3191 let router = Router::builder(endpoint).accept(NOOP_ALPN, Noop).spawn(); -3192 Ok((router, addr)) -3193 } -3194 -3195 let routers = stream::iter(0..n) -3196 .map(|_| noop_server()) -3197 .buffered_unordered(32) -3198 .collect::<Vec<_>>() -3199 .await -3200 .into_iter() -3201 .collect::<Result<Vec<_>, _>>() -3202 .anyerr()?; -3203 -3204 let addrs = routers -3205 .iter() -3206 .map(|(_, addr)| addr.clone()) -3207 .collect::<Vec<_>>(); -3208 let ids = addrs.iter().map(|addr| addr.id).collect::<Vec<_>>(); -3209 let address_lookup = MemoryLookup::from_endpoint_info(addrs); -3210 let endpoint = Endpoint::builder(presets::Minimal) -3211 .address_lookup(address_lookup) -3212 .bind() -3213 .await -3214 .anyerr()?; -3215 // wait for the endpoint to be initialized. This should not be needed, -3216 // but we don't want to measure endpoint init time but connection time -3217 // from a fully initialized endpoint. -3218 endpoint.addr(); -3219 let t0 = Instant::now(); -3220 for id in &ids { -3221 let conn = endpoint.connect(*id, NOOP_ALPN).await?; -3222 conn.close(0u32.into(), b"done"); -3223 } -3224 let dt0 = t0.elapsed().as_secs_f64(); -3225 let t1 = Instant::now(); -3226 for id in &ids { -3227 let conn = endpoint.connect(*id, NOOP_ALPN).await?; -3228 conn.close(0u32.into(), b"done"); -3229 } -3230 let dt1 = t1.elapsed().as_secs_f64(); -3231 -3232 assert!(dt0 / dt1 < 20.0, "First round: {dt0}s, second round {dt1}s"); -3233 Ok(()) -3234 } -3235 -3236 #[tokio::test] -3237 async fn test_custom_relay() -> Result { -3238 let _ep = Endpoint::builder(presets::Minimal) -3239 .relay_mode(RelayMode::custom([RelayUrl::from_str( -3240 "https://use1-1.relay.n0.iroh-canary.iroh.link.", -3241 )?])) -3242 .bind() -3243 .await?; -3244 -3245 let relays = RelayMap::try_from_iter([ -3246 "https://use1-1.relay.n0.iroh.iroh.link/", -3247 "https://euc1-1.relay.n0.iroh.iroh.link/", -3248 ])?; -3249 let _ep = Endpoint::builder(presets::Minimal) -3250 .relay_mode(RelayMode::Custom(relays)) -3251 .bind() -3252 .await?; -3253 -3254 Ok(()) -3255 } -3256 -3257 /// Testing bind_addr: Clear IP transports and add single IPv4 bind -3258 #[tokio::test] -3259 #[traced_test] -3260 async fn test_bind_addr_clear() -> Result { -3261 let ep = Endpoint::builder(presets::Minimal) -3262 .clear_ip_transports() -3263 .bind_addr((Ipv4Addr::LOCALHOST, 0))? -3264 .bind() -3265 .await?; -3266 let bound_sockets = ep.bound_sockets(); -3267 assert_eq!(bound_sockets.len(), 1); -3268 assert_eq!(bound_sockets[0].ip(), IpAddr::V4(Ipv4Addr::LOCALHOST)); -3269 ep.close().await; -3270 Ok(()) -3271 } -3272 -3273 /// Testing bind_addr: Do not clear IP transports and add single non-default IPv4 bind -3274 /// -3275 /// This will bind two sockets: default wildcard bind for IPv6, and our -3276 /// manually-added IPv4 bind. -3277 #[tokio::test] -3278 #[traced_test] -3279 async fn test_bind_addr_no_clear() -> Result { -3280 let ep = Endpoint::builder(presets::Minimal) -3281 .bind_addr((Ipv4Addr::LOCALHOST, 0))? -3282 .bind() -3283 .await?; -3284 let bound_sockets = ep.bound_sockets(); -3285 assert_eq!(bound_sockets.len(), 2); -3286 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv4()).count(), 1); -3287 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv6()).count(), 1); -3288 // Test that our manually added socket is there -3289 assert!( -3290 bound_sockets -3291 .iter() -3292 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) -3293 ); -3294 ep.close().await; -3295 Ok(()) -3296 } -3297 -3298 // Testing bind_addr: Do not clear IP transports and add single default IPv4 bind. -3299 // -3300 // This replaces the default IPv4 bind added by the builder, -3301 // but keeps the default wildcard IPv6 bind. -3302 #[tokio::test] -3303 #[traced_test] -3304 async fn test_bind_addr_default() -> Result { -3305 let ep = Endpoint::builder(presets::Minimal) -3306 .bind_addr_with_opts( -3307 (Ipv4Addr::LOCALHOST, 0), -3308 BindOpts::default().set_is_default_route(true), -3309 )? -3310 .bind() -3311 .await?; -3312 let bound_sockets = ep.bound_sockets(); -3313 assert_eq!(bound_sockets.len(), 2); -3314 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv4()).count(), 1); -3315 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv6()).count(), 1); -3316 assert!( -3317 bound_sockets -3318 .iter() -3319 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) -3320 ); -3321 ep.close().await; -3322 drop(ep); -3323 -3324 Ok(()) -3325 } -3326 -3327 /// Testing bind_addr: Do not clear IP transports and add single IPv4 bind with a non-zero prefix len -3328 /// -3329 /// This will bind three sockets: default wildcard bind for IPv4 and IPv6, and our -3330 /// manually-added IPv4 bind. -3331 #[tokio::test] -3332 #[traced_test] -3333 async fn test_bind_addr_nonzero_prefix() -> Result { -3334 let ep = Endpoint::builder(presets::Minimal) -3335 .bind_addr_with_opts( -3336 (Ipv4Addr::LOCALHOST, 0), -3337 BindOpts::default().set_prefix_len(32), -3338 )? -3339 .bind() -3340 .await?; -3341 let bound_sockets = ep.bound_sockets(); -3342 assert_eq!(bound_sockets.len(), 3); -3343 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv4()).count(), 2); -3344 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv6()).count(), 1); -3345 // Test that the default wildcard socket is there -3346 assert!( -3347 bound_sockets -3348 .iter() -3349 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::UNSPECIFIED)) -3350 ); -3351 // Test that our manually added socket is there -3352 assert!( -3353 bound_sockets -3354 .iter() -3355 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) -3356 ); -3357 ep.close().await; -3358 Ok(()) -3359 } -3360 -3361 /// Bind on an unusable port with the default opts. -3362 /// -3363 /// Binding the endpoint fails with an AddrInUse error. -3364 #[tokio::test] -3365 #[traced_test] -3366 async fn test_bind_addr_badport() -> Result { -3367 let socket = std::net::UdpSocket::bind((Ipv4Addr::LOCALHOST, 0))?; -3368 let port = socket.local_addr()?.port(); -3369 -3370 let res = Endpoint::builder(presets::Minimal) -3371 .clear_ip_transports() -3372 .bind_addr((Ipv4Addr::LOCALHOST, port))? -3373 .bind() -3374 .await; -3375 -3376 assert!(matches!( -3377 res, -3378 Err(BindError::Sockets { -3379 source: io_error, -3380 .. -3381 }) -3382 if io_error.kind() == io::ErrorKind::AddrInUse -3383 )); -3384 Ok(()) -3385 } -3386 -3387 /// Bind a non-default route on an unusable port, but set is_required = false. -3388 /// -3389 /// Binding the endpoint succeeds. -3390 #[tokio::test] -3391 #[traced_test] -3392 async fn test_bind_addr_badport_notrequired() -> Result { -3393 let socket = std::net::UdpSocket::bind((Ipv4Addr::LOCALHOST, 0))?; -3394 let port = socket.local_addr()?.port(); -3395 -3396 let ep = Endpoint::builder(presets::Minimal) -3397 .bind_addr_with_opts( -3398 (Ipv4Addr::LOCALHOST, port), -3399 BindOpts::default() -3400 .set_prefix_len(32) -3401 .set_is_required(false), -3402 )? -3403 .bind() -3404 .await?; -3405 let bound_sockets = ep.bound_sockets(); -3406 // just the default wildcard binds -3407 assert_eq!(bound_sockets.len(), 2); -3408 // our requested bind addr is not included because it failed to bind -3409 assert!( -3410 !bound_sockets -3411 .iter() -3412 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) -3413 ); -3414 Ok(()) -3415 } -3416 -3417 /// Bind on a default route on an unusable port, but set is_required = false. -3418 /// -3419 /// Binding the endpoint succeeds. -3420 #[tokio::test] -3421 #[traced_test] -3422 async fn test_bind_addr_badport_default_notrequired() -> Result { -3423 let socket = std::net::UdpSocket::bind((Ipv4Addr::LOCALHOST, 0))?; -3424 let port = socket.local_addr()?.port(); -3425 -3426 let ep = Endpoint::builder(presets::Minimal) -3427 .bind_addr_with_opts( -3428 (Ipv4Addr::LOCALHOST, port), -3429 BindOpts::default().set_is_required(false), -3430 )? -3431 .bind() -3432 .await?; -3433 let bound_sockets = ep.bound_sockets(); -3434 // just the IPv6 default, but no IPv4 bind at all because we replaced the default -3435 // with a bind with an unusable port and set it to not be required. -3436 assert_eq!(bound_sockets.len(), 1); -3437 assert!(bound_sockets[0].is_ipv6()); -3438 Ok(()) -3439 } -3440 -3441 /// Bind on an unusable port, with is_required = false, and no other transports. -3442 /// -3443 /// Binding the endpoint fails with "no valid address available". -3444 #[tokio::test] -3445 #[traced_test] -3446 async fn test_bind_addr_badport_notrequired_no_other_transports() -> Result { -3447 let socket = std::net::UdpSocket::bind((Ipv4Addr::LOCALHOST, 0))?; -3448 let port = socket.local_addr()?.port(); -3449 -3450 let res = Endpoint::builder(presets::Minimal) -3451 .clear_ip_transports() -3452 .bind_addr_with_opts( -3453 (Ipv4Addr::LOCALHOST, port), -3454 BindOpts::default().set_is_required(false), -3455 )? -3456 .bind() -3457 .await; -3458 -3459 assert!(matches!( -3460 res, -3461 Err(BindError::CreateQuicEndpoint { -3462 source: io_error, -3463 .. -3464 }) -3465 if io_error.kind() == io::ErrorKind::Other && io_error.to_string() == "no valid address available" -3466 )); -3467 Ok(()) -3468 } -3469 -3470 /// Bind with prefix len 0 but set the route as non-default. -3471 #[tokio::test] -3472 #[traced_test] -3473 async fn test_bind_addr_prefix_len_0_not_default() -> Result { -3474 let ep = Endpoint::builder(presets::Minimal) -3475 .bind_addr_with_opts( -3476 (Ipv4Addr::LOCALHOST, 0), -3477 BindOpts::default().set_is_default_route(false), -3478 )? -3479 .bind() -3480 .await?; -3481 let bound_sockets = ep.bound_sockets(); -3482 // The two default wildcard binds plus our additional route (which does not replace the default route -3483 // because we set is_default_route to false explicitly). -3484 assert_eq!(bound_sockets.len(), 3); -3485 assert!( -3486 bound_sockets -3487 .iter() -3488 .any(|x| x.ip() == IpAddr::V6(Ipv6Addr::UNSPECIFIED)) -3489 ); -3490 assert!( -3491 bound_sockets -3492 .iter() -3493 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::UNSPECIFIED)) -3494 ); -3495 assert!( -3496 bound_sockets -3497 .iter() -3498 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) -3499 ); -3500 Ok(()) -3501 } -3502 -3503 #[ignore = "flaky"] -3504 #[tokio::test] -3505 #[traced_test] -3506 async fn connect_via_relay_becomes_direct_and_sends_direct() -> Result { -3507 let (relay_map, relay_url, _relay_server_guard) = run_relay_server().await?; -3508 let qlog = Arc::new(QlogFileGroup::from_env( -3509 "connect_via_relay_becomes_direct_and_sends_direct", -3510 )); -3511 let transfer_size = 1_000_000; -3512 -3513 async fn collect_stats(mut events: PathEventStream) -> BTreeMap<TransportAddr, PathStats> { -3514 let mut stats = BTreeMap::new(); -3515 while let Some(event) = events.next().await { -3516 if let PathEvent::Closed { -3517 remote_addr, -3518 last_stats, -3519 .. -3520 } = event -3521 { -3522 stats.insert(remote_addr, *last_stats); -3523 } -3524 } -3525 stats -3526 } -3527 -3528 let client = Endpoint::builder(presets::Minimal) -3529 .relay_mode(RelayMode::Custom(relay_map.clone())) -3530 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -3531 .transport_config(qlog.create("client")?) -3532 .bind() -3533 .await?; -3534 let server = Endpoint::builder(presets::Minimal) -3535 .relay_mode(RelayMode::Custom(relay_map)) -3536 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -3537 .transport_config(qlog.create("server")?) -3538 .alpns(vec![TEST_ALPN.to_vec()]) -3539 .bind() -3540 .await?; -3541 let server_addr = EndpointAddr::new(server.id()).with_relay_url(relay_url); -3542 let server_task = tokio::spawn(async move { -3543 let incoming = server.accept().await.anyerr()?; -3544 let conn = incoming.await.anyerr()?; -3545 let stats_task = tokio::spawn(collect_stats(conn.path_events())); -3546 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; -3547 let msg = recv.read_to_end(transfer_size).await.anyerr()?; -3548 send.write_all(&msg).await.anyerr()?; -3549 send.finish().anyerr()?; -3550 conn.closed().await; -3551 let stats = stats_task.await.expect("stats task panicked"); -3552 Ok::<_, Error>(stats) -3553 }); -3554 -3555 let conn = client.connect(server_addr, TEST_ALPN).await?; -3556 let client_stats_task = tokio::spawn(collect_stats(conn.path_events())); -3557 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; -3558 send.write_all(&vec![42u8; transfer_size]).await.anyerr()?; -3559 send.finish().anyerr()?; -3560 recv.read_to_end(transfer_size).await.anyerr()?; -3561 conn.close(0u32.into(), b"thanks, bye!"); -3562 client.close().await; -3563 let client_stats = client_stats_task.await.expect("stats task panicked"); -3564 let server_stats = server_task.await.anyerr()??; -3565 -3566 info!("client stats: {client_stats:#?}"); -3567 info!("server stats: {server_stats:#?}"); -3568 -3569 let client_total_relay_tx = client_stats -3570 .iter() -3571 .filter(|(remote, _stats)| remote.is_relay()) -3572 .map(|(_, stats)| stats.udp_tx.bytes) -3573 .sum::<u64>(); -3574 let client_total_relay_rx = client_stats -3575 .iter() -3576 .filter(|(remote, _stats)| remote.is_relay()) -3577 .map(|(_, stats)| stats.udp_rx.bytes) -3578 .sum::<u64>(); -3579 let server_total_relay_tx = server_stats -3580 .iter() -3581 .filter(|(remote, _stats)| remote.is_relay()) -3582 .map(|(_, stats)| stats.udp_tx.bytes) -3583 .sum::<u64>(); -3584 let server_total_relay_rx = server_stats -3585 .iter() -3586 .filter(|(remote, _stats)| remote.is_relay()) -3587 .map(|(_, stats)| stats.udp_rx.bytes) -3588 .sum::<u64>(); -3589 -3590 info!(?client_total_relay_tx, "total"); -3591 info!(?client_total_relay_rx, "total"); -3592 info!(?server_total_relay_tx, "total"); -3593 info!(?server_total_relay_rx, "total"); -3594 -3595 // We should send/receive only the minorty of traffic via the relay. -3596 assert!(client_total_relay_tx < transfer_size as u64 / 2); -3597 assert!(client_total_relay_rx < transfer_size as u64 / 2); -3598 assert!(server_total_relay_tx < transfer_size as u64 / 2); -3599 assert!(server_total_relay_rx < transfer_size as u64 / 2); -3600 -3601 Ok(()) -3602 } -3603 -3604 /// Tests that correct logs are emitted when connecting two endpoints with same secret keys to a relay. -3605 #[tokio::test] -3606 #[traced_test] -3607 async fn same_endpoint_id_relay() -> Result { -3608 let (relay_map, relay_url, _relay_server_guard) = run_relay_server().await?; -3609 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(1u64); -3610 let secret_key = SecretKey::from_bytes(&rng.random()); -3611 -3612 let client = Endpoint::builder(presets::Minimal) -3613 .relay_mode(RelayMode::Custom(relay_map.clone())) -3614 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -3615 .bind() -3616 .instrument(error_span!("ep-client")) -3617 .await?; -3618 -3619 info!("client {}", client.id()); +3178 const NOOP_ALPN: &[u8] = b"noop"; +3179 +3180 #[derive(Debug, Clone)] +3181 struct Noop; +3182 +3183 impl ProtocolHandler for Noop { +3184 async fn accept(&self, connection: Connection) -> Result<(), AcceptError> { +3185 connection.closed().await; +3186 Ok(()) +3187 } +3188 } +3189 +3190 async fn noop_server() -> Result<(Router, EndpointAddr)> { +3191 let endpoint = Endpoint::bind(presets::Minimal).await.anyerr()?; +3192 let addr = endpoint.addr(); +3193 let router = Router::builder(endpoint).accept(NOOP_ALPN, Noop).spawn(); +3194 Ok((router, addr)) +3195 } +3196 +3197 let routers = stream::iter(0..n) +3198 .map(|_| noop_server()) +3199 .buffered_unordered(32) +3200 .collect::<Vec<_>>() +3201 .await +3202 .into_iter() +3203 .collect::<Result<Vec<_>, _>>() +3204 .anyerr()?; +3205 +3206 let addrs = routers +3207 .iter() +3208 .map(|(_, addr)| addr.clone()) +3209 .collect::<Vec<_>>(); +3210 let ids = addrs.iter().map(|addr| addr.id).collect::<Vec<_>>(); +3211 let address_lookup = MemoryLookup::from_endpoint_info(addrs); +3212 let endpoint = Endpoint::builder(presets::Minimal) +3213 .address_lookup(address_lookup) +3214 .bind() +3215 .await +3216 .anyerr()?; +3217 // wait for the endpoint to be initialized. This should not be needed, +3218 // but we don't want to measure endpoint init time but connection time +3219 // from a fully initialized endpoint. +3220 endpoint.addr(); +3221 let t0 = Instant::now(); +3222 for id in &ids { +3223 let conn = endpoint.connect(*id, NOOP_ALPN).await?; +3224 conn.close(0u32.into(), b"done"); +3225 } +3226 let dt0 = t0.elapsed().as_secs_f64(); +3227 let t1 = Instant::now(); +3228 for id in &ids { +3229 let conn = endpoint.connect(*id, NOOP_ALPN).await?; +3230 conn.close(0u32.into(), b"done"); +3231 } +3232 let dt1 = t1.elapsed().as_secs_f64(); +3233 +3234 assert!(dt0 / dt1 < 20.0, "First round: {dt0}s, second round {dt1}s"); +3235 Ok(()) +3236 } +3237 +3238 #[tokio::test] +3239 async fn test_custom_relay() -> Result { +3240 let _ep = Endpoint::builder(presets::Minimal) +3241 .relay_mode(RelayMode::custom([RelayUrl::from_str( +3242 "https://use1-1.relay.n0.iroh-canary.iroh.link.", +3243 )?])) +3244 .bind() +3245 .await?; +3246 +3247 let relays = RelayMap::try_from_iter([ +3248 "https://use1-1.relay.n0.iroh.iroh.link/", +3249 "https://euc1-1.relay.n0.iroh.iroh.link/", +3250 ])?; +3251 let _ep = Endpoint::builder(presets::Minimal) +3252 .relay_mode(RelayMode::Custom(relays)) +3253 .bind() +3254 .await?; +3255 +3256 Ok(()) +3257 } +3258 +3259 /// Testing bind_addr: Clear IP transports and add single IPv4 bind +3260 #[tokio::test] +3261 #[traced_test] +3262 async fn test_bind_addr_clear() -> Result { +3263 let ep = Endpoint::builder(presets::Minimal) +3264 .clear_ip_transports() +3265 .bind_addr((Ipv4Addr::LOCALHOST, 0))? +3266 .bind() +3267 .await?; +3268 let bound_sockets = ep.bound_sockets(); +3269 assert_eq!(bound_sockets.len(), 1); +3270 assert_eq!(bound_sockets[0].ip(), IpAddr::V4(Ipv4Addr::LOCALHOST)); +3271 ep.close().await; +3272 Ok(()) +3273 } +3274 +3275 /// Testing bind_addr: Do not clear IP transports and add single non-default IPv4 bind +3276 /// +3277 /// This will bind two sockets: default wildcard bind for IPv6, and our +3278 /// manually-added IPv4 bind. +3279 #[tokio::test] +3280 #[traced_test] +3281 async fn test_bind_addr_no_clear() -> Result { +3282 let ep = Endpoint::builder(presets::Minimal) +3283 .bind_addr((Ipv4Addr::LOCALHOST, 0))? +3284 .bind() +3285 .await?; +3286 let bound_sockets = ep.bound_sockets(); +3287 assert_eq!(bound_sockets.len(), 2); +3288 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv4()).count(), 1); +3289 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv6()).count(), 1); +3290 // Test that our manually added socket is there +3291 assert!( +3292 bound_sockets +3293 .iter() +3294 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) +3295 ); +3296 ep.close().await; +3297 Ok(()) +3298 } +3299 +3300 // Testing bind_addr: Do not clear IP transports and add single default IPv4 bind. +3301 // +3302 // This replaces the default IPv4 bind added by the builder, +3303 // but keeps the default wildcard IPv6 bind. +3304 #[tokio::test] +3305 #[traced_test] +3306 async fn test_bind_addr_default() -> Result { +3307 let ep = Endpoint::builder(presets::Minimal) +3308 .bind_addr_with_opts( +3309 (Ipv4Addr::LOCALHOST, 0), +3310 BindOpts::default().set_is_default_route(true), +3311 )? +3312 .bind() +3313 .await?; +3314 let bound_sockets = ep.bound_sockets(); +3315 assert_eq!(bound_sockets.len(), 2); +3316 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv4()).count(), 1); +3317 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv6()).count(), 1); +3318 assert!( +3319 bound_sockets +3320 .iter() +3321 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) +3322 ); +3323 ep.close().await; +3324 drop(ep); +3325 +3326 Ok(()) +3327 } +3328 +3329 /// Testing bind_addr: Do not clear IP transports and add single IPv4 bind with a non-zero prefix len +3330 /// +3331 /// This will bind three sockets: default wildcard bind for IPv4 and IPv6, and our +3332 /// manually-added IPv4 bind. +3333 #[tokio::test] +3334 #[traced_test] +3335 async fn test_bind_addr_nonzero_prefix() -> Result { +3336 let ep = Endpoint::builder(presets::Minimal) +3337 .bind_addr_with_opts( +3338 (Ipv4Addr::LOCALHOST, 0), +3339 BindOpts::default().set_prefix_len(32), +3340 )? +3341 .bind() +3342 .await?; +3343 let bound_sockets = ep.bound_sockets(); +3344 assert_eq!(bound_sockets.len(), 3); +3345 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv4()).count(), 2); +3346 assert_eq!(bound_sockets.iter().filter(|x| x.is_ipv6()).count(), 1); +3347 // Test that the default wildcard socket is there +3348 assert!( +3349 bound_sockets +3350 .iter() +3351 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::UNSPECIFIED)) +3352 ); +3353 // Test that our manually added socket is there +3354 assert!( +3355 bound_sockets +3356 .iter() +3357 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) +3358 ); +3359 ep.close().await; +3360 Ok(()) +3361 } +3362 +3363 /// Bind on an unusable port with the default opts. +3364 /// +3365 /// Binding the endpoint fails with an AddrInUse error. +3366 #[tokio::test] +3367 #[traced_test] +3368 async fn test_bind_addr_badport() -> Result { +3369 let socket = std::net::UdpSocket::bind((Ipv4Addr::LOCALHOST, 0))?; +3370 let port = socket.local_addr()?.port(); +3371 +3372 let res = Endpoint::builder(presets::Minimal) +3373 .clear_ip_transports() +3374 .bind_addr((Ipv4Addr::LOCALHOST, port))? +3375 .bind() +3376 .await; +3377 +3378 assert!(matches!( +3379 res, +3380 Err(BindError::Sockets { +3381 source: io_error, +3382 .. +3383 }) +3384 if io_error.kind() == io::ErrorKind::AddrInUse +3385 )); +3386 Ok(()) +3387 } +3388 +3389 /// Bind a non-default route on an unusable port, but set is_required = false. +3390 /// +3391 /// Binding the endpoint succeeds. +3392 #[tokio::test] +3393 #[traced_test] +3394 async fn test_bind_addr_badport_notrequired() -> Result { +3395 let socket = std::net::UdpSocket::bind((Ipv4Addr::LOCALHOST, 0))?; +3396 let port = socket.local_addr()?.port(); +3397 +3398 let ep = Endpoint::builder(presets::Minimal) +3399 .bind_addr_with_opts( +3400 (Ipv4Addr::LOCALHOST, port), +3401 BindOpts::default() +3402 .set_prefix_len(32) +3403 .set_is_required(false), +3404 )? +3405 .bind() +3406 .await?; +3407 let bound_sockets = ep.bound_sockets(); +3408 // just the default wildcard binds +3409 assert_eq!(bound_sockets.len(), 2); +3410 // our requested bind addr is not included because it failed to bind +3411 assert!( +3412 !bound_sockets +3413 .iter() +3414 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) +3415 ); +3416 Ok(()) +3417 } +3418 +3419 /// Bind on a default route on an unusable port, but set is_required = false. +3420 /// +3421 /// Binding the endpoint succeeds. +3422 #[tokio::test] +3423 #[traced_test] +3424 async fn test_bind_addr_badport_default_notrequired() -> Result { +3425 let socket = std::net::UdpSocket::bind((Ipv4Addr::LOCALHOST, 0))?; +3426 let port = socket.local_addr()?.port(); +3427 +3428 let ep = Endpoint::builder(presets::Minimal) +3429 .bind_addr_with_opts( +3430 (Ipv4Addr::LOCALHOST, port), +3431 BindOpts::default().set_is_required(false), +3432 )? +3433 .bind() +3434 .await?; +3435 let bound_sockets = ep.bound_sockets(); +3436 // just the IPv6 default, but no IPv4 bind at all because we replaced the default +3437 // with a bind with an unusable port and set it to not be required. +3438 assert_eq!(bound_sockets.len(), 1); +3439 assert!(bound_sockets[0].is_ipv6()); +3440 Ok(()) +3441 } +3442 +3443 /// Bind on an unusable port, with is_required = false, and no other transports. +3444 /// +3445 /// Binding the endpoint fails with "no valid address available". +3446 #[tokio::test] +3447 #[traced_test] +3448 async fn test_bind_addr_badport_notrequired_no_other_transports() -> Result { +3449 let socket = std::net::UdpSocket::bind((Ipv4Addr::LOCALHOST, 0))?; +3450 let port = socket.local_addr()?.port(); +3451 +3452 let res = Endpoint::builder(presets::Minimal) +3453 .clear_ip_transports() +3454 .bind_addr_with_opts( +3455 (Ipv4Addr::LOCALHOST, port), +3456 BindOpts::default().set_is_required(false), +3457 )? +3458 .bind() +3459 .await; +3460 +3461 assert!(matches!( +3462 res, +3463 Err(BindError::CreateQuicEndpoint { +3464 source: io_error, +3465 .. +3466 }) +3467 if io_error.kind() == io::ErrorKind::Other && io_error.to_string() == "no valid address available" +3468 )); +3469 Ok(()) +3470 } +3471 +3472 /// Bind with prefix len 0 but set the route as non-default. +3473 #[tokio::test] +3474 #[traced_test] +3475 async fn test_bind_addr_prefix_len_0_not_default() -> Result { +3476 let ep = Endpoint::builder(presets::Minimal) +3477 .bind_addr_with_opts( +3478 (Ipv4Addr::LOCALHOST, 0), +3479 BindOpts::default().set_is_default_route(false), +3480 )? +3481 .bind() +3482 .await?; +3483 let bound_sockets = ep.bound_sockets(); +3484 // The two default wildcard binds plus our additional route (which does not replace the default route +3485 // because we set is_default_route to false explicitly). +3486 assert_eq!(bound_sockets.len(), 3); +3487 assert!( +3488 bound_sockets +3489 .iter() +3490 .any(|x| x.ip() == IpAddr::V6(Ipv6Addr::UNSPECIFIED)) +3491 ); +3492 assert!( +3493 bound_sockets +3494 .iter() +3495 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::UNSPECIFIED)) +3496 ); +3497 assert!( +3498 bound_sockets +3499 .iter() +3500 .any(|x| x.ip() == IpAddr::V4(Ipv4Addr::LOCALHOST)) +3501 ); +3502 Ok(()) +3503 } +3504 +3505 #[ignore = "flaky"] +3506 #[tokio::test] +3507 #[traced_test] +3508 async fn connect_via_relay_becomes_direct_and_sends_direct() -> Result { +3509 let (relay_map, relay_url, _relay_server_guard) = run_relay_server().await?; +3510 let qlog = Arc::new(QlogFileGroup::from_env( +3511 "connect_via_relay_becomes_direct_and_sends_direct", +3512 )); +3513 let transfer_size = 1_000_000; +3514 +3515 async fn collect_stats(mut events: PathEventStream) -> BTreeMap<TransportAddr, PathStats> { +3516 let mut stats = BTreeMap::new(); +3517 while let Some(event) = events.next().await { +3518 if let PathEvent::Closed { +3519 remote_addr, +3520 last_stats, +3521 .. +3522 } = event +3523 { +3524 stats.insert(remote_addr, *last_stats); +3525 } +3526 } +3527 stats +3528 } +3529 +3530 let client = Endpoint::builder(presets::Minimal) +3531 .relay_mode(RelayMode::Custom(relay_map.clone())) +3532 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +3533 .transport_config(qlog.create("client")?) +3534 .bind() +3535 .await?; +3536 let server = Endpoint::builder(presets::Minimal) +3537 .relay_mode(RelayMode::Custom(relay_map)) +3538 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +3539 .transport_config(qlog.create("server")?) +3540 .alpns(vec![TEST_ALPN.to_vec()]) +3541 .bind() +3542 .await?; +3543 let server_addr = EndpointAddr::new(server.id()).with_relay_url(relay_url); +3544 let server_task = tokio::spawn(async move { +3545 let incoming = server.accept().await.anyerr()?; +3546 let conn = incoming.await.anyerr()?; +3547 let stats_task = tokio::spawn(collect_stats(conn.path_events())); +3548 let (mut send, mut recv) = conn.accept_bi().await.anyerr()?; +3549 let msg = recv.read_to_end(transfer_size).await.anyerr()?; +3550 send.write_all(&msg).await.anyerr()?; +3551 send.finish().anyerr()?; +3552 conn.closed().await; +3553 let stats = stats_task.await.expect("stats task panicked"); +3554 Ok::<_, Error>(stats) +3555 }); +3556 +3557 let conn = client.connect(server_addr, TEST_ALPN).await?; +3558 let client_stats_task = tokio::spawn(collect_stats(conn.path_events())); +3559 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; +3560 send.write_all(&vec![42u8; transfer_size]).await.anyerr()?; +3561 send.finish().anyerr()?; +3562 recv.read_to_end(transfer_size).await.anyerr()?; +3563 conn.close(0u32.into(), b"thanks, bye!"); +3564 client.close().await; +3565 let client_stats = client_stats_task.await.expect("stats task panicked"); +3566 let server_stats = server_task.await.anyerr()??; +3567 +3568 info!("client stats: {client_stats:#?}"); +3569 info!("server stats: {server_stats:#?}"); +3570 +3571 let client_total_relay_tx = client_stats +3572 .iter() +3573 .filter(|(remote, _stats)| remote.is_relay()) +3574 .map(|(_, stats)| stats.udp_tx.bytes) +3575 .sum::<u64>(); +3576 let client_total_relay_rx = client_stats +3577 .iter() +3578 .filter(|(remote, _stats)| remote.is_relay()) +3579 .map(|(_, stats)| stats.udp_rx.bytes) +3580 .sum::<u64>(); +3581 let server_total_relay_tx = server_stats +3582 .iter() +3583 .filter(|(remote, _stats)| remote.is_relay()) +3584 .map(|(_, stats)| stats.udp_tx.bytes) +3585 .sum::<u64>(); +3586 let server_total_relay_rx = server_stats +3587 .iter() +3588 .filter(|(remote, _stats)| remote.is_relay()) +3589 .map(|(_, stats)| stats.udp_rx.bytes) +3590 .sum::<u64>(); +3591 +3592 info!(?client_total_relay_tx, "total"); +3593 info!(?client_total_relay_rx, "total"); +3594 info!(?server_total_relay_tx, "total"); +3595 info!(?server_total_relay_rx, "total"); +3596 +3597 // We should send/receive only the minorty of traffic via the relay. +3598 assert!(client_total_relay_tx < transfer_size as u64 / 2); +3599 assert!(client_total_relay_rx < transfer_size as u64 / 2); +3600 assert!(server_total_relay_tx < transfer_size as u64 / 2); +3601 assert!(server_total_relay_rx < transfer_size as u64 / 2); +3602 +3603 Ok(()) +3604 } +3605 +3606 /// Tests that correct logs are emitted when connecting two endpoints with same secret keys to a relay. +3607 #[tokio::test] +3608 #[traced_test] +3609 async fn same_endpoint_id_relay() -> Result { +3610 let (relay_map, relay_url, _relay_server_guard) = run_relay_server().await?; +3611 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(1u64); +3612 let secret_key = SecretKey::from_bytes(&rng.random()); +3613 +3614 let client = Endpoint::builder(presets::Minimal) +3615 .relay_mode(RelayMode::Custom(relay_map.clone())) +3616 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +3617 .bind() +3618 .instrument(error_span!("ep-client")) +3619 .await?; 3620 -3621 // bind ep1 and wait until connected to relay. -3622 let ep1 = Endpoint::builder(presets::Minimal) -3623 .relay_mode(RelayMode::Custom(relay_map.clone())) -3624 .secret_key(secret_key.clone()) -3625 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -3626 .alpns(vec![TEST_ALPN.to_vec()]) -3627 .bind() -3628 .instrument(error_span!("ep1")) -3629 .await?; -3630 info!("ep1 bound {:?}", ep1.id()); -3631 ep1.online().await; -3632 info!("ep1 online"); -3633 -3634 let addr = EndpointAddr::new(secret_key.public()).with_relay_url(relay_url.clone()); +3621 info!("client {}", client.id()); +3622 +3623 // bind ep1 and wait until connected to relay. +3624 let ep1 = Endpoint::builder(presets::Minimal) +3625 .relay_mode(RelayMode::Custom(relay_map.clone())) +3626 .secret_key(secret_key.clone()) +3627 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +3628 .alpns(vec![TEST_ALPN.to_vec()]) +3629 .bind() +3630 .instrument(error_span!("ep1")) +3631 .await?; +3632 info!("ep1 bound {:?}", ep1.id()); +3633 ep1.online().await; +3634 info!("ep1 online"); 3635 -3636 tokio::try_join!( -3637 async { -3638 let conn = client.connect(addr.clone(), TEST_ALPN).await?; -3639 let reason = conn.closed().await; -3640 assert!(is_application_closed(&reason, 1)); -3641 n0_error::Ok(()) -3642 }, -3643 async { -3644 let conn = ep1.accept().await.unwrap().await?; -3645 conn.close(1u32.into(), b"bye"); -3646 n0_error::Ok(()) -3647 } -3648 )?; -3649 info!("client connected to ep1"); -3650 -3651 // now start second endpoint with same secret key -3652 let ep2 = Endpoint::builder(presets::Minimal) -3653 .relay_mode(RelayMode::Custom(relay_map)) -3654 .secret_key(secret_key.clone()) -3655 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -3656 .alpns(vec![TEST_ALPN.to_vec()]) -3657 .bind() -3658 .instrument(error_span!("ep2")) -3659 .await?; -3660 info!("ep2 bound {:?}", ep2.id()); -3661 ep2.online().await; -3662 println!("ep2 online"); -3663 -3664 // `online` does not mean that the connection to the home relay was *established*, -3665 // only that the home relay was *chosen* based on the net report probes. -3666 // We need to wait for the connection to be established though, to be sure that new packets -3667 // will be routed to the new endpoint and not to the old endpoint anymore. -3668 // We don't expose being connected to the home relay on the endpoint currently, -3669 // so we resort to log assertions. -3670 // TODO(Frando): Replace once we add a proper API for this. -3671 let expected_log_line = format!( -3672 "ep2:endpoint{{id={}}}:relay-actor:active-relay{{url={relay_url}}}:connected: iroh::_events::relay::connected", -3673 ep2.id().fmt_short() -3674 ); -3675 tokio::time::timeout(Duration::from_secs(5), async { -3676 while !logs_contain(&expected_log_line) { -3677 tokio::time::sleep(Duration::from_millis(10)).await -3678 } -3679 }) -3680 .await -3681 .std_context("relay connection did not establish in time")?; -3682 -3683 tokio::try_join!( -3684 async { -3685 let conn = client.connect(addr.clone(), TEST_ALPN).await?; -3686 let reason = conn.closed().await; -3687 assert!(is_application_closed(&reason, 1)); -3688 n0_error::Ok(()) -3689 }, -3690 async { -3691 let conn = ep2.accept().await.unwrap().await?; -3692 conn.close(1u32.into(), b"bye"); -3693 n0_error::Ok(()) -3694 } -3695 )?; -3696 println!("client connected to ep2"); -3697 -3698 // assert that ep1 did not receive a connection -3699 assert!(now_or_never(ep1.accept()).is_none()); -3700 -3701 // We assert that we get the warn log once for endpoint 1, and not at all for endpoint 2. -3702 logs_assert(|logs| { -3703 let expected_line = |line: &str| { -3704 line.contains("WARN") && line.contains("Another endpoint connected with the same endpoint id. No more messages will be received") -3705 }; -3706 let count_line_ep1 = logs -3707 .iter() -3708 .filter(|line| line.contains(":ep1:") && expected_line(line)) -3709 .count(); -3710 let count_line_ep2 = logs -3711 .iter() -3712 .filter(|line| line.contains(":ep2:") && expected_line(line)) -3713 .count(); -3714 if count_line_ep1 == 1 && count_line_ep2 == 0 { -3715 Ok(()) -3716 } else { -3717 Err("Logs don't match expectations".to_string()) -3718 } -3719 }); -3720 tokio::join!(ep1.close(), ep2.close(), client.close()); -3721 Ok(()) -3722 } -3723 -3724 fn is_application_closed(close_reason: &ConnectionError, code: u32) -> bool { -3725 matches!( -3726 close_reason, -3727 ConnectionError::ApplicationClosed(f) if f.error_code ==code.into() -3728 ) -3729 } -3730 -3731 #[tokio::test] -3732 #[traced_test] -3733 async fn test_closed_endpoint_behaviour() -> Result { -3734 // create endpoint -3735 // call endpoint.close -3736 // ensure methods behave in the expected way -3737 info!("Creating endpoint"); -3738 let ep = Endpoint::builder(presets::N0).bind().await?; -3739 let closed = ep.closed(); -3740 info!("Closing endpoint"); -3741 let now = Instant::now(); -3742 ep.close().await; -3743 info!("Endpoint closed in {:?}", now.elapsed()); -3744 -3745 // Assert that the `closed` cancellation token is now cancelled -3746 assert_eq!(now_or_never(closed), Some(())); -3747 -3748 info!("Set ALPNS fails silently"); -3749 ep.set_alpns(vec![b"test".into()]); -3750 -3751 info!("Insert Relay returns None"); -3752 let relay_config = crate::defaults::staging::default_na_east_relay(); -3753 assert!( -3754 ep.insert_relay("localhost:300".parse()?, Arc::new(relay_config)) -3755 .await -3756 .is_none() -3757 ); -3758 -3759 info!("Remove Relay returns None"); -3760 assert!(ep.remove_relay(&"localhost:300".parse()?).await.is_none()); -3761 -3762 info!("Connecting"); -3763 let mut rng = ChaCha8Rng::seed_from_u64(41); -3764 let ep_id = SecretKey::from_bytes(&rng.random()).public(); -3765 -3766 // should likely be an error that states that the -3767 // endpoint is closed instead: -3768 if let ConnectError::Connect { source, .. } = ep.connect(ep_id, b"test").await.unwrap_err() -3769 { -3770 assert!(matches!( -3771 source, -3772 ConnectWithOptsError::EndpointClosed { .. } -3773 )); -3774 } else { -3775 panic!("unexpected error for connect"); -3776 } -3777 -3778 info!("Accepting!"); -3779 assert!(ep.accept().await.is_none()); -3780 -3781 // this should work -3782 info!("Addr: {:?}", ep.addr()); -3783 -3784 // create watchers to verify they terminate after the endpoint is dropped. -3785 let mut addrs = ep.watch_addr().stream(); -3786 let mut net_reports = ep.net_report().stream(); -3787 -3788 // returns None -3789 let net_report = ep.last_net_report(); -3790 info!("last Net report {net_report:?}"); -3791 -3792 // this should work -3793 let sockets = ep.bound_sockets(); -3794 info!("Sockets: {sockets:?}"); -3795 -3796 // these should return errors -3797 assert!(ep.dns_resolver().is_err()); -3798 assert!(ep.address_lookup().is_err()); -3799 -3800 #[cfg(feature = "metrics")] -3801 { -3802 // this should work -3803 let metrics = ep.metrics(); -3804 info!("Metrics: {metrics:?}"); -3805 } -3806 -3807 // this should return none -3808 assert!(ep.remote_info(ep_id).await.is_none()); -3809 -3810 // this should fail silently -3811 ep.network_change().await; -3812 -3813 // this should fail silently -3814 ep.set_user_data_for_address_lookup(Some( -3815 UserData::try_from("TEST".to_string()).expect("valid string"), -3816 )); -3817 drop(ep); -3818 // now that the endpoint is dropped, all watchers should terminate. -3819 tokio::time::timeout(Duration::from_secs(1), async { -3820 while let Some(addr) = addrs.next().await { -3821 info!("Addrs stream: {addr:?}"); -3822 } -3823 while let Some(net_report) = net_reports.next().await { -3824 info!("Net report stream: {net_report:?}"); -3825 } -3826 }) -3827 .await -3828 .expect("watchers not closed"); -3829 -3830 info!("Done!"); -3831 Ok(()) -3832 } -3833 -3834 #[tokio::test] -3835 #[traced_test] -3836 async fn test_closed_endpoint_unpolled_accept_fut() -> Result { -3837 info!("Creating endpoint"); -3838 let ep = Endpoint::builder(presets::N0).bind().await?; -3839 -3840 info!("Get accept future"); -3841 let accept_fut = ep.accept(); -3842 -3843 info!("Closing endpoint"); -3844 let now = Instant::now(); -3845 tokio::time::timeout(Duration::from_secs(5), ep.close()) -3846 .await -3847 .expect("Endpoint closes in a reasonable time"); -3848 info!("Endpoint closed in {:?}", now.elapsed()); -3849 -3850 info!("Accept future returns None after the endpoint has closed"); -3851 let incoming = accept_fut.await; -3852 assert!(incoming.is_none()); -3853 Ok(()) -3854 } -3855 -3856 #[tokio::test] -3857 #[traced_test] -3858 async fn test_closed_endpoint_polled_accept_fut() -> Result { -3859 info!("Creating endpoint"); -3860 let ep = Endpoint::builder(presets::N0).bind().await?; -3861 -3862 info!("Run an accept task"); -3863 let ep2 = ep.clone(); -3864 let accept_task = tokio::spawn(async move { -3865 info!("Waiting on Accept"); -3866 let res = ep2.accept().await; -3867 info!("Accept await has returned"); -3868 res -3869 }); -3870 -3871 // Try to ensure the accept future is polled at least once. -3872 tokio::time::sleep(Duration::from_millis(10)).await; -3873 -3874 info!("Closing the endpoint"); -3875 tokio::time::timeout(Duration::from_secs(5), ep.close()) -3876 .await -3877 .expect("Endpoint closes in a reasonable time"); -3878 info!("Endpoint closed"); -3879 -3880 info!("Await the accept task"); -3881 let incoming = accept_task.await.expect("accept task panicked"); -3882 assert!(incoming.is_none()); -3883 -3884 Ok(()) -3885 } -3886 -3887 #[tokio::test] -3888 #[traced_test] -3889 async fn test_endpoint_online_add_relay() -> Result { -3890 let ep = Endpoint::builder(presets::Minimal) -3891 .relay_mode(RelayMode::Custom(RelayMap::empty())) -3892 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -3893 .bind() -3894 .await?; -3895 // should not come online without relays. -3896 let res = tokio::time::timeout(Duration::from_millis(500), ep.online()).await; -3897 assert!(res.is_err()); -3898 -3899 // should come online after a relay is added. -3900 let (relay_map, relay_url, _relay_server_guard) = run_relay_server().await?; -3901 ep.insert_relay(relay_url.clone(), relay_map.get(&relay_url).unwrap()) -3902 .await; -3903 let res = tokio::time::timeout(Duration::from_millis(1000), ep.online()).await; -3904 assert!(res.is_ok()); -3905 -3906 // online should still return after endpoint close, if the endpoint was last online -3907 let ep_clone = ep.clone(); -3908 let task = tokio::task::spawn(async move { -3909 tokio::time::timeout(Duration::from_millis(500), ep_clone.online()).await -3910 }); -3911 ep.close().await; -3912 let res = task.await.unwrap(); -3913 assert!(res.is_ok()); -3914 Ok(()) -3915 } -3916 -3917 #[tokio::test] -3918 #[traced_test] -3919 async fn test_endpoint_online_close() -> Result { -3920 let ep = Endpoint::bind(presets::Minimal).await?; -3921 // should not come online without relays. -3922 let res = tokio::time::timeout(Duration::from_millis(500), ep.online()).await; -3923 assert!(res.is_err()); -3924 -3925 // online should remain pending after the endpoint is closed. -3926 let ep_clone = ep.clone(); -3927 let task = tokio::task::spawn(async move { -3928 tokio::time::timeout(Duration::from_millis(500), ep_clone.online()).await -3929 }); -3930 ep.close().await; -3931 let res = task.await.unwrap(); -3932 assert!(res.is_err()); -3933 Ok(()) -3934 } -3935 -3936 /// Verifies that an endpoint configured with [`RelayConfig::with_auth_token`] -3937 /// is admitted to a relay whose access control checks the token only when -3938 /// the token matches. -3939 #[tokio::test] -3940 #[traced_test] -3941 async fn test_endpoint_relay_auth_token() -> Result { -3942 const TOKEN: &str = "valid-token"; -3943 -3944 /// Admits a connection only if it carries the expected auth token. -3945 #[derive(Debug)] -3946 struct TokenAccess(&'static str); -3947 -3948 impl iroh_relay::server::AccessControl for TokenAccess { -3949 async fn on_connect(&self, request: &iroh_relay::server::ClientRequest) -> Access { -3950 if request.auth_token().as_deref() == Some(self.0) { -3951 Access::Allow -3952 } else { -3953 Access::Deny { reason: None } -3954 } -3955 } -3956 } -3957 -3958 let access = Arc::new(TokenAccess(TOKEN)); -3959 let (_relay_map, relay_url, _guard) = run_relay_server_with_access(false, access).await?; -3960 -3961 // Wrong token: the connection attempt fails and last_error reports -3962 // the relay-side denial. -3963 let bad_map: RelayMap = RelayConfig::new(relay_url.clone(), None) -3964 .with_auth_token("wrong-token") -3965 .into(); -3966 let bad_ep = Endpoint::builder(presets::Minimal) -3967 .relay_mode(RelayMode::Custom(bad_map)) -3968 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -3969 .bind() -3970 .await?; -3971 let mut stream = bad_ep.home_relay_status().stream(); -3972 let auth_err: String = tokio::time::timeout(Duration::from_secs(5), async { -3973 while let Some(status) = stream.next().await { -3974 if let Some(err) = status.iter().filter_map(|s| s.last_error()).next() { -3975 return format!("{err:#}"); -3976 } -3977 } -3978 panic!("home relay stream ended"); -3979 }) -3980 .await -3981 .std_context("waiting for auth error")?; -3982 assert!( -3983 auth_err.contains("not authorized"), -3984 "expected 'not authorized' in error, got: {auth_err}" -3985 ); -3986 -3987 // Correct token: the endpoint reaches the connected state. -3988 let good_map: RelayMap = RelayConfig::new(relay_url, None) -3989 .with_auth_token(TOKEN) -3990 .into(); -3991 let good_ep = Endpoint::builder(presets::Minimal) -3992 .relay_mode(RelayMode::Custom(good_map)) -3993 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -3994 .bind() -3995 .await?; -3996 tokio::time::timeout(Duration::from_secs(5), good_ep.online()) -3997 .await -3998 .std_context("waiting for endpoint to come online")?; -3999 -4000 Ok(()) -4001 } -4002} \ No newline at end of file +3636 let addr = EndpointAddr::new(secret_key.public()).with_relay_url(relay_url.clone()); +3637 +3638 tokio::try_join!( +3639 async { +3640 let conn = client.connect(addr.clone(), TEST_ALPN).await?; +3641 let reason = conn.closed().await; +3642 assert!(is_application_closed(&reason, 1)); +3643 n0_error::Ok(()) +3644 }, +3645 async { +3646 let conn = ep1.accept().await.unwrap().await?; +3647 conn.close(1u32.into(), b"bye"); +3648 n0_error::Ok(()) +3649 } +3650 )?; +3651 info!("client connected to ep1"); +3652 +3653 // now start second endpoint with same secret key +3654 let ep2 = Endpoint::builder(presets::Minimal) +3655 .relay_mode(RelayMode::Custom(relay_map)) +3656 .secret_key(secret_key.clone()) +3657 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +3658 .alpns(vec![TEST_ALPN.to_vec()]) +3659 .bind() +3660 .instrument(error_span!("ep2")) +3661 .await?; +3662 info!("ep2 bound {:?}", ep2.id()); +3663 ep2.online().await; +3664 println!("ep2 online"); +3665 +3666 // `online` does not mean that the connection to the home relay was *established*, +3667 // only that the home relay was *chosen* based on the net report probes. +3668 // We need to wait for the connection to be established though, to be sure that new packets +3669 // will be routed to the new endpoint and not to the old endpoint anymore. +3670 // We don't expose being connected to the home relay on the endpoint currently, +3671 // so we resort to log assertions. +3672 // TODO(Frando): Replace once we add a proper API for this. +3673 let expected_log_line = format!( +3674 "ep2:endpoint{{id={}}}:relay-actor:active-relay{{url={relay_url}}}:connected: iroh::_events::relay::connected", +3675 ep2.id().fmt_short() +3676 ); +3677 tokio::time::timeout(Duration::from_secs(5), async { +3678 while !logs_contain(&expected_log_line) { +3679 tokio::time::sleep(Duration::from_millis(10)).await +3680 } +3681 }) +3682 .await +3683 .std_context("relay connection did not establish in time")?; +3684 +3685 tokio::try_join!( +3686 async { +3687 let conn = client.connect(addr.clone(), TEST_ALPN).await?; +3688 let reason = conn.closed().await; +3689 assert!(is_application_closed(&reason, 1)); +3690 n0_error::Ok(()) +3691 }, +3692 async { +3693 let conn = ep2.accept().await.unwrap().await?; +3694 conn.close(1u32.into(), b"bye"); +3695 n0_error::Ok(()) +3696 } +3697 )?; +3698 println!("client connected to ep2"); +3699 +3700 // assert that ep1 did not receive a connection +3701 assert!(now_or_never(ep1.accept()).is_none()); +3702 +3703 // We assert that we get the warn log once for endpoint 1, and not at all for endpoint 2. +3704 logs_assert(|logs| { +3705 let expected_line = |line: &str| { +3706 line.contains("WARN") && line.contains("Another endpoint connected with the same endpoint id. No more messages will be received") +3707 }; +3708 let count_line_ep1 = logs +3709 .iter() +3710 .filter(|line| line.contains(":ep1:") && expected_line(line)) +3711 .count(); +3712 let count_line_ep2 = logs +3713 .iter() +3714 .filter(|line| line.contains(":ep2:") && expected_line(line)) +3715 .count(); +3716 if count_line_ep1 == 1 && count_line_ep2 == 0 { +3717 Ok(()) +3718 } else { +3719 Err("Logs don't match expectations".to_string()) +3720 } +3721 }); +3722 tokio::join!(ep1.close(), ep2.close(), client.close()); +3723 Ok(()) +3724 } +3725 +3726 fn is_application_closed(close_reason: &ConnectionError, code: u32) -> bool { +3727 matches!( +3728 close_reason, +3729 ConnectionError::ApplicationClosed(f) if f.error_code ==code.into() +3730 ) +3731 } +3732 +3733 #[tokio::test] +3734 #[traced_test] +3735 async fn test_closed_endpoint_behaviour() -> Result { +3736 // create endpoint +3737 // call endpoint.close +3738 // ensure methods behave in the expected way +3739 info!("Creating endpoint"); +3740 let ep = Endpoint::builder(presets::N0).bind().await?; +3741 let closed = ep.closed(); +3742 info!("Closing endpoint"); +3743 let now = Instant::now(); +3744 ep.close().await; +3745 info!("Endpoint closed in {:?}", now.elapsed()); +3746 +3747 // Assert that the `closed` cancellation token is now cancelled +3748 assert_eq!(now_or_never(closed), Some(())); +3749 +3750 info!("Set ALPNS fails silently"); +3751 ep.set_alpns(vec![b"test".into()]); +3752 +3753 info!("Insert Relay returns None"); +3754 let relay_config = crate::defaults::staging::default_na_east_relay(); +3755 assert!( +3756 ep.insert_relay("localhost:300".parse()?, Arc::new(relay_config)) +3757 .await +3758 .is_none() +3759 ); +3760 +3761 info!("Remove Relay returns None"); +3762 assert!(ep.remove_relay(&"localhost:300".parse()?).await.is_none()); +3763 +3764 info!("Connecting"); +3765 let mut rng = ChaCha8Rng::seed_from_u64(41); +3766 let ep_id = SecretKey::from_bytes(&rng.random()).public(); +3767 +3768 // should likely be an error that states that the +3769 // endpoint is closed instead: +3770 if let ConnectError::Connect { source, .. } = ep.connect(ep_id, b"test").await.unwrap_err() +3771 { +3772 assert!(matches!( +3773 source, +3774 ConnectWithOptsError::EndpointClosed { .. } +3775 )); +3776 } else { +3777 panic!("unexpected error for connect"); +3778 } +3779 +3780 info!("Accepting!"); +3781 assert!(ep.accept().await.is_none()); +3782 +3783 // this should work +3784 info!("Addr: {:?}", ep.addr()); +3785 +3786 // create watchers to verify they terminate after the endpoint is dropped. +3787 let mut addrs = ep.watch_addr().stream(); +3788 let mut net_reports = ep.net_report().stream(); +3789 +3790 // returns None +3791 let net_report = ep.last_net_report(); +3792 info!("last Net report {net_report:?}"); +3793 +3794 // this should work +3795 let sockets = ep.bound_sockets(); +3796 info!("Sockets: {sockets:?}"); +3797 +3798 // these should return errors +3799 assert!(ep.dns_resolver().is_err()); +3800 assert!(ep.address_lookup().is_err()); +3801 +3802 #[cfg(feature = "metrics")] +3803 { +3804 // this should work +3805 let metrics = ep.metrics(); +3806 info!("Metrics: {metrics:?}"); +3807 } +3808 +3809 // this should return none +3810 assert!(ep.remote_info(ep_id).await.is_none()); +3811 +3812 // this should fail silently +3813 ep.network_change().await; +3814 +3815 // this should fail silently +3816 ep.set_user_data_for_address_lookup(Some( +3817 UserData::try_from("TEST".to_string()).expect("valid string"), +3818 )); +3819 drop(ep); +3820 // now that the endpoint is dropped, all watchers should terminate. +3821 tokio::time::timeout(Duration::from_secs(1), async { +3822 while let Some(addr) = addrs.next().await { +3823 info!("Addrs stream: {addr:?}"); +3824 } +3825 while let Some(net_report) = net_reports.next().await { +3826 info!("Net report stream: {net_report:?}"); +3827 } +3828 }) +3829 .await +3830 .expect("watchers not closed"); +3831 +3832 info!("Done!"); +3833 Ok(()) +3834 } +3835 +3836 #[tokio::test] +3837 #[traced_test] +3838 async fn test_closed_endpoint_unpolled_accept_fut() -> Result { +3839 info!("Creating endpoint"); +3840 let ep = Endpoint::builder(presets::N0).bind().await?; +3841 +3842 info!("Get accept future"); +3843 let accept_fut = ep.accept(); +3844 +3845 info!("Closing endpoint"); +3846 let now = Instant::now(); +3847 tokio::time::timeout(Duration::from_secs(5), ep.close()) +3848 .await +3849 .expect("Endpoint closes in a reasonable time"); +3850 info!("Endpoint closed in {:?}", now.elapsed()); +3851 +3852 info!("Accept future returns None after the endpoint has closed"); +3853 let incoming = accept_fut.await; +3854 assert!(incoming.is_none()); +3855 Ok(()) +3856 } +3857 +3858 #[tokio::test] +3859 #[traced_test] +3860 async fn test_closed_endpoint_polled_accept_fut() -> Result { +3861 info!("Creating endpoint"); +3862 let ep = Endpoint::builder(presets::N0).bind().await?; +3863 +3864 info!("Run an accept task"); +3865 let ep2 = ep.clone(); +3866 let accept_task = tokio::spawn(async move { +3867 info!("Waiting on Accept"); +3868 let res = ep2.accept().await; +3869 info!("Accept await has returned"); +3870 res +3871 }); +3872 +3873 // Try to ensure the accept future is polled at least once. +3874 tokio::time::sleep(Duration::from_millis(10)).await; +3875 +3876 info!("Closing the endpoint"); +3877 tokio::time::timeout(Duration::from_secs(5), ep.close()) +3878 .await +3879 .expect("Endpoint closes in a reasonable time"); +3880 info!("Endpoint closed"); +3881 +3882 info!("Await the accept task"); +3883 let incoming = accept_task.await.expect("accept task panicked"); +3884 assert!(incoming.is_none()); +3885 +3886 Ok(()) +3887 } +3888 +3889 #[tokio::test] +3890 #[traced_test] +3891 async fn test_endpoint_online_add_relay() -> Result { +3892 let ep = Endpoint::builder(presets::Minimal) +3893 .relay_mode(RelayMode::Custom(RelayMap::empty())) +3894 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +3895 .bind() +3896 .await?; +3897 // should not come online without relays. +3898 let res = tokio::time::timeout(Duration::from_millis(500), ep.online()).await; +3899 assert!(res.is_err()); +3900 +3901 // should come online after a relay is added. +3902 let (relay_map, relay_url, _relay_server_guard) = run_relay_server().await?; +3903 ep.insert_relay(relay_url.clone(), relay_map.get(&relay_url).unwrap()) +3904 .await; +3905 let res = tokio::time::timeout(Duration::from_millis(1000), ep.online()).await; +3906 assert!(res.is_ok()); +3907 +3908 // online should still return after endpoint close, if the endpoint was last online +3909 let ep_clone = ep.clone(); +3910 let task = tokio::task::spawn(async move { +3911 tokio::time::timeout(Duration::from_millis(500), ep_clone.online()).await +3912 }); +3913 ep.close().await; +3914 let res = task.await.unwrap(); +3915 assert!(res.is_ok()); +3916 Ok(()) +3917 } +3918 +3919 #[tokio::test] +3920 #[traced_test] +3921 async fn test_endpoint_online_close() -> Result { +3922 let ep = Endpoint::bind(presets::Minimal).await?; +3923 // should not come online without relays. +3924 let res = tokio::time::timeout(Duration::from_millis(500), ep.online()).await; +3925 assert!(res.is_err()); +3926 +3927 // online should remain pending after the endpoint is closed. +3928 let ep_clone = ep.clone(); +3929 let task = tokio::task::spawn(async move { +3930 tokio::time::timeout(Duration::from_millis(500), ep_clone.online()).await +3931 }); +3932 ep.close().await; +3933 let res = task.await.unwrap(); +3934 assert!(res.is_err()); +3935 Ok(()) +3936 } +3937 +3938 /// Verifies that an endpoint configured with [`RelayConfig::with_auth_token`] +3939 /// is admitted to a relay whose access control checks the token only when +3940 /// the token matches. +3941 #[tokio::test] +3942 #[traced_test] +3943 async fn test_endpoint_relay_auth_token() -> Result { +3944 const TOKEN: &str = "valid-token"; +3945 +3946 /// Admits a connection only if it carries the expected auth token. +3947 #[derive(Debug)] +3948 struct TokenAccess(&'static str); +3949 +3950 impl iroh_relay::server::AccessControl for TokenAccess { +3951 async fn on_connect(&self, request: &iroh_relay::server::ClientRequest) -> Access { +3952 if request.auth_token().as_deref() == Some(self.0) { +3953 Access::Allow +3954 } else { +3955 Access::Deny { reason: None } +3956 } +3957 } +3958 } +3959 +3960 let access = Arc::new(TokenAccess(TOKEN)); +3961 let (_relay_map, relay_url, _guard) = run_relay_server_with_access(false, access).await?; +3962 +3963 // Wrong token: the connection attempt fails and last_error reports +3964 // the relay-side denial. +3965 let bad_map: RelayMap = RelayConfig::new(relay_url.clone(), None) +3966 .with_auth_token("wrong-token") +3967 .into(); +3968 let bad_ep = Endpoint::builder(presets::Minimal) +3969 .relay_mode(RelayMode::Custom(bad_map)) +3970 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +3971 .bind() +3972 .await?; +3973 let mut stream = bad_ep.home_relay_status().stream(); +3974 let auth_err: String = tokio::time::timeout(Duration::from_secs(5), async { +3975 while let Some(status) = stream.next().await { +3976 if let Some(err) = status.iter().filter_map(|s| s.last_error()).next() { +3977 return format!("{err:#}"); +3978 } +3979 } +3980 panic!("home relay stream ended"); +3981 }) +3982 .await +3983 .std_context("waiting for auth error")?; +3984 assert!( +3985 auth_err.contains("not authorized"), +3986 "expected 'not authorized' in error, got: {auth_err}" +3987 ); +3988 +3989 // Correct token: the endpoint reaches the connected state. +3990 let good_map: RelayMap = RelayConfig::new(relay_url, None) +3991 .with_auth_token(TOKEN) +3992 .into(); +3993 let good_ep = Endpoint::builder(presets::Minimal) +3994 .relay_mode(RelayMode::Custom(good_map)) +3995 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +3996 .bind() +3997 .await?; +3998 tokio::time::timeout(Duration::from_secs(5), good_ep.online()) +3999 .await +4000 .std_context("waiting for endpoint to come online")?; +4001 +4002 Ok(()) +4003 } +4004} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh/endpoint/bind.rs.html b/pr/4036/docs/src/iroh/endpoint/bind.rs.html index f6ad583a09..2bf24df398 100644 --- a/pr/4036/docs/src/iroh/endpoint/bind.rs.html +++ b/pr/4036/docs/src/iroh/endpoint/bind.rs.html @@ -111,7 +111,7 @@ 111 /// Returns whether this is a default route. 112 /// 113 /// If [`Self::set_is_default_route`] has been called then that value is returned. -114 /// Otherwise, returns `true` if the [`prefix_len`][`Self::prefix_len] is `0` and +114 /// Otherwise, returns `true` if the [`prefix_len`][`Self::prefix_len`] is `0` and 115 /// `false` otherwise. 116 pub fn is_default_route(&self) -> bool { 117 match self.is_default_route { diff --git a/pr/4036/docs/src/iroh/endpoint/connection.rs.html b/pr/4036/docs/src/iroh/endpoint/connection.rs.html index 37493bb133..18087a129a 100644 --- a/pr/4036/docs/src/iroh/endpoint/connection.rs.html +++ b/pr/4036/docs/src/iroh/endpoint/connection.rs.html @@ -214,7 +214,7 @@ 214 self.inner.remote_address_validated() 215 } 216 -217 /// Decrypt the Initial packet payload +217 /// Decrypts the Initial packet payload. 218 /// 219 /// This clones and decrypts the packet payload (~1200 bytes). 220 /// Can be used to extract information from the TLS ClientHello without completing the handshake. @@ -840,7 +840,7 @@ 840 self.inner.accept_uni() 841 } 842 -843 /// Accept the next incoming bidirectional stream. +843 /// Accepts the next incoming bidirectional stream. 844 /// 845 /// **Important Note**: The peer that calls [`open_bi`] must write to its [`SendStream`] 846 /// before the peer `Connection` is able to accept the stream using @@ -861,7 +861,7 @@ 861 self.inner.read_datagram() 862 } 863 -864 /// Wait for the connection to be closed for any reason. +864 /// Waits for the connection to be closed for any reason. 865 /// 866 /// Despite the return type's name, closed connections are often not an error condition 867 /// at the application layer. Cases that might be routine include @@ -1043,549 +1043,551 @@ 1043 self.inner.set_max_concurrent_uni_streams(count) 1044 } 1045 -1046 /// See [`noq_proto::TransportConfig::receive_window`]. -1047 #[inline] -1048 pub fn set_receive_window(&self, receive_window: VarInt) { -1049 self.inner.set_receive_window(receive_window) -1050 } -1051 -1052 /// Modifies the number of bidirectional streams that may be concurrently opened. -1053 /// -1054 /// No streams may be opened by the peer unless fewer than `count` are already -1055 /// open. Large `count`s increase both minimum and worst-case memory consumption. -1056 #[inline] -1057 pub fn set_max_concurrent_bi_streams(&self, count: VarInt) { -1058 self.inner.set_max_concurrent_bi_streams(count) -1059 } -1060} -1061 -1062impl Connection<HandshakeCompleted> { -1063 /// Extracts the ALPN protocol from the peer's handshake data. -1064 pub fn alpn(&self) -> &[u8] { -1065 &self.data.info.alpn -1066 } -1067 -1068 /// Returns the [`EndpointId`] from the peer's TLS certificate. -1069 /// -1070 /// The [`PublicKey`] of an endpoint is also known as an [`EndpointId`]. This [`PublicKey`] is -1071 /// included in the TLS certificate presented during the handshake when connecting. -1072 /// This function allows you to get the [`EndpointId`] of the remote endpoint of this -1073 /// connection. -1074 /// -1075 /// [`PublicKey`]: iroh_base::PublicKey -1076 pub fn remote_id(&self) -> EndpointId { -1077 self.data.info.endpoint_id -1078 } -1079 -1080 /// Returns the currently open network paths for this connection. -1081 /// -1082 /// A connection typically has one path via the relay server and, -1083 /// once holepunching succeeds, a direct path. The returned -1084 /// [`PathList`] is a snapshot taken at call time: it does not -1085 /// reflect later changes, and it does not include paths that have -1086 /// already closed. -1087 /// -1088 /// To observe changes over time, see [`Connection::paths_stream`] -1089 /// for a stream of [`PathList`] snapshots and -1090 /// [`Connection::path_events`] for individual [`PathEvent`]s. -1091 /// -1092 /// [`PathEvent`]: crate::endpoint::PathEvent -1093 pub fn paths(&self) -> PathList<'_> { -1094 self.data.paths.get(&self.inner) -1095 } -1096 -1097 /// Returns a stream of [`PathList`] snapshots for this connection. -1098 /// -1099 /// Yields the current snapshot on the first poll, and a fresh -1100 /// snapshot whenever the open paths or the selected path change. -1101 /// Ends when the connection closes. -1102 /// -1103 /// The stream borrows this [`Connection`]. To consume it from a -1104 /// spawned task, move a [`Connection`] clone into the task and -1105 /// call this method inside. -1106 pub fn paths_stream(&self) -> PathListStream<'_> { -1107 self.data.paths.stream(&self.inner) -1108 } -1109 -1110 /// Returns a stream of [`PathEvent`]s for this connection. -1111 /// -1112 /// Each event reports one of: a path opened, a path closed (with -1113 /// final per-path statistics), the selected transmission path -1114 /// changed, or the consumer fell behind. The stream ends when the -1115 /// connection closes. It does not borrow this [`Connection`] and -1116 /// may be moved into a spawned task. -1117 /// -1118 /// If the consumer does not poll fast enough, the stream yields a -1119 /// single [`PathEvent::Lagged`]; the current state of the open -1120 /// paths and the selected path remains recoverable via -1121 /// [`Connection::paths`]. -1122 /// -1123 /// [`PathEvent`]: crate::endpoint::PathEvent -1124 /// [`PathEvent::Lagged`]: crate::endpoint::PathEvent::Lagged -1125 pub fn path_events(&self) -> PathEventStream { -1126 self.data.paths.events() -1127 } -1128 -1129 /// Returns the side of the connection (client or server). -1130 pub fn side(&self) -> Side { -1131 self.inner.side() -1132 } -1133 -1134 /// Returns a [`WeakConnectionHandle`] for this connection. -1135 /// -1136 /// A [`WeakConnectionHandle`] does not keep the connection alive. It can be used to -1137 /// wait for the connection to be closed via [`WeakConnectionHandle::closed`] and to -1138 /// attempt to upgrade back to a strong [`Connection`] via -1139 /// [`WeakConnectionHandle::upgrade`]. -1140 pub fn weak_handle(&self) -> WeakConnectionHandle { -1141 WeakConnectionHandle { -1142 data: self.data.clone(), -1143 inner: self.inner.weak_handle(), -1144 } -1145 } -1146} -1147 -1148impl Connection<IncomingZeroRtt> { -1149 /// Extracts the ALPN protocol from the peer's handshake data. -1150 pub fn alpn(&self) -> Option<Vec<u8>> { -1151 alpn_from_noq_conn(&self.inner) -1152 } -1153 -1154 /// Waits until the full handshake occurs and then returns a [`Connection`]. -1155 /// -1156 /// This may fail with [`ConnectingError::ConnectionError`], if there was -1157 /// some general failure with the connection, such as a network timeout since -1158 /// we accepted the connection. -1159 /// -1160 /// This may fail with [`ConnectingError::HandshakeFailure`], if the other side -1161 /// doesn't use the right TLS authentication, which usually every iroh endpoint -1162 /// uses and requires. -1163 /// -1164 /// Thus, those errors should only occur if someone connects to you with a -1165 /// modified iroh endpoint or with a plain QUIC client. -1166 pub async fn handshake_completed(&self) -> Result<Connection, ConnectingError> { -1167 self.data.accepted.clone().await -1168 } -1169 -1170 /// Returns the [`EndpointId`] from the peer's TLS certificate. -1171 /// -1172 /// The [`PublicKey`] of an endpoint is also known as an [`EndpointId`]. This [`PublicKey`] is -1173 /// included in the TLS certificate presented during the handshake when connecting. -1174 /// This function allows you to get the [`EndpointId`] of the remote endpoint of this -1175 /// connection. -1176 /// -1177 /// [`PublicKey`]: iroh_base::PublicKey -1178 pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError> { -1179 remote_id_from_noq_conn(&self.inner) -1180 } -1181} -1182 -1183impl Connection<OutgoingZeroRtt> { -1184 /// Extracts the ALPN protocol from the peer's handshake data. -1185 pub fn alpn(&self) -> Option<Vec<u8>> { -1186 alpn_from_noq_conn(&self.inner) -1187 } -1188 -1189 /// Waits until the full handshake occurs and returns a [`ZeroRttStatus`]. -1190 /// -1191 /// If `ZeroRttStatus::Accepted` is returned, than any streams created before -1192 /// the handshake has completed can still be used. -1193 /// -1194 /// If `ZeroRttStatus::Rejected` is returned, than any streams created before -1195 /// the handshake will error and any data sent should be re-sent on a -1196 /// new stream. -1197 /// -1198 /// This may fail with [`ConnectingError::ConnectionError`], if there was -1199 /// some general failure with the connection, such as a network timeout since -1200 /// we initiated the connection. -1201 /// -1202 /// This may fail with [`ConnectingError::HandshakeFailure`], if the other side -1203 /// doesn't use the right TLS authentication, which usually every iroh endpoint -1204 /// uses and requires. -1205 /// -1206 /// Thus, those errors should only occur if someone connects to you with a -1207 /// modified iroh endpoint or with a plain QUIC client. -1208 pub async fn handshake_completed(&self) -> Result<ZeroRttStatus, ConnectingError> { -1209 self.data.accepted.clone().await -1210 } -1211 -1212 /// Returns the [`EndpointId`] from the peer's TLS certificate. -1213 /// -1214 /// The [`PublicKey`] of an endpoint is also known as an [`EndpointId`]. This [`PublicKey`] is -1215 /// included in the TLS certificate presented during the handshake when connecting. -1216 /// This function allows you to get the [`EndpointId`] of the remote endpoint of this -1217 /// connection. -1218 /// -1219 /// [`PublicKey`]: iroh_base::PublicKey -1220 pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError> { -1221 remote_id_from_noq_conn(&self.inner) -1222 } -1223} -1224 -1225/// A weak handle to a [`Connection`]. -1226/// -1227/// A [`WeakConnectionHandle`] does not keep the connection alive: holding one will not -1228/// prevent the connection from being closed when the last [`Connection`] handle is dropped. -1229/// -1230/// Use [`upgrade`] to obtain a strong [`Connection`], and [`closed`] to wait for the -1231/// connection to be closed without keeping it alive. -1232/// -1233/// [`upgrade`]: WeakConnectionHandle::upgrade -1234/// [`closed`]: WeakConnectionHandle::closed -1235#[derive(Debug, Clone)] -1236pub struct WeakConnectionHandle { -1237 data: HandshakeCompletedData, -1238 inner: NoqWeakConnectionHandle, -1239} -1240 -1241impl WeakConnectionHandle { -1242 /// Attempts to upgrade this weak handle to a strong [`Connection`]. -1243 /// -1244 /// Returns `None` if the connection has already been dropped. -1245 pub fn upgrade(&self) -> Option<Connection> { -1246 self.inner.upgrade().map(|inner| Connection { -1247 inner, -1248 data: self.data.clone(), -1249 }) -1250 } -1251 -1252 /// Returns a future that resolves once the connection has been closed. -1253 /// -1254 /// If no strong references to the [`Connection`] exist at the time this is called, -1255 /// the future resolves to `None`. If at least one strong reference still exists at -1256 /// the time of this call, the returned future is guaranteed to receive the close -1257 /// event with the close reason and final connection statistics, even if all strong -1258 /// references are dropped before the future is awaited. -1259 /// -1260 /// The future does not keep the connection alive. -1261 pub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static { -1262 let registered = self.inner.upgrade().map(|conn| conn.on_closed()); -1263 async move { -1264 match registered { -1265 Some(fut) => Some(fut.await), -1266 None => None, -1267 } -1268 } -1269 } -1270} -1271 -1272#[cfg(all(test, with_crypto_provider))] -1273mod tests { -1274 use std::time::Duration; -1275 -1276 use iroh_base::{EndpointAddr, SecretKey}; -1277 use iroh_relay::tls::CaTlsConfig; -1278 use n0_error::{Result, StackResultExt, StdResultExt}; -1279 use n0_future::{Stream, StreamExt}; -1280 use n0_tracing_test::traced_test; -1281 use rand::{RngExt, SeedableRng}; -1282 use tracing::{Instrument, error_span, info, info_span, trace_span}; -1283 -1284 use super::Endpoint; -1285 use crate::{ -1286 RelayMode, -1287 endpoint::{ConnectOptions, Incoming, PathList, ZeroRttStatus, presets}, -1288 test_utils::run_relay_server, -1289 }; -1290 -1291 const TEST_ALPN: &[u8] = b"n0/iroh/test"; +1046 /// Sets the connection-level flow control receive window. +1047 /// +1048 /// See [`noq_proto::TransportConfig::receive_window`]. +1049 #[inline] +1050 pub fn set_receive_window(&self, receive_window: VarInt) { +1051 self.inner.set_receive_window(receive_window) +1052 } +1053 +1054 /// Modifies the number of bidirectional streams that may be concurrently opened. +1055 /// +1056 /// No streams may be opened by the peer unless fewer than `count` are already +1057 /// open. Large `count`s increase both minimum and worst-case memory consumption. +1058 #[inline] +1059 pub fn set_max_concurrent_bi_streams(&self, count: VarInt) { +1060 self.inner.set_max_concurrent_bi_streams(count) +1061 } +1062} +1063 +1064impl Connection<HandshakeCompleted> { +1065 /// Extracts the ALPN protocol from the peer's handshake data. +1066 pub fn alpn(&self) -> &[u8] { +1067 &self.data.info.alpn +1068 } +1069 +1070 /// Returns the [`EndpointId`] from the peer's TLS certificate. +1071 /// +1072 /// The [`PublicKey`] of an endpoint is also known as an [`EndpointId`]. This [`PublicKey`] is +1073 /// included in the TLS certificate presented during the handshake when connecting. +1074 /// This function allows you to get the [`EndpointId`] of the remote endpoint of this +1075 /// connection. +1076 /// +1077 /// [`PublicKey`]: iroh_base::PublicKey +1078 pub fn remote_id(&self) -> EndpointId { +1079 self.data.info.endpoint_id +1080 } +1081 +1082 /// Returns the currently open network paths for this connection. +1083 /// +1084 /// A connection typically has one path via the relay server and, +1085 /// once holepunching succeeds, a direct path. The returned +1086 /// [`PathList`] is a snapshot taken at call time: it does not +1087 /// reflect later changes, and it does not include paths that have +1088 /// already closed. +1089 /// +1090 /// To observe changes over time, see [`Connection::paths_stream`] +1091 /// for a stream of [`PathList`] snapshots and +1092 /// [`Connection::path_events`] for individual [`PathEvent`]s. +1093 /// +1094 /// [`PathEvent`]: crate::endpoint::PathEvent +1095 pub fn paths(&self) -> PathList<'_> { +1096 self.data.paths.get(&self.inner) +1097 } +1098 +1099 /// Returns a stream of [`PathList`] snapshots for this connection. +1100 /// +1101 /// Yields the current snapshot on the first poll, and a fresh +1102 /// snapshot whenever the open paths or the selected path change. +1103 /// Ends when the connection closes. +1104 /// +1105 /// The stream borrows this [`Connection`]. To consume it from a +1106 /// spawned task, move a [`Connection`] clone into the task and +1107 /// call this method inside. +1108 pub fn paths_stream(&self) -> PathListStream<'_> { +1109 self.data.paths.stream(&self.inner) +1110 } +1111 +1112 /// Returns a stream of [`PathEvent`]s for this connection. +1113 /// +1114 /// Each event reports one of: a path opened, a path closed (with +1115 /// final per-path statistics), the selected transmission path +1116 /// changed, or the consumer fell behind. The stream ends when the +1117 /// connection closes. It does not borrow this [`Connection`] and +1118 /// may be moved into a spawned task. +1119 /// +1120 /// If the consumer does not poll fast enough, the stream yields a +1121 /// single [`PathEvent::Lagged`]; the current state of the open +1122 /// paths and the selected path remains recoverable via +1123 /// [`Connection::paths`]. +1124 /// +1125 /// [`PathEvent`]: crate::endpoint::PathEvent +1126 /// [`PathEvent::Lagged`]: crate::endpoint::PathEvent::Lagged +1127 pub fn path_events(&self) -> PathEventStream { +1128 self.data.paths.events() +1129 } +1130 +1131 /// Returns the side of the connection (client or server). +1132 pub fn side(&self) -> Side { +1133 self.inner.side() +1134 } +1135 +1136 /// Returns a [`WeakConnectionHandle`] for this connection. +1137 /// +1138 /// A [`WeakConnectionHandle`] does not keep the connection alive. It can be used to +1139 /// wait for the connection to be closed via [`WeakConnectionHandle::closed`] and to +1140 /// attempt to upgrade back to a strong [`Connection`] via +1141 /// [`WeakConnectionHandle::upgrade`]. +1142 pub fn weak_handle(&self) -> WeakConnectionHandle { +1143 WeakConnectionHandle { +1144 data: self.data.clone(), +1145 inner: self.inner.weak_handle(), +1146 } +1147 } +1148} +1149 +1150impl Connection<IncomingZeroRtt> { +1151 /// Extracts the ALPN protocol from the peer's handshake data. +1152 pub fn alpn(&self) -> Option<Vec<u8>> { +1153 alpn_from_noq_conn(&self.inner) +1154 } +1155 +1156 /// Waits until the full handshake occurs and then returns a [`Connection`]. +1157 /// +1158 /// This may fail with [`ConnectingError::ConnectionError`], if there was +1159 /// some general failure with the connection, such as a network timeout since +1160 /// we accepted the connection. +1161 /// +1162 /// This may fail with [`ConnectingError::HandshakeFailure`], if the other side +1163 /// doesn't use the right TLS authentication, which usually every iroh endpoint +1164 /// uses and requires. +1165 /// +1166 /// Thus, those errors should only occur if someone connects to you with a +1167 /// modified iroh endpoint or with a plain QUIC client. +1168 pub async fn handshake_completed(&self) -> Result<Connection, ConnectingError> { +1169 self.data.accepted.clone().await +1170 } +1171 +1172 /// Returns the [`EndpointId`] from the peer's TLS certificate. +1173 /// +1174 /// The [`PublicKey`] of an endpoint is also known as an [`EndpointId`]. This [`PublicKey`] is +1175 /// included in the TLS certificate presented during the handshake when connecting. +1176 /// This function allows you to get the [`EndpointId`] of the remote endpoint of this +1177 /// connection. +1178 /// +1179 /// [`PublicKey`]: iroh_base::PublicKey +1180 pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError> { +1181 remote_id_from_noq_conn(&self.inner) +1182 } +1183} +1184 +1185impl Connection<OutgoingZeroRtt> { +1186 /// Extracts the ALPN protocol from the peer's handshake data. +1187 pub fn alpn(&self) -> Option<Vec<u8>> { +1188 alpn_from_noq_conn(&self.inner) +1189 } +1190 +1191 /// Waits until the full handshake occurs and returns a [`ZeroRttStatus`]. +1192 /// +1193 /// If `ZeroRttStatus::Accepted` is returned, then any streams created before +1194 /// the handshake has completed can still be used. +1195 /// +1196 /// If `ZeroRttStatus::Rejected` is returned, then any streams created before +1197 /// the handshake will error and any data sent should be re-sent on a +1198 /// new stream. +1199 /// +1200 /// This may fail with [`ConnectingError::ConnectionError`], if there was +1201 /// some general failure with the connection, such as a network timeout since +1202 /// we initiated the connection. +1203 /// +1204 /// This may fail with [`ConnectingError::HandshakeFailure`], if the other side +1205 /// doesn't use the right TLS authentication, which usually every iroh endpoint +1206 /// uses and requires. +1207 /// +1208 /// Thus, those errors should only occur if someone connects to you with a +1209 /// modified iroh endpoint or with a plain QUIC client. +1210 pub async fn handshake_completed(&self) -> Result<ZeroRttStatus, ConnectingError> { +1211 self.data.accepted.clone().await +1212 } +1213 +1214 /// Returns the [`EndpointId`] from the peer's TLS certificate. +1215 /// +1216 /// The [`PublicKey`] of an endpoint is also known as an [`EndpointId`]. This [`PublicKey`] is +1217 /// included in the TLS certificate presented during the handshake when connecting. +1218 /// This function allows you to get the [`EndpointId`] of the remote endpoint of this +1219 /// connection. +1220 /// +1221 /// [`PublicKey`]: iroh_base::PublicKey +1222 pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError> { +1223 remote_id_from_noq_conn(&self.inner) +1224 } +1225} +1226 +1227/// A weak handle to a [`Connection`]. +1228/// +1229/// A [`WeakConnectionHandle`] does not keep the connection alive: holding one will not +1230/// prevent the connection from being closed when the last [`Connection`] handle is dropped. +1231/// +1232/// Use [`upgrade`] to obtain a strong [`Connection`], and [`closed`] to wait for the +1233/// connection to be closed without keeping it alive. +1234/// +1235/// [`upgrade`]: WeakConnectionHandle::upgrade +1236/// [`closed`]: WeakConnectionHandle::closed +1237#[derive(Debug, Clone)] +1238pub struct WeakConnectionHandle { +1239 data: HandshakeCompletedData, +1240 inner: NoqWeakConnectionHandle, +1241} +1242 +1243impl WeakConnectionHandle { +1244 /// Attempts to upgrade this weak handle to a strong [`Connection`]. +1245 /// +1246 /// Returns `None` if the connection has already been dropped. +1247 pub fn upgrade(&self) -> Option<Connection> { +1248 self.inner.upgrade().map(|inner| Connection { +1249 inner, +1250 data: self.data.clone(), +1251 }) +1252 } +1253 +1254 /// Returns a future that resolves once the connection has been closed. +1255 /// +1256 /// If no strong references to the [`Connection`] exist at the time this is called, +1257 /// the future resolves to `None`. If at least one strong reference still exists at +1258 /// the time of this call, the returned future is guaranteed to receive the close +1259 /// event with the close reason and final connection statistics, even if all strong +1260 /// references are dropped before the future is awaited. +1261 /// +1262 /// The future does not keep the connection alive. +1263 pub fn closed(&self) -> impl Future<Output = Option<Closed>> + Send + 'static { +1264 let registered = self.inner.upgrade().map(|conn| conn.on_closed()); +1265 async move { +1266 match registered { +1267 Some(fut) => Some(fut.await), +1268 None => None, +1269 } +1270 } +1271 } +1272} +1273 +1274#[cfg(all(test, with_crypto_provider))] +1275mod tests { +1276 use std::time::Duration; +1277 +1278 use iroh_base::{EndpointAddr, SecretKey}; +1279 use iroh_relay::tls::CaTlsConfig; +1280 use n0_error::{Result, StackResultExt, StdResultExt}; +1281 use n0_future::{Stream, StreamExt}; +1282 use n0_tracing_test::traced_test; +1283 use rand::{RngExt, SeedableRng}; +1284 use tracing::{Instrument, error_span, info, info_span, trace_span}; +1285 +1286 use super::Endpoint; +1287 use crate::{ +1288 RelayMode, +1289 endpoint::{ConnectOptions, Incoming, PathList, ZeroRttStatus, presets}, +1290 test_utils::run_relay_server, +1291 }; 1292 -1293 async fn spawn_0rtt_server(secret_key: SecretKey, log_span: tracing::Span) -> Result<Endpoint> { -1294 let server = Endpoint::builder(presets::Minimal) -1295 .secret_key(secret_key) -1296 .alpns(vec![TEST_ALPN.to_vec()]) -1297 .bind() -1298 .instrument(log_span.clone()) -1299 .await?; -1300 -1301 async fn handle_incoming(incoming: Incoming) -> Result { -1302 let accepting = incoming -1303 .accept() -1304 .std_context("Failed to accept incoming connection")?; -1305 -1306 // accept a possible 0-RTT connection -1307 let zrtt_conn = accepting.into_0rtt(); -1308 -1309 let (mut send, mut recv) = zrtt_conn -1310 .accept_bi() -1311 .await -1312 .std_context("failed to accept bi stream")?; -1313 -1314 let data = recv -1315 .read_to_end(10_000_000) -1316 .await -1317 .std_context("Failed to read data")?; -1318 -1319 send.write_all(&data) -1320 .await -1321 .std_context("Failed to write data")?; -1322 send.finish().std_context("Failed to finish send")?; -1323 -1324 // Stay alive until the other side closes the connection. -1325 zrtt_conn.closed().await; -1326 Ok(()) -1327 } -1328 -1329 // Gets aborted via the endpoint closing causing an `Err` -1330 // a simple echo server -1331 tokio::spawn({ -1332 let server = server.clone(); -1333 async move { -1334 tracing::trace!("Server accept loop started"); -1335 while let Some(incoming) = server.accept().await { -1336 tracing::trace!("Server received incoming connection"); -1337 // Handle connection errors gracefully instead of exiting the task -1338 if let Err(e) = handle_incoming(incoming).await { -1339 tracing::warn!("Failure while handling connection: {e:#}"); -1340 } -1341 tracing::trace!("Connection closed, ready for next"); -1342 } -1343 tracing::trace!("Server accept loop exiting"); -1344 n0_error::Ok(()) -1345 } -1346 .instrument(log_span) -1347 }); -1348 -1349 Ok(server) -1350 } -1351 -1352 async fn connect_client_0rtt_expect_err( -1353 client: &Endpoint, -1354 server_addr: EndpointAddr, -1355 ) -> Result { -1356 let conn = client -1357 .connect_with_opts(server_addr, TEST_ALPN, ConnectOptions::new()) -1358 .await? -1359 .into_0rtt() -1360 .expect_err("expected 0-RTT to fail") -1361 .await?; -1362 -1363 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; -1364 send.write_all(b"hello").await.anyerr()?; -1365 send.finish().anyerr()?; -1366 let received = recv.read_to_end(1_000).await.anyerr()?; -1367 assert_eq!(&received, b"hello"); -1368 conn.close(0u32.into(), b"thx"); -1369 Ok(()) -1370 } -1371 -1372 async fn connect_client_0rtt_expect_ok( -1373 client: &Endpoint, -1374 server_addr: EndpointAddr, -1375 expect_server_accepts: bool, -1376 ) -> Result { -1377 tracing::trace!(?server_addr, "Client connecting with 0-RTT"); -1378 let zrtt_conn = client -1379 .connect_with_opts(server_addr, TEST_ALPN, ConnectOptions::new()) -1380 .await -1381 .context("connect")? -1382 .into_0rtt() -1383 .ok() -1384 .context("into_0rtt")?; -1385 -1386 tracing::trace!("Client established 0-RTT connection"); -1387 // This is how we send data in 0-RTT: -1388 let (mut send, mut recv) = zrtt_conn.open_bi().await.anyerr()?; -1389 send.write_all(b"hello").await.anyerr()?; -1390 send.finish().anyerr()?; -1391 tracing::trace!("Client sent 0-RTT data, waiting for server response"); -1392 // When this resolves, we've gotten a response from the server about whether the 0-RTT data above was accepted: -1393 let zrtt_res = zrtt_conn.handshake_completed().await; -1394 tracing::trace!(?zrtt_res, "Server responded to 0-RTT"); -1395 let zrtt_res = zrtt_res.context("handshake completed")?; -1396 let conn = match zrtt_res { -1397 ZeroRttStatus::Accepted(conn) => { -1398 assert!(expect_server_accepts); -1399 conn -1400 } -1401 ZeroRttStatus::Rejected(conn) => { -1402 assert!(!expect_server_accepts); -1403 // in this case we need to re-send data by re-creating the stream. -1404 let (mut send, r) = conn.open_bi().await.anyerr()?; -1405 send.write_all(b"hello").await.anyerr()?; -1406 send.finish().anyerr()?; -1407 recv = r; -1408 conn -1409 } -1410 }; -1411 let received = recv.read_to_end(1_000).await.anyerr()?; -1412 assert_eq!(&received, b"hello"); -1413 conn.close(0u32.into(), b"thx"); -1414 Ok(()) -1415 } -1416 -1417 #[tokio::test] -1418 #[traced_test] -1419 async fn test_0rtt() -> Result { -1420 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); -1421 let client = Endpoint::bind(presets::Minimal).await?; -1422 let server = -1423 spawn_0rtt_server(SecretKey::from_bytes(&rng.random()), info_span!("server")).await?; -1424 -1425 connect_client_0rtt_expect_err(&client, server.addr()).await?; -1426 // The second 0rtt attempt should work -1427 connect_client_0rtt_expect_ok(&client, server.addr(), true).await?; -1428 -1429 client.close().await; -1430 server.close().await; -1431 -1432 Ok(()) -1433 } -1434 -1435 // We have this test, as this would've failed at some point. -1436 // This effectively tests that we correctly categorize the TLS session tickets we -1437 // receive into the respective "bucket" for the recipient. -1438 #[tokio::test] -1439 #[traced_test] -1440 async fn test_0rtt_non_consecutive() -> Result { -1441 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); -1442 let client = Endpoint::bind(presets::Minimal).await?; -1443 let server = -1444 spawn_0rtt_server(SecretKey::from_bytes(&rng.random()), info_span!("server")).await?; -1445 -1446 connect_client_0rtt_expect_err(&client, server.addr()).await?; +1293 const TEST_ALPN: &[u8] = b"n0/iroh/test"; +1294 +1295 async fn spawn_0rtt_server(secret_key: SecretKey, log_span: tracing::Span) -> Result<Endpoint> { +1296 let server = Endpoint::builder(presets::Minimal) +1297 .secret_key(secret_key) +1298 .alpns(vec![TEST_ALPN.to_vec()]) +1299 .bind() +1300 .instrument(log_span.clone()) +1301 .await?; +1302 +1303 async fn handle_incoming(incoming: Incoming) -> Result { +1304 let accepting = incoming +1305 .accept() +1306 .std_context("Failed to accept incoming connection")?; +1307 +1308 // accept a possible 0-RTT connection +1309 let zrtt_conn = accepting.into_0rtt(); +1310 +1311 let (mut send, mut recv) = zrtt_conn +1312 .accept_bi() +1313 .await +1314 .std_context("failed to accept bi stream")?; +1315 +1316 let data = recv +1317 .read_to_end(10_000_000) +1318 .await +1319 .std_context("Failed to read data")?; +1320 +1321 send.write_all(&data) +1322 .await +1323 .std_context("Failed to write data")?; +1324 send.finish().std_context("Failed to finish send")?; +1325 +1326 // Stay alive until the other side closes the connection. +1327 zrtt_conn.closed().await; +1328 Ok(()) +1329 } +1330 +1331 // Gets aborted via the endpoint closing causing an `Err` +1332 // a simple echo server +1333 tokio::spawn({ +1334 let server = server.clone(); +1335 async move { +1336 tracing::trace!("Server accept loop started"); +1337 while let Some(incoming) = server.accept().await { +1338 tracing::trace!("Server received incoming connection"); +1339 // Handle connection errors gracefully instead of exiting the task +1340 if let Err(e) = handle_incoming(incoming).await { +1341 tracing::warn!("Failure while handling connection: {e:#}"); +1342 } +1343 tracing::trace!("Connection closed, ready for next"); +1344 } +1345 tracing::trace!("Server accept loop exiting"); +1346 n0_error::Ok(()) +1347 } +1348 .instrument(log_span) +1349 }); +1350 +1351 Ok(server) +1352 } +1353 +1354 async fn connect_client_0rtt_expect_err( +1355 client: &Endpoint, +1356 server_addr: EndpointAddr, +1357 ) -> Result { +1358 let conn = client +1359 .connect_with_opts(server_addr, TEST_ALPN, ConnectOptions::new()) +1360 .await? +1361 .into_0rtt() +1362 .expect_err("expected 0-RTT to fail") +1363 .await?; +1364 +1365 let (mut send, mut recv) = conn.open_bi().await.anyerr()?; +1366 send.write_all(b"hello").await.anyerr()?; +1367 send.finish().anyerr()?; +1368 let received = recv.read_to_end(1_000).await.anyerr()?; +1369 assert_eq!(&received, b"hello"); +1370 conn.close(0u32.into(), b"thx"); +1371 Ok(()) +1372 } +1373 +1374 async fn connect_client_0rtt_expect_ok( +1375 client: &Endpoint, +1376 server_addr: EndpointAddr, +1377 expect_server_accepts: bool, +1378 ) -> Result { +1379 tracing::trace!(?server_addr, "Client connecting with 0-RTT"); +1380 let zrtt_conn = client +1381 .connect_with_opts(server_addr, TEST_ALPN, ConnectOptions::new()) +1382 .await +1383 .context("connect")? +1384 .into_0rtt() +1385 .ok() +1386 .context("into_0rtt")?; +1387 +1388 tracing::trace!("Client established 0-RTT connection"); +1389 // This is how we send data in 0-RTT: +1390 let (mut send, mut recv) = zrtt_conn.open_bi().await.anyerr()?; +1391 send.write_all(b"hello").await.anyerr()?; +1392 send.finish().anyerr()?; +1393 tracing::trace!("Client sent 0-RTT data, waiting for server response"); +1394 // When this resolves, we've gotten a response from the server about whether the 0-RTT data above was accepted: +1395 let zrtt_res = zrtt_conn.handshake_completed().await; +1396 tracing::trace!(?zrtt_res, "Server responded to 0-RTT"); +1397 let zrtt_res = zrtt_res.context("handshake completed")?; +1398 let conn = match zrtt_res { +1399 ZeroRttStatus::Accepted(conn) => { +1400 assert!(expect_server_accepts); +1401 conn +1402 } +1403 ZeroRttStatus::Rejected(conn) => { +1404 assert!(!expect_server_accepts); +1405 // in this case we need to re-send data by re-creating the stream. +1406 let (mut send, r) = conn.open_bi().await.anyerr()?; +1407 send.write_all(b"hello").await.anyerr()?; +1408 send.finish().anyerr()?; +1409 recv = r; +1410 conn +1411 } +1412 }; +1413 let received = recv.read_to_end(1_000).await.anyerr()?; +1414 assert_eq!(&received, b"hello"); +1415 conn.close(0u32.into(), b"thx"); +1416 Ok(()) +1417 } +1418 +1419 #[tokio::test] +1420 #[traced_test] +1421 async fn test_0rtt() -> Result { +1422 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); +1423 let client = Endpoint::bind(presets::Minimal).await?; +1424 let server = +1425 spawn_0rtt_server(SecretKey::from_bytes(&rng.random()), info_span!("server")).await?; +1426 +1427 connect_client_0rtt_expect_err(&client, server.addr()).await?; +1428 // The second 0rtt attempt should work +1429 connect_client_0rtt_expect_ok(&client, server.addr(), true).await?; +1430 +1431 client.close().await; +1432 server.close().await; +1433 +1434 Ok(()) +1435 } +1436 +1437 // We have this test, as this would've failed at some point. +1438 // This effectively tests that we correctly categorize the TLS session tickets we +1439 // receive into the respective "bucket" for the recipient. +1440 #[tokio::test] +1441 #[traced_test] +1442 async fn test_0rtt_non_consecutive() -> Result { +1443 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); +1444 let client = Endpoint::bind(presets::Minimal).await?; +1445 let server = +1446 spawn_0rtt_server(SecretKey::from_bytes(&rng.random()), info_span!("server")).await?; 1447 -1448 // connecting with another endpoint should not interfere with our -1449 // TLS session ticket cache for the first endpoint: -1450 let another = -1451 spawn_0rtt_server(SecretKey::from_bytes(&rng.random()), info_span!("another")).await?; -1452 connect_client_0rtt_expect_err(&client, another.addr()).await?; -1453 another.close().await; -1454 -1455 connect_client_0rtt_expect_ok(&client, server.addr(), true).await?; +1448 connect_client_0rtt_expect_err(&client, server.addr()).await?; +1449 +1450 // connecting with another endpoint should not interfere with our +1451 // TLS session ticket cache for the first endpoint: +1452 let another = +1453 spawn_0rtt_server(SecretKey::from_bytes(&rng.random()), info_span!("another")).await?; +1454 connect_client_0rtt_expect_err(&client, another.addr()).await?; +1455 another.close().await; 1456 -1457 client.close().await; -1458 server.close().await; -1459 -1460 Ok(()) -1461 } -1462 -1463 // Test whether 0-RTT is possible after a restart: -1464 #[tokio::test] -1465 #[traced_test] -1466 async fn test_0rtt_after_server_restart() -> Result { -1467 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); -1468 let client = Endpoint::builder(presets::Minimal) -1469 .bind() -1470 .instrument(info_span!("client")) -1471 .await?; -1472 let server_key = SecretKey::from_bytes(&rng.random()); -1473 let server = spawn_0rtt_server(server_key.clone(), info_span!("server-initial")).await?; -1474 -1475 connect_client_0rtt_expect_err(&client, server.addr()) -1476 .instrument(trace_span!("connect1")) -1477 .await -1478 .context("client connect 1")?; -1479 connect_client_0rtt_expect_ok(&client, server.addr(), true) -1480 .instrument(trace_span!("connect2")) -1481 .await -1482 .context("client connect 2")?; -1483 -1484 // adds time to the test, but we need to ensure the server is fully closed before spawning the next one. -1485 server.close().await; -1486 -1487 let server = spawn_0rtt_server(server_key, info_span!("server-restart")).await?; +1457 connect_client_0rtt_expect_ok(&client, server.addr(), true).await?; +1458 +1459 client.close().await; +1460 server.close().await; +1461 +1462 Ok(()) +1463 } +1464 +1465 // Test whether 0-RTT is possible after a restart: +1466 #[tokio::test] +1467 #[traced_test] +1468 async fn test_0rtt_after_server_restart() -> Result { +1469 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); +1470 let client = Endpoint::builder(presets::Minimal) +1471 .bind() +1472 .instrument(info_span!("client")) +1473 .await?; +1474 let server_key = SecretKey::from_bytes(&rng.random()); +1475 let server = spawn_0rtt_server(server_key.clone(), info_span!("server-initial")).await?; +1476 +1477 connect_client_0rtt_expect_err(&client, server.addr()) +1478 .instrument(trace_span!("connect1")) +1479 .await +1480 .context("client connect 1")?; +1481 connect_client_0rtt_expect_ok(&client, server.addr(), true) +1482 .instrument(trace_span!("connect2")) +1483 .await +1484 .context("client connect 2")?; +1485 +1486 // adds time to the test, but we need to ensure the server is fully closed before spawning the next one. +1487 server.close().await; 1488 -1489 // we expect the client to *believe* it can 0-RTT connect to the server (hence expect_ok), -1490 // but the server will reject the early data because it discarded necessary state -1491 // to decrypt it when restarting. -1492 connect_client_0rtt_expect_ok(&client, server.addr(), false) -1493 .instrument(trace_span!("connect3")) -1494 .await -1495 .context("client connect 3")?; -1496 -1497 tokio::join!(client.close(), server.close()); -1498 Ok(()) -1499 } -1500 -1501 #[tokio::test] -1502 #[traced_test] -1503 async fn test_paths_watcher() -> Result { -1504 const ALPN: &[u8] = b"test"; -1505 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -1506 let (relay_map, _relay_url, _guard) = run_relay_server().await?; -1507 let server = Endpoint::builder(presets::Minimal) -1508 .relay_mode(RelayMode::Custom(relay_map.clone())) -1509 .secret_key(SecretKey::from_bytes(&rng.random())) -1510 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -1511 .alpns(vec![ALPN.to_vec()]) -1512 .bind() -1513 .await?; -1514 -1515 let client = Endpoint::builder(presets::Minimal) -1516 .relay_mode(RelayMode::Custom(relay_map.clone())) -1517 .secret_key(SecretKey::from_bytes(&rng.random())) -1518 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) -1519 .bind() -1520 .await?; -1521 -1522 server.online().await; -1523 let server_addr = server.addr(); -1524 info!("server addr: {server_addr:?}"); -1525 -1526 let (conn_client, conn_server) = tokio::join!( -1527 async { client.connect(server_addr, ALPN).await.unwrap() }, -1528 async { server.accept().await.unwrap().await.unwrap() } -1529 ); -1530 info!("connected"); -1531 -1532 let mut paths_client = conn_client.paths_stream(); -1533 let mut paths_server = conn_server.paths_stream(); -1534 -1535 /// Advances the path stream until at least one IP and one relay path is available. -1536 /// -1537 /// Panics if the path stream finishes before that happens. -1538 async fn wait_for_paths(mut stream: impl Send + Unpin + Stream<Item = PathList<'_>>) { -1539 loop { -1540 let paths = stream.next().await.expect("paths stream ended"); -1541 info!(?paths, "paths"); -1542 if paths.len() >= 2 -1543 && paths.iter().any(|p| p.is_relay()) -1544 && paths.iter().any(|p| p.is_ip()) -1545 { -1546 info!("break"); -1547 return; -1548 } -1549 } -1550 } -1551 -1552 // Verify that both connections are notified of path changes and get an IP and a relay path. -1553 tokio::join!( -1554 async { -1555 tokio::time::timeout(Duration::from_secs(1), wait_for_paths(&mut paths_server)) -1556 .instrument(error_span!("paths-server")) -1557 .await -1558 .unwrap() -1559 }, -1560 async { -1561 tokio::time::timeout(Duration::from_secs(1), wait_for_paths(&mut paths_client)) -1562 .instrument(error_span!("paths-client")) -1563 .await -1564 .unwrap() -1565 } -1566 ); -1567 -1568 tokio::time::pause(); +1489 let server = spawn_0rtt_server(server_key, info_span!("server-restart")).await?; +1490 +1491 // we expect the client to *believe* it can 0-RTT connect to the server (hence expect_ok), +1492 // but the server will reject the early data because it discarded necessary state +1493 // to decrypt it when restarting. +1494 connect_client_0rtt_expect_ok(&client, server.addr(), false) +1495 .instrument(trace_span!("connect3")) +1496 .await +1497 .context("client connect 3")?; +1498 +1499 tokio::join!(client.close(), server.close()); +1500 Ok(()) +1501 } +1502 +1503 #[tokio::test] +1504 #[traced_test] +1505 async fn test_paths_watcher() -> Result { +1506 const ALPN: &[u8] = b"test"; +1507 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1508 let (relay_map, _relay_url, _guard) = run_relay_server().await?; +1509 let server = Endpoint::builder(presets::Minimal) +1510 .relay_mode(RelayMode::Custom(relay_map.clone())) +1511 .secret_key(SecretKey::from_bytes(&rng.random())) +1512 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +1513 .alpns(vec![ALPN.to_vec()]) +1514 .bind() +1515 .await?; +1516 +1517 let client = Endpoint::builder(presets::Minimal) +1518 .relay_mode(RelayMode::Custom(relay_map.clone())) +1519 .secret_key(SecretKey::from_bytes(&rng.random())) +1520 .ca_tls_config(CaTlsConfig::insecure_skip_verify()) +1521 .bind() +1522 .await?; +1523 +1524 server.online().await; +1525 let server_addr = server.addr(); +1526 info!("server addr: {server_addr:?}"); +1527 +1528 let (conn_client, conn_server) = tokio::join!( +1529 async { client.connect(server_addr, ALPN).await.unwrap() }, +1530 async { server.accept().await.unwrap().await.unwrap() } +1531 ); +1532 info!("connected"); +1533 +1534 let mut paths_client = conn_client.paths_stream(); +1535 let mut paths_server = conn_server.paths_stream(); +1536 +1537 /// Advances the path stream until at least one IP and one relay path is available. +1538 /// +1539 /// Panics if the path stream finishes before that happens. +1540 async fn wait_for_paths(mut stream: impl Send + Unpin + Stream<Item = PathList<'_>>) { +1541 loop { +1542 let paths = stream.next().await.expect("paths stream ended"); +1543 info!(?paths, "paths"); +1544 if paths.len() >= 2 +1545 && paths.iter().any(|p| p.is_relay()) +1546 && paths.iter().any(|p| p.is_ip()) +1547 { +1548 info!("break"); +1549 return; +1550 } +1551 } +1552 } +1553 +1554 // Verify that both connections are notified of path changes and get an IP and a relay path. +1555 tokio::join!( +1556 async { +1557 tokio::time::timeout(Duration::from_secs(1), wait_for_paths(&mut paths_server)) +1558 .instrument(error_span!("paths-server")) +1559 .await +1560 .unwrap() +1561 }, +1562 async { +1563 tokio::time::timeout(Duration::from_secs(1), wait_for_paths(&mut paths_client)) +1564 .instrument(error_span!("paths-client")) +1565 .await +1566 .unwrap() +1567 } +1568 ); 1569 -1570 // Close the client connection. -1571 info!("close client conn"); -1572 conn_client.close(0u32.into(), b""); -1573 -1574 // Verify that the path watch streams close shortly after the connection is closed -1575 tokio::time::timeout(Duration::from_nanos(1), async { -1576 while paths_client.next().await.is_some() {} -1577 }) -1578 .await -1579 .expect("client paths watcher did not close within 1s of connection close"); -1580 tokio::time::timeout(Duration::from_nanos(1), async { -1581 while paths_server.next().await.is_some() {} -1582 }) -1583 .await -1584 .expect("server paths watcher did not close within 1s of connection close"); -1585 -1586 server.close().await; -1587 client.close().await; -1588 -1589 Ok(()) -1590 } -1591} \ No newline at end of file +1570 tokio::time::pause(); +1571 +1572 // Close the client connection. +1573 info!("close client conn"); +1574 conn_client.close(0u32.into(), b""); +1575 +1576 // Verify that the path watch streams close shortly after the connection is closed +1577 tokio::time::timeout(Duration::from_nanos(1), async { +1578 while paths_client.next().await.is_some() {} +1579 }) +1580 .await +1581 .expect("client paths watcher did not close within 1s of connection close"); +1582 tokio::time::timeout(Duration::from_nanos(1), async { +1583 while paths_server.next().await.is_some() {} +1584 }) +1585 .await +1586 .expect("server paths watcher did not close within 1s of connection close"); +1587 +1588 server.close().await; +1589 client.close().await; +1590 +1591 Ok(()) +1592 } +1593} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh/endpoint/hooks.rs.html b/pr/4036/docs/src/iroh/endpoint/hooks.rs.html index 0a01bd2f1b..bae3a14c55 100644 --- a/pr/4036/docs/src/iroh/endpoint/hooks.rs.html +++ b/pr/4036/docs/src/iroh/endpoint/hooks.rs.html @@ -55,7 +55,7 @@ 55/// For each hook, all installed hooks are invoked in the order they were installed on 56/// the endpoint builder. If a hook returns `Accept`, processing continues with the next 57/// hook. If a hook returns `Reject`, processing is aborted and further hooks -58/// are not invoked for this hook. +58/// are not invoked for this hook point. 59/// 60/// ## Notes to implementers 61/// diff --git a/pr/4036/docs/src/iroh/endpoint/presets.rs.html b/pr/4036/docs/src/iroh/endpoint/presets.rs.html index ec13114ba6..6d27560337 100644 --- a/pr/4036/docs/src/iroh/endpoint/presets.rs.html +++ b/pr/4036/docs/src/iroh/endpoint/presets.rs.html @@ -17,7 +17,7 @@ 17 18use crate::endpoint::Builder; 19 -20/// Defines a preset +20/// A reusable bundle of endpoint [`Builder`] configuration. 21pub trait Preset { 22 /// Applies the configuration to the passed in [`Builder`]. 23 fn apply(self, builder: Builder) -> Builder; @@ -86,8 +86,8 @@ 86/// - setting the [`rustls::crypto::CryptoProvider`] to [ring] or [aws-lc-rs], depending 87/// on which feature is enabled in iroh (preferring ring if both are enabled). 88/// -89/// Due to the last point, this preset is only available with the `ring` or -90/// `aws-lc-rs` preset installed. +89/// Due to the last point, this preset is only available with the `tls-ring` or +90/// `tls-aws-lc-rs` feature enabled. 91/// If you want to set your own crypto provider, we recommend copying the 92/// implementation of this preset into your own and setting the appropriate crypto 93/// provider there. @@ -148,8 +148,8 @@ 148/// - setting the [`rustls::crypto::CryptoProvider`] to [ring] or [aws-lc-rs], depending 149/// on which feature is enabled in iroh (preferring ring if both are enabled). 150/// -151/// Due to the last point, this preset is only available with the `ring` or -152/// `aws-lc-rs` preset installed. +151/// Due to the last point, this preset is only available with the `tls-ring` or +152/// `tls-aws-lc-rs` feature enabled. 153/// If you want to set your own crypto provider, we recommend copying the 154/// implementation of this preset into your own and setting the appropriate crypto 155/// provider there. diff --git a/pr/4036/docs/src/iroh/endpoint/quic.rs.html b/pr/4036/docs/src/iroh/endpoint/quic.rs.html index 68dc12f1dd..759663bd60 100644 --- a/pr/4036/docs/src/iroh/endpoint/quic.rs.html +++ b/pr/4036/docs/src/iroh/endpoint/quic.rs.html @@ -487,7 +487,7 @@ 487 /// interact with the [`QuicTransportConfigBuilder::max_idle_timeout`], if the last path is 488 /// abandoned the entire connection will be closed. 489 /// -490 /// Note: values higher than [`PATH_MAX_IDLE_TIMEOUT`] are clamped and a warning is logged. +490 /// Note: values higher than `PATH_MAX_IDLE_TIMEOUT` (15 seconds) are clamped and a warning is logged. 491 pub fn default_path_max_idle_timeout(mut self, timeout: Duration) -> Self { 492 if timeout > PATH_MAX_IDLE_TIMEOUT { 493 warn!( diff --git a/pr/4036/docs/src/iroh/lib.rs.html b/pr/4036/docs/src/iroh/lib.rs.html index 810178c90d..7fc7b2b60e 100644 --- a/pr/4036/docs/src/iroh/lib.rs.html +++ b/pr/4036/docs/src/iroh/lib.rs.html @@ -1,6 +1,6 @@ lib.rs - source

    iroh/
    lib.rs

    1//! Peer-to-peer QUIC connections.
     2//!
    -3//! iroh is a library to establish direct connectivity between peers.  It exposes an
    +3//! iroh is a library to establish direct connectivity between peers. It exposes an
     4//! interface to [QUIC] connections and streams to the user, while implementing direct
     5//! connectivity using [hole punching] complemented by relay servers under the hood.
     6//!
    @@ -73,7 +73,7 @@
     73//!
     74//! If one of the iroh endpoints can be reached directly, connectivity can also be
     75//! established without involving a Relay server.  This is done by using the endpoint's
    -76//! listening addresses in the connection establishement instead of the [`RelayUrl`] which
    +76//! listening addresses in the connection establishment instead of the [`RelayUrl`] which
     77//! is used to identify a Relay server.  Of course it is also possible to use both a
     78//! [`RelayUrl`] and direct addresses at the same time to connect.
     79//!
    diff --git a/pr/4036/docs/src/iroh/net_report/report.rs.html b/pr/4036/docs/src/iroh/net_report/report.rs.html
    index 5d18db102b..1304110ba4 100644
    --- a/pr/4036/docs/src/iroh/net_report/report.rs.html
    +++ b/pr/4036/docs/src/iroh/net_report/report.rs.html
    @@ -22,194 +22,193 @@
     22    pub mapping_varies_by_dest_ipv4: Option<bool>,
     23    /// Whether the reported public address differs when probing different servers (on IPv6).
     24    pub mapping_varies_by_dest_ipv6: Option<bool>,
    -25    /// Probe indicating the presence of port mapping protocols on the LAN.
    -26    /// `None` for unknown
    -27    pub preferred_relay: Option<RelayUrl>,
    -28    /// keyed by relay Url
    -29    pub relay_latency: RelayLatencies,
    -30    /// ip:port of global IPv4
    -31    pub global_v4: Option<SocketAddrV4>,
    -32    /// `[ip]:port` of global IPv6
    -33    pub global_v6: Option<SocketAddrV6>,
    -34    /// CaptivePortal is set when we think there's a captive portal that is
    -35    /// intercepting HTTP traffic.
    -36    pub captive_portal: Option<bool>,
    -37}
    -38
    -39impl fmt::Display for Report {
    -40    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    -41        fmt::Debug::fmt(&self, f)
    -42    }
    -43}
    -44
    -45impl Report {
    -46    /// Do we have any indication that UDP is working?
    -47    pub fn has_udp(&self) -> bool {
    -48        self.udp_v4 || self.udp_v6
    -49    }
    -50
    -51    /// Whether the reported public address differs when probing different servers.
    -52    pub fn mapping_varies_by_dest(&self) -> Option<bool> {
    -53        match (
    -54            self.mapping_varies_by_dest_ipv4,
    -55            self.mapping_varies_by_dest_ipv6,
    -56        ) {
    -57            (Some(v4), Some(v6)) => Some(v4 || v6),
    -58            (None, Some(v6)) => Some(v6),
    -59            (Some(v4), None) => Some(v4),
    -60            (None, None) => None,
    -61        }
    -62    }
    -63
    -64    /// Updates a net_report [`Report`] with a new [`ProbeReport`].
    -65    pub(super) fn update(&mut self, report: &ProbeReport) {
    -66        match report {
    -67            ProbeReport::Https(report) => {
    -68                self.relay_latency
    -69                    .update_relay(report.relay.clone(), report.latency, Probe::Https);
    -70            }
    -71            #[cfg(not(wasm_browser))]
    -72            ProbeReport::QadIpv4(report) => {
    -73                self.relay_latency.update_relay(
    -74                    report.relay.clone(),
    -75                    report.latency,
    -76                    Probe::QadIpv4,
    -77                );
    -78                let SocketAddr::V4(ipp) = report.addr else {
    -79                    warn!("received IPv6 address from IPv4 QAD: {}", report.addr);
    -80                    return;
    -81                };
    -82
    -83                self.udp_v4 = true;
    -84
    -85                if let Some(global) = self.global_v4 {
    -86                    if global == ipp {
    -87                        if self.mapping_varies_by_dest_ipv4.is_none() {
    -88                            self.mapping_varies_by_dest_ipv4 = Some(false);
    -89                        }
    -90                    } else {
    -91                        self.mapping_varies_by_dest_ipv4 = Some(true);
    -92                        warn!("IPv4 address detected by QAD varies by destination");
    -93                    }
    -94                } else {
    -95                    self.global_v4 = Some(ipp);
    -96                }
    -97                trace!(?self.global_v4, ?self.mapping_varies_by_dest_ipv4, %ipp, "stored report");
    -98            }
    -99            #[cfg(not(wasm_browser))]
    -100            ProbeReport::QadIpv6(report) => {
    -101                self.relay_latency.update_relay(
    -102                    report.relay.clone(),
    -103                    report.latency,
    -104                    Probe::QadIpv6,
    -105                );
    -106                let SocketAddr::V6(ipp) = report.addr else {
    -107                    warn!("received IPv4 address from IPv6 QAD: {}", report.addr);
    -108                    return;
    -109                };
    -110
    -111                self.udp_v6 = true;
    -112                if let Some(global) = self.global_v6 {
    -113                    if global == ipp {
    -114                        if self.mapping_varies_by_dest_ipv6.is_none() {
    -115                            self.mapping_varies_by_dest_ipv6 = Some(false);
    -116                        }
    -117                    } else {
    -118                        self.mapping_varies_by_dest_ipv6 = Some(true);
    -119                        warn!("IPv6 address detected by QAD varies by destination");
    -120                    }
    -121                } else {
    -122                    self.global_v6 = Some(ipp);
    -123                }
    -124                trace!(?self.global_v6, ?self.mapping_varies_by_dest_ipv6, %ipp, "stored report");
    -125            }
    -126        }
    -127    }
    -128}
    -129
    -130/// Latencies per relay endpoint.
    -131#[derive(Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize)]
    -132pub struct RelayLatencies {
    -133    #[cfg(not(wasm_browser))]
    -134    ipv4: BTreeMap<RelayUrl, Duration>,
    -135    #[cfg(not(wasm_browser))]
    -136    ipv6: BTreeMap<RelayUrl, Duration>,
    -137    https: BTreeMap<RelayUrl, Duration>,
    -138}
    -139
    -140impl RelayLatencies {
    -141    /// Updates a relay's latency, if it is faster than before.
    -142    pub(super) fn update_relay(&mut self, url: RelayUrl, latency: Duration, probe: Probe) {
    -143        let list = match probe {
    -144            Probe::Https => &mut self.https,
    -145            #[cfg(not(wasm_browser))]
    -146            Probe::QadIpv4 => &mut self.ipv4,
    -147            #[cfg(not(wasm_browser))]
    -148            Probe::QadIpv6 => &mut self.ipv6,
    -149        };
    -150        let old_latency = list.entry(url).or_insert(latency);
    -151        if latency < *old_latency {
    -152            *old_latency = latency;
    -153        }
    -154    }
    -155
    -156    /// Merges another [`RelayLatencies`] into this one.
    -157    ///
    -158    /// For each relay the latency is updated using [`RelayLatencies::update_relay`].
    -159    pub(super) fn merge(&mut self, other: &RelayLatencies) {
    -160        for (url, latency) in other.https.iter() {
    -161            self.update_relay(url.clone(), *latency, Probe::Https);
    -162        }
    -163        #[cfg(not(wasm_browser))]
    -164        for (url, latency) in other.ipv4.iter() {
    -165            self.update_relay(url.clone(), *latency, Probe::QadIpv4);
    -166        }
    -167        #[cfg(not(wasm_browser))]
    -168        for (url, latency) in other.ipv6.iter() {
    -169            self.update_relay(url.clone(), *latency, Probe::QadIpv6);
    -170        }
    -171    }
    -172
    -173    /// Returns an iterator over all the relays and their latencies.
    -174    #[cfg(not(wasm_browser))]
    -175    pub fn iter(&self) -> impl Iterator<Item = (Probe, &'_ RelayUrl, Duration)> + '_ {
    -176        self.https
    -177            .iter()
    -178            .map(|(url, l)| (Probe::Https, url, *l))
    -179            .chain(self.ipv4.iter().map(|(url, l)| (Probe::QadIpv4, url, *l)))
    -180            .chain(self.ipv6.iter().map(|(url, l)| (Probe::QadIpv6, url, *l)))
    -181    }
    -182
    -183    /// Returns an iterator over all the relays and their latencies.
    -184    #[cfg(wasm_browser)]
    -185    pub fn iter(&self) -> impl Iterator<Item = (Probe, &'_ RelayUrl, Duration)> + '_ {
    -186        self.https.iter().map(|(k, v)| (Probe::Https, k, *v))
    -187    }
    -188
    -189    #[cfg(not(wasm_browser))]
    -190    pub(super) fn is_empty(&self) -> bool {
    -191        self.https.is_empty() && self.ipv4.is_empty() && self.ipv6.is_empty()
    -192    }
    -193
    -194    #[cfg(wasm_browser)]
    -195    pub(super) fn is_empty(&self) -> bool {
    -196        self.https.is_empty()
    -197    }
    -198
    -199    /// Returns the lowest latency across records.
    -200    pub(super) fn get(&self, url: &RelayUrl) -> Option<Duration> {
    -201        let mut list = Vec::with_capacity(3);
    -202        if let Some(val) = self.https.get(url) {
    -203            list.push(*val);
    -204        }
    -205        #[cfg(not(wasm_browser))]
    -206        if let Some(val) = self.ipv4.get(url) {
    -207            list.push(*val);
    -208        }
    -209        #[cfg(not(wasm_browser))]
    -210        if let Some(val) = self.ipv6.get(url) {
    -211            list.push(*val);
    -212        }
    -213        list.into_iter().min()
    -214    }
    -215}
    \ No newline at end of file +25 /// The relay server with the lowest latency, if any. +26 pub preferred_relay: Option<RelayUrl>, +27 /// The measured latency to each relay, keyed by relay URL. +28 pub relay_latency: RelayLatencies, +29 /// The discovered global IPv4 address and port, if any. +30 pub global_v4: Option<SocketAddrV4>, +31 /// The discovered global IPv6 address and port, if any. +32 pub global_v6: Option<SocketAddrV6>, +33 /// CaptivePortal is set when we think there's a captive portal that is +34 /// intercepting HTTP traffic. +35 pub captive_portal: Option<bool>, +36} +37 +38impl fmt::Display for Report { +39 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { +40 fmt::Debug::fmt(&self, f) +41 } +42} +43 +44impl Report { +45 /// Do we have any indication that UDP is working? +46 pub fn has_udp(&self) -> bool { +47 self.udp_v4 || self.udp_v6 +48 } +49 +50 /// Whether the reported public address differs when probing different servers. +51 pub fn mapping_varies_by_dest(&self) -> Option<bool> { +52 match ( +53 self.mapping_varies_by_dest_ipv4, +54 self.mapping_varies_by_dest_ipv6, +55 ) { +56 (Some(v4), Some(v6)) => Some(v4 || v6), +57 (None, Some(v6)) => Some(v6), +58 (Some(v4), None) => Some(v4), +59 (None, None) => None, +60 } +61 } +62 +63 /// Updates a net_report [`Report`] with a new [`ProbeReport`]. +64 pub(super) fn update(&mut self, report: &ProbeReport) { +65 match report { +66 ProbeReport::Https(report) => { +67 self.relay_latency +68 .update_relay(report.relay.clone(), report.latency, Probe::Https); +69 } +70 #[cfg(not(wasm_browser))] +71 ProbeReport::QadIpv4(report) => { +72 self.relay_latency.update_relay( +73 report.relay.clone(), +74 report.latency, +75 Probe::QadIpv4, +76 ); +77 let SocketAddr::V4(ipp) = report.addr else { +78 warn!("received IPv6 address from IPv4 QAD: {}", report.addr); +79 return; +80 }; +81 +82 self.udp_v4 = true; +83 +84 if let Some(global) = self.global_v4 { +85 if global == ipp { +86 if self.mapping_varies_by_dest_ipv4.is_none() { +87 self.mapping_varies_by_dest_ipv4 = Some(false); +88 } +89 } else { +90 self.mapping_varies_by_dest_ipv4 = Some(true); +91 warn!("IPv4 address detected by QAD varies by destination"); +92 } +93 } else { +94 self.global_v4 = Some(ipp); +95 } +96 trace!(?self.global_v4, ?self.mapping_varies_by_dest_ipv4, %ipp, "stored report"); +97 } +98 #[cfg(not(wasm_browser))] +99 ProbeReport::QadIpv6(report) => { +100 self.relay_latency.update_relay( +101 report.relay.clone(), +102 report.latency, +103 Probe::QadIpv6, +104 ); +105 let SocketAddr::V6(ipp) = report.addr else { +106 warn!("received IPv4 address from IPv6 QAD: {}", report.addr); +107 return; +108 }; +109 +110 self.udp_v6 = true; +111 if let Some(global) = self.global_v6 { +112 if global == ipp { +113 if self.mapping_varies_by_dest_ipv6.is_none() { +114 self.mapping_varies_by_dest_ipv6 = Some(false); +115 } +116 } else { +117 self.mapping_varies_by_dest_ipv6 = Some(true); +118 warn!("IPv6 address detected by QAD varies by destination"); +119 } +120 } else { +121 self.global_v6 = Some(ipp); +122 } +123 trace!(?self.global_v6, ?self.mapping_varies_by_dest_ipv6, %ipp, "stored report"); +124 } +125 } +126 } +127} +128 +129/// Latencies per relay endpoint. +130#[derive(Debug, Default, PartialEq, Eq, Clone, Serialize, Deserialize)] +131pub struct RelayLatencies { +132 #[cfg(not(wasm_browser))] +133 ipv4: BTreeMap<RelayUrl, Duration>, +134 #[cfg(not(wasm_browser))] +135 ipv6: BTreeMap<RelayUrl, Duration>, +136 https: BTreeMap<RelayUrl, Duration>, +137} +138 +139impl RelayLatencies { +140 /// Updates a relay's latency, if it is faster than before. +141 pub(super) fn update_relay(&mut self, url: RelayUrl, latency: Duration, probe: Probe) { +142 let list = match probe { +143 Probe::Https => &mut self.https, +144 #[cfg(not(wasm_browser))] +145 Probe::QadIpv4 => &mut self.ipv4, +146 #[cfg(not(wasm_browser))] +147 Probe::QadIpv6 => &mut self.ipv6, +148 }; +149 let old_latency = list.entry(url).or_insert(latency); +150 if latency < *old_latency { +151 *old_latency = latency; +152 } +153 } +154 +155 /// Merges another [`RelayLatencies`] into this one. +156 /// +157 /// For each relay the latency is updated using [`RelayLatencies::update_relay`]. +158 pub(super) fn merge(&mut self, other: &RelayLatencies) { +159 for (url, latency) in other.https.iter() { +160 self.update_relay(url.clone(), *latency, Probe::Https); +161 } +162 #[cfg(not(wasm_browser))] +163 for (url, latency) in other.ipv4.iter() { +164 self.update_relay(url.clone(), *latency, Probe::QadIpv4); +165 } +166 #[cfg(not(wasm_browser))] +167 for (url, latency) in other.ipv6.iter() { +168 self.update_relay(url.clone(), *latency, Probe::QadIpv6); +169 } +170 } +171 +172 /// Returns an iterator over all the relays and their latencies. +173 #[cfg(not(wasm_browser))] +174 pub fn iter(&self) -> impl Iterator<Item = (Probe, &'_ RelayUrl, Duration)> + '_ { +175 self.https +176 .iter() +177 .map(|(url, l)| (Probe::Https, url, *l)) +178 .chain(self.ipv4.iter().map(|(url, l)| (Probe::QadIpv4, url, *l))) +179 .chain(self.ipv6.iter().map(|(url, l)| (Probe::QadIpv6, url, *l))) +180 } +181 +182 /// Returns an iterator over all the relays and their latencies. +183 #[cfg(wasm_browser)] +184 pub fn iter(&self) -> impl Iterator<Item = (Probe, &'_ RelayUrl, Duration)> + '_ { +185 self.https.iter().map(|(k, v)| (Probe::Https, k, *v)) +186 } +187 +188 #[cfg(not(wasm_browser))] +189 pub(super) fn is_empty(&self) -> bool { +190 self.https.is_empty() && self.ipv4.is_empty() && self.ipv6.is_empty() +191 } +192 +193 #[cfg(wasm_browser)] +194 pub(super) fn is_empty(&self) -> bool { +195 self.https.is_empty() +196 } +197 +198 /// Returns the lowest latency across records. +199 pub(super) fn get(&self, url: &RelayUrl) -> Option<Duration> { +200 let mut list = Vec::with_capacity(3); +201 if let Some(val) = self.https.get(url) { +202 list.push(*val); +203 } +204 #[cfg(not(wasm_browser))] +205 if let Some(val) = self.ipv4.get(url) { +206 list.push(*val); +207 } +208 #[cfg(not(wasm_browser))] +209 if let Some(val) = self.ipv6.get(url) { +210 list.push(*val); +211 } +212 list.into_iter().min() +213 } +214} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh/protocol.rs.html b/pr/4036/docs/src/iroh/protocol.rs.html index cf30ab927c..d5f1c6e18a 100644 --- a/pr/4036/docs/src/iroh/protocol.rs.html +++ b/pr/4036/docs/src/iroh/protocol.rs.html @@ -174,7 +174,7 @@ 174 /// 175 /// What this does depends on the connection type: 176 /// -177 /// - **Direct (UDP) connections** : this is QUIC source address +177 /// - **Direct (UDP) connections**: this is QUIC source address 178 /// validation. If the socket address was spoofed, the retry token is 179 /// sent to the spoofed address, so we never hear from the attacker 180 /// again. If the address was real, the client repeats the connection @@ -182,7 +182,7 @@ 182 /// [`Incoming::remote_addr_validated`] set to `true`. The token is 183 /// bound to the source address. 184 /// -185 /// - **Relay connections** : there is no source address to validate +185 /// - **Relay connections**: there is no source address to validate 186 /// (the relay already vouches for the packet origin), so the 187 /// "validation" itself has no security meaning. However, the retry 188 /// still imposes a real cost on the client: an extra round trip @@ -491,7 +491,7 @@ 491 self 492 } 493 -494 /// Returns the [`Endpoint`] of the endpoint. +494 /// Returns the [`Endpoint`] stored in this builder. 495 pub fn endpoint(&self) -> &Endpoint { 496 &self.endpoint 497 } diff --git a/pr/4036/docs/src/iroh/socket/metrics.rs.html b/pr/4036/docs/src/iroh/socket/metrics.rs.html index 09bc7c836d..44892fc45c 100644 --- a/pr/4036/docs/src/iroh/socket/metrics.rs.html +++ b/pr/4036/docs/src/iroh/socket/metrics.rs.html @@ -1,89 +1,105 @@ -metrics.rs - source

    iroh/socket/
    metrics.rs

    1use iroh_metrics::{Counter, MetricsGroup};
    +metrics.rs - source

    iroh/socket/
    metrics.rs

    1use iroh_metrics::{Counter, MetricsGroup};
     2use serde::{Deserialize, Serialize};
     3
    -4/// Enum of metrics for the module
    -5// TODO(frando): Add description doc strings for each metric.
    -6#[allow(missing_docs)]
    -7#[derive(Debug, Serialize, Deserialize, MetricsGroup)]
    -8#[non_exhaustive]
    -9#[metrics(name = "socket", default)]
    -10pub struct Metrics {
    -11    pub update_direct_addrs: Counter,
    +4/// Metrics collected by the iroh socket.
    +5#[derive(Debug, Serialize, Deserialize, MetricsGroup)]
    +6#[non_exhaustive]
    +7#[metrics(name = "socket", default)]
    +8pub struct Metrics {
    +9    /// Intended to count updates to the local direct address set, but currently unused
    +10    /// (never incremented).
    +11    pub update_direct_addrs: Counter,
     12
    -13    // Sends (data or disco)
    +13    /// Number of bytes sent over IPv4.
     14    pub send_ipv4: Counter,
    -15    pub send_ipv6: Counter,
    -16    pub send_relay: Counter,
    -17
    -18    // Data packets (non-disco)
    -19    pub recv_data_relay: Counter,
    -20    // Number of bytes received on any custom transport.
    -21    pub recv_data_custom: Counter,
    -22    pub recv_data_ipv4: Counter,
    -23    pub recv_data_ipv6: Counter,
    -24    /// Number of QUIC datagrams received.
    -25    pub recv_datagrams: Counter,
    -26    /// Number of datagrams received using GRO
    -27    pub recv_gro_datagrams: Counter,
    -28
    -29    // How many times our relay home endpoint DI has changed from non-zero to a different non-zero.
    -30    pub relay_home_change: Counter,
    -31
    -32    /*
    -33     * Holepunching metrics
    -34     */
    -35    /// The number of times holepunching is initiated on a connection.
    -36    ///
    -37    /// This can be incremented multiple times for a single connection. Note that only the
    -38    /// client-side of a connection will increment this counter.
    -39    pub holepunch_attempts: Counter,
    -40    /// The number of network paths to peers that are direct.
    -41    ///
    -42    /// This can be incremented multiple times for a single connection.
    -43    pub paths_direct: Counter,
    -44    /// The number of network paths to peers that are relayed.
    +15    /// Number of bytes sent over IPv6.
    +16    pub send_ipv6: Counter,
    +17    /// Number of bytes sent over the relay transport.
    +18    pub send_relay: Counter,
    +19
    +20    /// Number of data bytes received over the relay transport.
    +21    pub recv_data_relay: Counter,
    +22    /// Number of data bytes received over any custom transport.
    +23    pub recv_data_custom: Counter,
    +24    /// Number of data bytes received over IPv4.
    +25    pub recv_data_ipv4: Counter,
    +26    /// Number of data bytes received over IPv6.
    +27    pub recv_data_ipv6: Counter,
    +28    /// Number of QUIC datagrams received.
    +29    pub recv_datagrams: Counter,
    +30    /// Number of receive events that used GRO (coalesced datagram batches).
    +31    ///
    +32    /// This counts batches, not the individual datagrams within them. See
    +33    /// [`Self::recv_datagrams`] for the datagram count.
    +34    pub recv_gro_datagrams: Counter,
    +35
    +36    /// Number of times the home relay changed to a different relay.
    +37    ///
    +38    /// This includes the initial assignment from no home relay to a home relay.
    +39    pub relay_home_change: Counter,
    +40
    +41    /*
    +42     * Holepunching metrics
    +43     */
    +44    /// The number of times holepunching is initiated on a connection.
     45    ///
    -46    /// This would typically only be incremented once for a single connection.
    -47    pub paths_relay: Counter,
    -48    /// The number of network paths to peers that are user defined.
    -49    ///
    -50    /// This would typically only be incremented once for a single connection.
    -51    pub paths_custom: Counter,
    -52    /// The number of connections that have been direct connections.
    -53    ///
    -54    /// This is only incremented once for each opened connection. See `num_conns_opened` for
    -55    /// the number of opened connections.
    -56    pub num_conns_direct: Counter,
    -57
    -58    /*
    -59     * Connection Metrics
    -60     *
    -61     * These all only count connections that completed the TLS handshake successfully. This means
    -62     * that short lived 0RTT connections are potentially not included in these counts.
    -63     */
    -64    /// Number of connections opened (only handshaked connections are counted).
    -65    pub num_conns_opened: Counter,
    -66    /// Number of connections closed (only handshaked connections are counted).
    -67    pub num_conns_closed: Counter,
    -68
    -69    /// Number of IP transport paths opened.
    -70    pub transport_ip_paths_added: Counter,
    -71    /// Number of IP transport paths closed.
    -72    pub transport_ip_paths_removed: Counter,
    -73    /// Number of relay transport paths opened.
    -74    pub transport_relay_paths_added: Counter,
    -75    /// Number of relay transport paths closed.
    -76    pub transport_relay_paths_removed: Counter,
    -77    /// Number of custom transport paths opened.
    -78    pub transport_custom_paths_added: Counter,
    -79    /// Number of custom transport paths closed.
    -80    pub transport_custom_paths_removed: Counter,
    -81
    -82    pub actor_tick_main: Counter,
    -83    pub actor_tick_msg: Counter,
    -84    pub actor_tick_re_stun: Counter,
    -85    pub actor_tick_portmap_changed: Counter,
    -86    pub actor_tick_direct_addr_heartbeat: Counter,
    -87    pub actor_link_change: Counter,
    -88    pub actor_tick_other: Counter,
    -89}
    \ No newline at end of file +46 /// This can be incremented multiple times for a single connection. Note that only the +47 /// client-side of a connection will increment this counter. +48 pub holepunch_attempts: Counter, +49 /// The number of network paths to peers that are direct. +50 /// +51 /// This can be incremented multiple times for a single connection. +52 pub paths_direct: Counter, +53 /// The number of network paths to peers that are relayed. +54 /// +55 /// This would typically only be incremented once for a single connection. +56 pub paths_relay: Counter, +57 /// The number of network paths to peers that are user defined. +58 /// +59 /// This would typically only be incremented once for a single connection. +60 pub paths_custom: Counter, +61 /// The number of connections that have been direct connections. +62 /// +63 /// This is only incremented once for each opened connection. See `num_conns_opened` for +64 /// the number of opened connections. +65 pub num_conns_direct: Counter, +66 +67 /* +68 * Connection Metrics +69 * +70 * These all only count connections that completed the TLS handshake successfully. This means +71 * that short lived 0RTT connections are potentially not included in these counts. +72 */ +73 /// Number of connections opened (only handshaked connections are counted). +74 pub num_conns_opened: Counter, +75 /// Number of connections closed (only handshaked connections are counted). +76 pub num_conns_closed: Counter, +77 +78 /// Number of IP transport paths opened. +79 pub transport_ip_paths_added: Counter, +80 /// Number of IP transport paths closed. +81 pub transport_ip_paths_removed: Counter, +82 /// Number of relay transport paths opened. +83 pub transport_relay_paths_added: Counter, +84 /// Number of relay transport paths closed. +85 pub transport_relay_paths_removed: Counter, +86 /// Number of custom transport paths opened. +87 pub transport_custom_paths_added: Counter, +88 /// Number of custom transport paths closed. +89 pub transport_custom_paths_removed: Counter, +90 +91 /// Number of iterations of the main socket actor loop. +92 pub actor_tick_main: Counter, +93 /// Number of actor messages processed by the socket actor loop. +94 pub actor_tick_msg: Counter, +95 /// Number of periodic re-STUN timer ticks handled by the socket actor loop. +96 pub actor_tick_re_stun: Counter, +97 /// Number of port-mapping change events handled by the socket actor loop. +98 pub actor_tick_portmap_changed: Counter, +99 /// Intended to count direct address heartbeat ticks, but currently unused (never incremented). +100 pub actor_tick_direct_addr_heartbeat: Counter, +101 /// Number of local network interface (link) change events handled by the socket actor loop. +102 pub actor_link_change: Counter, +103 /// Number of times an input watcher or receiver closed in the socket actor loop. +104 pub actor_tick_other: Counter, +105}
    \ No newline at end of file diff --git a/pr/4036/docs/src/iroh/tls.rs.html b/pr/4036/docs/src/iroh/tls.rs.html index 8a41064c96..49b43138e9 100644 --- a/pr/4036/docs/src/iroh/tls.rs.html +++ b/pr/4036/docs/src/iroh/tls.rs.html @@ -1,6 +1,6 @@ tls.rs - source

    iroh/
    tls.rs

    1//! TLS configuration for iroh.
     2//!
    -3//! Currently there is one mechanisms available
    +3//! Currently there is one mechanism available:
     4//! - Raw Public Keys, using the TLS extension described in [RFC 7250]
     5//!
     6//! [RFC 7250]: https://datatracker.ietf.org/doc/html/rfc7250
    diff --git a/pr/4036/docs/src/iroh/tls/verifier.rs.html b/pr/4036/docs/src/iroh/tls/verifier.rs.html
    index 160ca21d13..75c712d1d0 100644
    --- a/pr/4036/docs/src/iroh/tls/verifier.rs.html
    +++ b/pr/4036/docs/src/iroh/tls/verifier.rs.html
    @@ -114,7 +114,7 @@
     114#[derive(Default, Debug)]
     115pub(super) struct ClientCertificateVerifier;
     116
    -117/// We requires either following of X.509 client certificate chains:
    +117/// We require one of the following client certificate configurations:
     118///
     119/// - a valid raw public key configuration
     120impl ClientCertVerifier for ClientCertificateVerifier {
    diff --git a/pr/4036/docs/src/iroh_base/endpoint_addr.rs.html b/pr/4036/docs/src/iroh_base/endpoint_addr.rs.html
    index cbe46cd596..d53dd2ab38 100644
    --- a/pr/4036/docs/src/iroh_base/endpoint_addr.rs.html
    +++ b/pr/4036/docs/src/iroh_base/endpoint_addr.rs.html
    @@ -20,7 +20,7 @@
     20/// contact the endpoint.
     21///
     22/// To establish a network connection to an endpoint both the [`EndpointId`] and one or more network
    -23/// paths are needed.  The network paths can come from various sources, current sources can come from
    +23/// paths are needed.  The network paths can come from various sources:
     24///
     25/// - An [Address Lookup] service which can provide routing information for a given [`EndpointId`].
     26///
    @@ -42,7 +42,7 @@
     42pub struct EndpointAddr {
     43    /// The endpoint's identifier.
     44    pub id: EndpointId,
    -45    /// The endpoint's addresses
    +45    /// The endpoint's addresses.
     46    pub addrs: BTreeSet<TransportAddr>,
     47}
     48
    @@ -52,10 +52,10 @@
     52)]
     53#[non_exhaustive]
     54pub enum TransportAddr {
    -55    /// Relays
    +55    /// A relay server address.
     56    #[debug("Relay({_0})")]
     57    Relay(RelayUrl),
    -58    /// IP based addresses
    +58    /// An IP based address.
     59    Ip(SocketAddr),
     60    /// Custom transport address
     61    Custom(CustomAddr),
    @@ -128,12 +128,12 @@
     128        self
     129    }
     130
    -131    /// Returns true, if only a [`EndpointId`] is present.
    +131    /// Returns true if only an [`EndpointId`] is present.
     132    pub fn is_empty(&self) -> bool {
     133        self.addrs.is_empty()
     134    }
     135
    -136    /// Returns a list of IP addresses of this peer.
    +136    /// Returns an iterator over the IP addresses of this endpoint address.
     137    pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr> {
     138        self.addrs.iter().filter_map(|addr| match addr {
     139            TransportAddr::Ip(addr) => Some(addr),
    @@ -141,7 +141,7 @@
     141        })
     142    }
     143
    -144    /// Returns a list of relay urls of this peer.
    +144    /// Returns an iterator over the relay URLs of this endpoint address.
     145    ///
     146    ///  In practice this is expected to be zero or one home relay for all known cases currently.
     147    pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl> {
    diff --git a/pr/4036/docs/src/iroh_base/key.rs.html b/pr/4036/docs/src/iroh_base/key.rs.html
    index 1c7c6ccad6..20286c2f2b 100644
    --- a/pr/4036/docs/src/iroh_base/key.rs.html
    +++ b/pr/4036/docs/src/iroh_base/key.rs.html
    @@ -23,7 +23,7 @@
     23
     24/// A public key.
     25///
    -26/// The key itself is stored as the `CompressedEdwards` y coordinate of the public key
    +26/// The key itself is stored as the `CompressedEdwards` y-coordinate of the public key.
     27/// It is verified to decompress into a valid key when created.
     28#[derive(Clone, Copy, PartialEq, Eq)]
     29#[repr(transparent)]
    @@ -126,7 +126,7 @@
     126        Ok(Self(y))
     127    }
     128
    -129    /// Verify a signature on a message with this secret key's public key.
    +129    /// Verify a signature on a message with this public key.
     130    ///
     131    /// # Return
     132    ///
    @@ -224,7 +224,7 @@
     224    }
     225}
     226
    -227/// Error when deserialising a [`PublicKey`] or a [`SecretKey`].
    +227/// Error returned when parsing a [`PublicKey`] or a [`SecretKey`].
     228#[stack_error(derive, add_meta, from_sources, std_sources)]
     229#[allow(missing_docs)]
     230#[non_exhaustive]
    @@ -238,14 +238,14 @@
     238    /// The input has invalid length.
     239    #[error("invalid length")]
     240    InvalidLength,
    -241    /// The decoded data is not a valid Ed25591 public key.
    +241    /// The decoded data is not a valid Ed25519 public key.
     242    #[error("data is not a valid public key")]
     243    InvalidKeyData,
     244}
     245
    -246/// Deserialises the [`PublicKey`] from it's base32 encoding.
    +246/// Parses a [`PublicKey`] from its hex or base32 encoding.
     247///
    -248/// [`Display`] is capable of serialising this format.
    +248/// [`Display`] produces the hex encoding.
     249impl FromStr for PublicKey {
     250    type Err = KeyParsingError;
     251
    diff --git a/pr/4036/docs/src/iroh_dns/dns.rs.html b/pr/4036/docs/src/iroh_dns/dns.rs.html
    index 82f5c34601..afd8214bb2 100644
    --- a/pr/4036/docs/src/iroh_dns/dns.rs.html
    +++ b/pr/4036/docs/src/iroh_dns/dns.rs.html
    @@ -329,7 +329,7 @@
     329    ///
     330    /// We first try to read the system's resolver from `/etc/resolv.conf`.
     331    /// This does not work at least on some Androids, therefore we fallback
    -332    /// to the default `ResolverConfig` which uses eg. to google's `8.8.8.8` or `8.8.4.4`.
    +332    /// to the default `ResolverConfig` which uses e.g. Google's `8.8.8.8` or `8.8.4.4`.
     333    pub fn new() -> Self {
     334        Builder::default().with_system_defaults().build()
     335    }
    diff --git a/pr/4036/docs/src/iroh_dns/dns/resolver.rs.html b/pr/4036/docs/src/iroh_dns/dns/resolver.rs.html
    index 87f7c518a2..138104b503 100644
    --- a/pr/4036/docs/src/iroh_dns/dns/resolver.rs.html
    +++ b/pr/4036/docs/src/iroh_dns/dns/resolver.rs.html
    @@ -1,658 +1,660 @@
     resolver.rs - source

    iroh_dns/dns/
    resolver.rs

    1//! Built-in DNS resolver using `simple-dns` for packet construction/parsing
     2//! and tokio for transport.
     3
    -4use std::{
    -5    future::Future,
    -6    net::{Ipv4Addr, Ipv6Addr, SocketAddr},
    -7    sync::{Arc, Mutex},
    -8};
    -9
    -10use n0_error::{AnyError, e};
    -11use n0_future::{
    -12    FuturesUnorderedBounded, StreamExt,
    -13    boxed::BoxFuture,
    -14    time::{self, Duration},
    -15};
    -16use simple_dns::TYPE;
    -17use tracing::{debug, trace};
    -18
    -19use super::{
    -20    BoxIter, Builder, DnsError, DnsProtocol, TxtRecordData,
    -21    cache::{CachedRecord, DnsCache, QueryType},
    -22    query::{self, MAX_CNAME_DEPTH},
    -23    system_config, transport,
    -24};
    -25use crate::dns::Resolver;
    -26
    -27/// Per-nameserver timeout for a single attempt.
    -28const NAMESERVER_TIMEOUT: Duration = Duration::from_secs(2);
    -29
    -30/// Delay between launching queries to successive nameservers.
    -31/// Gives the preferred nameserver a head start before trying alternates.
    -32const NAMESERVER_STAGGER: Duration = Duration::from_millis(100);
    -33
    -34/// Number of UDP retry attempts per nameserver before giving up.
    -35/// UDP is unreliable, so a single dropped packet shouldn't be fatal.
    -36const UDP_ATTEMPTS: usize = 2;
    -37
    -38/// Default value for `ndots` per resolv.conf(5).
    -39///
    -40/// Names with at least this many dots are tried as absolute names first,
    -41/// before appending search domains. Names with fewer dots try search
    -42/// domains first. See <https://man7.org/linux/man-pages/man5/resolv.conf.5.html>.
    -43const DEFAULT_NDOTS: usize = 1;
    -44
    -45/// RFC 6761 Section 6.3: "localhost" and names under it resolve to loopback.
    -46fn is_localhost(host: &str) -> bool {
    -47    let host = host.strip_suffix('.').unwrap_or(host);
    -48    host.eq_ignore_ascii_case("localhost") || host.ends_with(".localhost")
    -49}
    -50
    -51#[derive(Debug)]
    -52pub(super) struct SimpleDnsResolver {
    -53    nameservers: Vec<(SocketAddr, DnsProtocol)>,
    -54    search_domains: Vec<String>,
    -55    ndots: usize,
    -56    #[cfg(with_crypto_provider)]
    -57    tls_config: Option<Arc<rustls::ClientConfig>>,
    -58    /// Lazily initialized, cached reqwest client for DNS-over-HTTPS queries.
    -59    #[cfg(with_crypto_provider)]
    -60    https_client: Mutex<Option<reqwest::Client>>,
    -61    cache: DnsCache,
    -62    builder: Builder,
    -63}
    -64
    -65impl SimpleDnsResolver {
    -66    pub(super) fn new(builder: Builder) -> Self {
    -67        let (nameservers, search_domains, ndots) = Self::build_config(&builder);
    -68        debug!(
    -69            ?nameservers,
    -70            ?search_domains,
    -71            ndots,
    -72            "configured DNS resolver"
    -73        );
    -74        #[cfg(with_crypto_provider)]
    -75        let tls_config = builder
    -76            .tls_client_config
    -77            .as_ref()
    -78            .map(|c| Arc::new(c.clone()));
    -79        Self {
    -80            nameservers,
    -81            search_domains,
    -82            ndots,
    -83            #[cfg(with_crypto_provider)]
    -84            tls_config,
    +4#[cfg(with_crypto_provider)]
    +5use std::sync::Mutex;
    +6use std::{
    +7    future::Future,
    +8    net::{Ipv4Addr, Ipv6Addr, SocketAddr},
    +9    sync::Arc,
    +10};
    +11
    +12use n0_error::{AnyError, e};
    +13use n0_future::{
    +14    FuturesUnorderedBounded, StreamExt,
    +15    boxed::BoxFuture,
    +16    time::{self, Duration},
    +17};
    +18use simple_dns::TYPE;
    +19use tracing::{debug, trace};
    +20
    +21use super::{
    +22    BoxIter, Builder, DnsError, DnsProtocol, TxtRecordData,
    +23    cache::{CachedRecord, DnsCache, QueryType},
    +24    query::{self, MAX_CNAME_DEPTH},
    +25    system_config, transport,
    +26};
    +27use crate::dns::Resolver;
    +28
    +29/// Per-nameserver timeout for a single attempt.
    +30const NAMESERVER_TIMEOUT: Duration = Duration::from_secs(2);
    +31
    +32/// Delay between launching queries to successive nameservers.
    +33/// Gives the preferred nameserver a head start before trying alternates.
    +34const NAMESERVER_STAGGER: Duration = Duration::from_millis(100);
    +35
    +36/// Number of UDP retry attempts per nameserver before giving up.
    +37/// UDP is unreliable, so a single dropped packet shouldn't be fatal.
    +38const UDP_ATTEMPTS: usize = 2;
    +39
    +40/// Default value for `ndots` per resolv.conf(5).
    +41///
    +42/// Names with at least this many dots are tried as absolute names first,
    +43/// before appending search domains. Names with fewer dots try search
    +44/// domains first. See <https://man7.org/linux/man-pages/man5/resolv.conf.5.html>.
    +45const DEFAULT_NDOTS: usize = 1;
    +46
    +47/// RFC 6761 Section 6.3: "localhost" and names under it resolve to loopback.
    +48fn is_localhost(host: &str) -> bool {
    +49    let host = host.strip_suffix('.').unwrap_or(host);
    +50    host.eq_ignore_ascii_case("localhost") || host.ends_with(".localhost")
    +51}
    +52
    +53#[derive(Debug)]
    +54pub(super) struct SimpleDnsResolver {
    +55    nameservers: Vec<(SocketAddr, DnsProtocol)>,
    +56    search_domains: Vec<String>,
    +57    ndots: usize,
    +58    #[cfg(with_crypto_provider)]
    +59    tls_config: Option<Arc<rustls::ClientConfig>>,
    +60    /// Lazily initialized, cached reqwest client for DNS-over-HTTPS queries.
    +61    #[cfg(with_crypto_provider)]
    +62    https_client: Mutex<Option<reqwest::Client>>,
    +63    cache: DnsCache,
    +64    builder: Builder,
    +65}
    +66
    +67impl SimpleDnsResolver {
    +68    pub(super) fn new(builder: Builder) -> Self {
    +69        let (nameservers, search_domains, ndots) = Self::build_config(&builder);
    +70        debug!(
    +71            ?nameservers,
    +72            ?search_domains,
    +73            ndots,
    +74            "configured DNS resolver"
    +75        );
    +76        #[cfg(with_crypto_provider)]
    +77        let tls_config = builder
    +78            .tls_client_config
    +79            .as_ref()
    +80            .map(|c| Arc::new(c.clone()));
    +81        Self {
    +82            nameservers,
    +83            search_domains,
    +84            ndots,
     85            #[cfg(with_crypto_provider)]
    -86            https_client: Mutex::new(None),
    -87            cache: DnsCache::new(),
    -88            builder,
    -89        }
    -90    }
    -91
    -92    fn build_config(builder: &Builder) -> (Vec<(SocketAddr, DnsProtocol)>, Vec<String>, usize) {
    -93        let mut nameservers = Vec::new();
    -94        let mut search_domains = Vec::new();
    -95        let mut ndots = None;
    -96
    -97        if builder.use_system_defaults {
    -98            let config = system_config::system_config();
    -99            nameservers.extend(config.nameservers);
    -100            search_domains = config.search_domains;
    -101            ndots = config.ndots;
    -102        }
    -103
    -104        nameservers.extend(builder.nameservers.iter().copied());
    +86            tls_config,
    +87            #[cfg(with_crypto_provider)]
    +88            https_client: Mutex::new(None),
    +89            cache: DnsCache::new(),
    +90            builder,
    +91        }
    +92    }
    +93
    +94    fn build_config(builder: &Builder) -> (Vec<(SocketAddr, DnsProtocol)>, Vec<String>, usize) {
    +95        let mut nameservers = Vec::new();
    +96        let mut search_domains = Vec::new();
    +97        let mut ndots = None;
    +98
    +99        if builder.use_system_defaults {
    +100            let config = system_config::system_config();
    +101            nameservers.extend(config.nameservers);
    +102            search_domains = config.search_domains;
    +103            ndots = config.ndots;
    +104        }
     105
    -106        if nameservers.is_empty() {
    -107            nameservers.extend(system_config::fallback_nameservers());
    -108        }
    -109
    -110        (nameservers, search_domains, ndots.unwrap_or(DEFAULT_NDOTS))
    -111    }
    -112
    -113    /// Returns the list of candidate names to try for a given hostname,
    -114    /// applying search domain expansion per resolv.conf(5) semantics.
    -115    ///
    -116    /// - If the name ends with `.` (FQDN), it is used as-is.
    -117    /// - If the name has more labels than `ndots`, try the bare name first,
    -118    ///   then each search domain suffix.
    -119    /// - Otherwise, try each search domain suffix first, then the bare name.
    -120    ///
    -121    /// See <https://man7.org/linux/man-pages/man5/resolv.conf.5.html>.
    -122    fn search_names(&self, host: &str) -> Vec<String> {
    -123        // Explicit FQDN: no search domain expansion.
    -124        if host.ends_with('.') || self.search_domains.is_empty() {
    -125            return vec![host.to_string()];
    -126        }
    -127
    -128        // Label count = dots + 1 (e.g. "foo.bar" has 2 labels).
    -129        // resolv.conf(5): "if the name has more dots than ndots, try as absolute first"
    -130        // which is equivalent to num_labels > ndots.
    -131        let num_labels = host.bytes().filter(|&b| b == b'.').count() + 1;
    -132        let bare_first = num_labels > self.ndots;
    -133
    -134        let mut names = Vec::with_capacity(self.search_domains.len() + 1);
    -135        let mut push = |name: String| {
    -136            if !names.contains(&name) {
    -137                names.push(name);
    -138            }
    -139        };
    -140
    -141        if bare_first {
    -142            push(host.to_string());
    -143        }
    -144        for domain in &self.search_domains {
    -145            push(format!("{host}.{domain}"));
    -146        }
    -147        if !bare_first {
    -148            push(host.to_string());
    -149        }
    -150
    -151        names
    -152    }
    -153
    -154    /// Returns a clone of the cached reqwest client, creating it on first use.
    -155    ///
    -156    /// `reqwest::Client` uses an inner `Arc`, so cloning is cheap.
    -157    #[cfg(with_crypto_provider)]
    -158    fn get_or_init_https_client(&self) -> Result<reqwest::Client, DnsError> {
    -159        let mut guard = self.https_client.lock().expect("poisoned");
    -160        match guard.as_ref() {
    -161            Some(client) => Ok(client.clone()),
    -162            None => {
    -163                let client = transport::build_https_client(self.tls_config.as_ref())?;
    -164                *guard = Some(client.clone());
    -165                Ok(client)
    -166            }
    -167        }
    -168    }
    -169
    -170    /// Run a future with [`NAMESERVER_TIMEOUT`].
    -171    async fn with_timeout<T, E: Into<AnyError>>(
    -172        fut: impl Future<Output = Result<T, E>>,
    -173    ) -> Result<T, DnsError> {
    -174        time::timeout(NAMESERVER_TIMEOUT, fut)
    -175            .await
    -176            .map(|r| r.map_err(|e| e!(DnsError::Resolve, e.into())))
    -177            .map_err(|_| e!(DnsError::Timeout))?
    -178    }
    -179
    -180    /// Query a single nameserver, with UDP retry and truncation fallback.
    -181    async fn query_nameserver(
    -182        &self,
    -183        addr: SocketAddr,
    -184        proto: DnsProtocol,
    -185        query_bytes: &[u8],
    -186    ) -> Result<Vec<u8>, DnsError> {
    -187        match proto {
    -188            DnsProtocol::Udp => {
    -189                let mut last_err = None;
    -190                for attempt in 0..UDP_ATTEMPTS {
    -191                    trace!(%addr, attempt, "sending UDP query");
    -192                    match Self::with_timeout(transport::udp_query(addr, query_bytes)).await {
    -193                        Ok(resp) if query::is_truncated(&resp) => {
    -194                            debug!(%addr, "UDP response truncated, retrying over TCP");
    -195                            return Self::with_timeout(transport::tcp_query(addr, query_bytes))
    -196                                .await;
    -197                        }
    -198                        Ok(resp) => return Ok(resp),
    -199                        Err(e) => {
    -200                            trace!(%addr, attempt, err = %e, "UDP query failed");
    -201                            last_err = Some(e);
    -202                        }
    -203                    }
    -204                }
    -205                Err(last_err.unwrap_or_else(|| e!(DnsError::NoResponse)))
    -206            }
    -207            DnsProtocol::Tcp => Self::with_timeout(transport::tcp_query(addr, query_bytes)).await,
    -208            #[cfg(with_crypto_provider)]
    -209            DnsProtocol::Tls => {
    -210                let tls_config = self.tls_config.as_ref().ok_or_else(|| {
    -211                    e!(DnsError::Resolve {
    -212                        source: std::io::Error::other("TLS config required for DNS-over-TLS")
    -213                            .into(),
    -214                    })
    -215                })?;
    -216                Self::with_timeout(transport::tls_query(addr, query_bytes, tls_config)).await
    -217            }
    -218            #[cfg(with_crypto_provider)]
    -219            DnsProtocol::Https => {
    -220                let client = self.get_or_init_https_client()?;
    -221                Self::with_timeout(transport::https_query(addr, query_bytes, &client)).await
    -222            }
    -223        }
    -224    }
    -225
    -226    /// Send a query to all nameservers in parallel with staggered starts.
    -227    ///
    -228    /// Each nameserver gets a staggered start delay to give the preferred
    -229    /// (first) nameserver a head start. The first successful response wins.
    -230    /// UDP queries are retried once per nameserver on failure.
    -231    async fn send_query(&self, query_bytes: &[u8]) -> Result<Vec<u8>, DnsError> {
    -232        if self.nameservers.is_empty() {
    -233            return Err(e!(DnsError::NoResponse));
    -234        }
    -235
    -236        let count = self.nameservers.len();
    -237        let mut futures = FuturesUnorderedBounded::new(count);
    -238
    -239        for (i, (addr, proto)) in self.nameservers.iter().copied().enumerate() {
    -240            let stagger = NAMESERVER_STAGGER * i as u32;
    -241            futures.push(async move {
    -242                if !stagger.is_zero() {
    -243                    time::sleep(stagger).await;
    -244                }
    -245                self.query_nameserver(addr, proto, query_bytes).await
    -246            });
    -247        }
    -248
    -249        let mut last_err = None;
    -250        while let Some(result) = futures.next().await {
    -251            match result {
    -252                Ok(resp) => return Ok(resp),
    -253                Err(e) => last_err = Some(e),
    -254            }
    -255        }
    -256        Err(last_err.unwrap_or_else(|| e!(DnsError::NoResponse)))
    -257    }
    -258
    -259    /// Send a query and follow CNAME chains recursively if the response contains
    -260    /// a CNAME but no records of the requested type.
    -261    async fn send_query_following_cnames(
    -262        &self,
    -263        host: String,
    -264        qtype: TYPE,
    -265    ) -> Result<(Vec<u8>, u16), DnsError> {
    -266        let mut current_host = host;
    -267        for _ in 0..MAX_CNAME_DEPTH {
    -268            let (id, query_bytes) = query::build_query(&current_host, qtype)?;
    -269            let response = self.send_query(&query_bytes).await?;
    -270            let packet = simple_dns::Packet::parse(&response)
    -271                .map_err(|err| e!(DnsError::Resolve, AnyError::from_std(err)))?;
    -272
    -273            let has_answer = packet
    -274                .answers
    -275                .iter()
    -276                .any(|rr| rr.rdata.type_code() == qtype);
    -277
    -278            if has_answer {
    -279                return Ok((response, id));
    -280            }
    -281
    -282            // No records of the requested type -- follow CNAME if present.
    -283            let Some(target) = query::cname_target(&packet, &current_host) else {
    -284                return Ok((response, id));
    -285            };
    -286            debug!(from = %current_host, to = %target, "following CNAME");
    -287            current_host = target;
    -288        }
    -289        Err(e!(DnsError::InvalidResponse))
    -290    }
    -291
    -292    /// Shared lookup logic: check cache, try search names, parse response, cache result.
    -293    #[allow(clippy::type_complexity)]
    -294    async fn lookup<T: Clone + std::fmt::Debug>(
    -295        &self,
    -296        host: &str,
    -297        qtype: QueryType,
    -298        dns_type: TYPE,
    -299        from_cache: fn(&CachedRecord) -> Option<Vec<T>>,
    -300        parse: fn(&[u8], u16) -> Result<(Vec<T>, u32), DnsError>,
    -301        to_cache: fn(Vec<T>) -> CachedRecord,
    -302    ) -> Result<Vec<T>, DnsError> {
    -303        if let Some(cached) = self.cache.get(host, qtype).and_then(|r| from_cache(&r)) {
    -304            trace!(%host, records = cached.len(), ?qtype, "cache hit");
    -305            return Ok(cached);
    -306        }
    -307
    -308        let mut last_err = None;
    -309        let names = self.search_names(host);
    -310        let total = names.len();
    -311        for (i, name) in names.into_iter().enumerate() {
    -312            trace!(%name, ?qtype, "resolving");
    -313            let res = match self
    -314                .send_query_following_cnames(name.clone(), dns_type)
    -315                .await
    -316            {
    -317                Ok((response, id)) => parse(&response, id),
    -318                Err(e) => Err(e),
    -319            };
    -320            match res {
    -321                Ok((results, ttl)) if !results.is_empty() => {
    -322                    debug!(%host, ?qtype, ?results, ttl, "resolved");
    -323                    self.cache
    -324                        .insert(host, qtype, to_cache(results.clone()), ttl);
    -325                    return Ok(results);
    -326                }
    -327                Ok(_) => {}
    -328                Err(ref e @ DnsError::NxDomain { .. })
    -329                | Err(ref e @ DnsError::ServerError { .. }) => {
    -330                    let remaining = total - i - 1;
    -331                    trace!(%name, ?qtype, remaining, reason = %e, "lookup failed");
    -332                    last_err = Some(e!(DnsError::NxDomain));
    -333                }
    -334                Err(e) => {
    -335                    debug!(%name, ?qtype, reason = %e, "lookup failed");
    -336                    return Err(e);
    -337                }
    -338            }
    -339        }
    -340        let err = last_err.unwrap_or_else(|| e!(DnsError::NoResponse));
    -341        debug!(%host, ?qtype, reason = %err, "resolve failed");
    -342        Err(err)
    -343    }
    -344
    -345    pub(super) async fn lookup_ipv4(
    -346        &self,
    -347        host: String,
    -348    ) -> Result<impl Iterator<Item = Ipv4Addr> + use<>, DnsError> {
    -349        // RFC 6761: localhost always resolves to loopback.
    -350        if is_localhost(&host) {
    -351            return Ok(vec![Ipv4Addr::LOCALHOST].into_iter());
    -352        }
    -353        let addrs = self
    -354            .lookup(
    -355                &host,
    -356                QueryType::A,
    -357                TYPE::A,
    -358                |r| match r {
    -359                    CachedRecord::A(v) => Some(v.clone()),
    -360                    _ => None,
    -361                },
    -362                query::parse_a_response,
    -363                CachedRecord::A,
    -364            )
    -365            .await?;
    -366        Ok(addrs.into_iter())
    -367    }
    -368
    -369    pub(super) async fn lookup_ipv6(
    -370        &self,
    -371        host: String,
    -372    ) -> Result<impl Iterator<Item = Ipv6Addr> + use<>, DnsError> {
    -373        // RFC 6761: localhost always resolves to loopback.
    -374        if is_localhost(&host) {
    -375            return Ok(vec![Ipv6Addr::LOCALHOST].into_iter());
    -376        }
    -377        let addrs = self
    -378            .lookup(
    -379                &host,
    -380                QueryType::AAAA,
    -381                TYPE::AAAA,
    -382                |r| match r {
    -383                    CachedRecord::Aaaa(v) => Some(v.clone()),
    -384                    _ => None,
    -385                },
    -386                query::parse_aaaa_response,
    -387                CachedRecord::Aaaa,
    -388            )
    -389            .await?;
    -390        Ok(addrs.into_iter())
    -391    }
    -392
    -393    pub(super) async fn lookup_txt(
    -394        &self,
    -395        host: String,
    -396    ) -> Result<impl Iterator<Item = TxtRecordData> + use<>, DnsError> {
    -397        let records = self
    -398            .lookup(
    -399                &host,
    -400                QueryType::TXT,
    -401                TYPE::TXT,
    -402                |r| match r {
    -403                    CachedRecord::Txt(v) => Some(v.clone()),
    -404                    _ => None,
    -405                },
    -406                query::parse_txt_response,
    -407                CachedRecord::Txt,
    -408            )
    -409            .await?;
    -410        Ok(records.into_iter())
    -411    }
    -412
    -413    pub(super) fn clear_cache(&self) {
    -414        self.cache.clear();
    -415    }
    -416
    -417    pub(super) fn reset(&self) -> Self {
    -418        Self::new(self.builder.clone())
    -419    }
    -420}
    -421
    -422impl Resolver for Arc<SimpleDnsResolver> {
    -423    fn lookup_ipv4(&self, host: String) -> BoxFuture<Result<BoxIter<Ipv4Addr>, DnsError>> {
    -424        let this = self.clone();
    -425        Box::pin(async move {
    -426            let iter = (*this).lookup_ipv4(host).await?;
    -427            let iter: BoxIter<_> = Box::new(iter);
    -428            Ok(iter)
    -429        })
    -430    }
    -431
    -432    fn lookup_ipv6(&self, host: String) -> BoxFuture<Result<BoxIter<Ipv6Addr>, DnsError>> {
    -433        let this = self.clone();
    -434        Box::pin(async move {
    -435            let iter = (*this).lookup_ipv6(host).await?;
    -436            let iter: BoxIter<_> = Box::new(iter);
    -437            Ok(iter)
    -438        })
    -439    }
    -440
    -441    fn lookup_txt(&self, host: String) -> BoxFuture<Result<BoxIter<TxtRecordData>, DnsError>> {
    -442        let this = self.clone();
    -443        Box::pin(async move {
    -444            let iter = (*this).lookup_txt(host).await?;
    -445            let iter: BoxIter<_> = Box::new(iter);
    -446            Ok(iter)
    -447        })
    -448    }
    -449
    -450    fn clear_cache(&self) {
    -451        SimpleDnsResolver::clear_cache(self);
    -452    }
    -453
    -454    fn reset(&self) -> Box<dyn Resolver> {
    -455        Box::new(Arc::new(SimpleDnsResolver::reset(self)))
    -456    }
    -457}
    -458
    -459#[cfg(test)]
    -460mod tests {
    -461    use std::net::{IpAddr, Ipv4Addr, SocketAddr};
    -462
    -463    use n0_future::time::Duration;
    +106        nameservers.extend(builder.nameservers.iter().copied());
    +107
    +108        if nameservers.is_empty() {
    +109            nameservers.extend(system_config::fallback_nameservers());
    +110        }
    +111
    +112        (nameservers, search_domains, ndots.unwrap_or(DEFAULT_NDOTS))
    +113    }
    +114
    +115    /// Returns the list of candidate names to try for a given hostname,
    +116    /// applying search domain expansion per resolv.conf(5) semantics.
    +117    ///
    +118    /// - If the name ends with `.` (FQDN), it is used as-is.
    +119    /// - If the name has more labels than `ndots`, try the bare name first,
    +120    ///   then each search domain suffix.
    +121    /// - Otherwise, try each search domain suffix first, then the bare name.
    +122    ///
    +123    /// See <https://man7.org/linux/man-pages/man5/resolv.conf.5.html>.
    +124    fn search_names(&self, host: &str) -> Vec<String> {
    +125        // Explicit FQDN: no search domain expansion.
    +126        if host.ends_with('.') || self.search_domains.is_empty() {
    +127            return vec![host.to_string()];
    +128        }
    +129
    +130        // Label count = dots + 1 (e.g. "foo.bar" has 2 labels).
    +131        // resolv.conf(5): "if the name has more dots than ndots, try as absolute first"
    +132        // which is equivalent to num_labels > ndots.
    +133        let num_labels = host.bytes().filter(|&b| b == b'.').count() + 1;
    +134        let bare_first = num_labels > self.ndots;
    +135
    +136        let mut names = Vec::with_capacity(self.search_domains.len() + 1);
    +137        let mut push = |name: String| {
    +138            if !names.contains(&name) {
    +139                names.push(name);
    +140            }
    +141        };
    +142
    +143        if bare_first {
    +144            push(host.to_string());
    +145        }
    +146        for domain in &self.search_domains {
    +147            push(format!("{host}.{domain}"));
    +148        }
    +149        if !bare_first {
    +150            push(host.to_string());
    +151        }
    +152
    +153        names
    +154    }
    +155
    +156    /// Returns a clone of the cached reqwest client, creating it on first use.
    +157    ///
    +158    /// `reqwest::Client` uses an inner `Arc`, so cloning is cheap.
    +159    #[cfg(with_crypto_provider)]
    +160    fn get_or_init_https_client(&self) -> Result<reqwest::Client, DnsError> {
    +161        let mut guard = self.https_client.lock().expect("poisoned");
    +162        match guard.as_ref() {
    +163            Some(client) => Ok(client.clone()),
    +164            None => {
    +165                let client = transport::build_https_client(self.tls_config.as_ref())?;
    +166                *guard = Some(client.clone());
    +167                Ok(client)
    +168            }
    +169        }
    +170    }
    +171
    +172    /// Run a future with [`NAMESERVER_TIMEOUT`].
    +173    async fn with_timeout<T, E: Into<AnyError>>(
    +174        fut: impl Future<Output = Result<T, E>>,
    +175    ) -> Result<T, DnsError> {
    +176        time::timeout(NAMESERVER_TIMEOUT, fut)
    +177            .await
    +178            .map(|r| r.map_err(|e| e!(DnsError::Resolve, e.into())))
    +179            .map_err(|_| e!(DnsError::Timeout))?
    +180    }
    +181
    +182    /// Query a single nameserver, with UDP retry and truncation fallback.
    +183    async fn query_nameserver(
    +184        &self,
    +185        addr: SocketAddr,
    +186        proto: DnsProtocol,
    +187        query_bytes: &[u8],
    +188    ) -> Result<Vec<u8>, DnsError> {
    +189        match proto {
    +190            DnsProtocol::Udp => {
    +191                let mut last_err = None;
    +192                for attempt in 0..UDP_ATTEMPTS {
    +193                    trace!(%addr, attempt, "sending UDP query");
    +194                    match Self::with_timeout(transport::udp_query(addr, query_bytes)).await {
    +195                        Ok(resp) if query::is_truncated(&resp) => {
    +196                            debug!(%addr, "UDP response truncated, retrying over TCP");
    +197                            return Self::with_timeout(transport::tcp_query(addr, query_bytes))
    +198                                .await;
    +199                        }
    +200                        Ok(resp) => return Ok(resp),
    +201                        Err(e) => {
    +202                            trace!(%addr, attempt, err = %e, "UDP query failed");
    +203                            last_err = Some(e);
    +204                        }
    +205                    }
    +206                }
    +207                Err(last_err.unwrap_or_else(|| e!(DnsError::NoResponse)))
    +208            }
    +209            DnsProtocol::Tcp => Self::with_timeout(transport::tcp_query(addr, query_bytes)).await,
    +210            #[cfg(with_crypto_provider)]
    +211            DnsProtocol::Tls => {
    +212                let tls_config = self.tls_config.as_ref().ok_or_else(|| {
    +213                    e!(DnsError::Resolve {
    +214                        source: std::io::Error::other("TLS config required for DNS-over-TLS")
    +215                            .into(),
    +216                    })
    +217                })?;
    +218                Self::with_timeout(transport::tls_query(addr, query_bytes, tls_config)).await
    +219            }
    +220            #[cfg(with_crypto_provider)]
    +221            DnsProtocol::Https => {
    +222                let client = self.get_or_init_https_client()?;
    +223                Self::with_timeout(transport::https_query(addr, query_bytes, &client)).await
    +224            }
    +225        }
    +226    }
    +227
    +228    /// Send a query to all nameservers in parallel with staggered starts.
    +229    ///
    +230    /// Each nameserver gets a staggered start delay to give the preferred
    +231    /// (first) nameserver a head start. The first successful response wins.
    +232    /// UDP queries are retried once per nameserver on failure.
    +233    async fn send_query(&self, query_bytes: &[u8]) -> Result<Vec<u8>, DnsError> {
    +234        if self.nameservers.is_empty() {
    +235            return Err(e!(DnsError::NoResponse));
    +236        }
    +237
    +238        let count = self.nameservers.len();
    +239        let mut futures = FuturesUnorderedBounded::new(count);
    +240
    +241        for (i, (addr, proto)) in self.nameservers.iter().copied().enumerate() {
    +242            let stagger = NAMESERVER_STAGGER * i as u32;
    +243            futures.push(async move {
    +244                if !stagger.is_zero() {
    +245                    time::sleep(stagger).await;
    +246                }
    +247                self.query_nameserver(addr, proto, query_bytes).await
    +248            });
    +249        }
    +250
    +251        let mut last_err = None;
    +252        while let Some(result) = futures.next().await {
    +253            match result {
    +254                Ok(resp) => return Ok(resp),
    +255                Err(e) => last_err = Some(e),
    +256            }
    +257        }
    +258        Err(last_err.unwrap_or_else(|| e!(DnsError::NoResponse)))
    +259    }
    +260
    +261    /// Send a query and follow CNAME chains recursively if the response contains
    +262    /// a CNAME but no records of the requested type.
    +263    async fn send_query_following_cnames(
    +264        &self,
    +265        host: String,
    +266        qtype: TYPE,
    +267    ) -> Result<(Vec<u8>, u16), DnsError> {
    +268        let mut current_host = host;
    +269        for _ in 0..MAX_CNAME_DEPTH {
    +270            let (id, query_bytes) = query::build_query(&current_host, qtype)?;
    +271            let response = self.send_query(&query_bytes).await?;
    +272            let packet = simple_dns::Packet::parse(&response)
    +273                .map_err(|err| e!(DnsError::Resolve, AnyError::from_std(err)))?;
    +274
    +275            let has_answer = packet
    +276                .answers
    +277                .iter()
    +278                .any(|rr| rr.rdata.type_code() == qtype);
    +279
    +280            if has_answer {
    +281                return Ok((response, id));
    +282            }
    +283
    +284            // No records of the requested type -- follow CNAME if present.
    +285            let Some(target) = query::cname_target(&packet, &current_host) else {
    +286                return Ok((response, id));
    +287            };
    +288            debug!(from = %current_host, to = %target, "following CNAME");
    +289            current_host = target;
    +290        }
    +291        Err(e!(DnsError::InvalidResponse))
    +292    }
    +293
    +294    /// Shared lookup logic: check cache, try search names, parse response, cache result.
    +295    #[allow(clippy::type_complexity)]
    +296    async fn lookup<T: Clone + std::fmt::Debug>(
    +297        &self,
    +298        host: &str,
    +299        qtype: QueryType,
    +300        dns_type: TYPE,
    +301        from_cache: fn(&CachedRecord) -> Option<Vec<T>>,
    +302        parse: fn(&[u8], u16) -> Result<(Vec<T>, u32), DnsError>,
    +303        to_cache: fn(Vec<T>) -> CachedRecord,
    +304    ) -> Result<Vec<T>, DnsError> {
    +305        if let Some(cached) = self.cache.get(host, qtype).and_then(|r| from_cache(&r)) {
    +306            trace!(%host, records = cached.len(), ?qtype, "cache hit");
    +307            return Ok(cached);
    +308        }
    +309
    +310        let mut last_err = None;
    +311        let names = self.search_names(host);
    +312        let total = names.len();
    +313        for (i, name) in names.into_iter().enumerate() {
    +314            trace!(%name, ?qtype, "resolving");
    +315            let res = match self
    +316                .send_query_following_cnames(name.clone(), dns_type)
    +317                .await
    +318            {
    +319                Ok((response, id)) => parse(&response, id),
    +320                Err(e) => Err(e),
    +321            };
    +322            match res {
    +323                Ok((results, ttl)) if !results.is_empty() => {
    +324                    debug!(%host, ?qtype, ?results, ttl, "resolved");
    +325                    self.cache
    +326                        .insert(host, qtype, to_cache(results.clone()), ttl);
    +327                    return Ok(results);
    +328                }
    +329                Ok(_) => {}
    +330                Err(ref e @ DnsError::NxDomain { .. })
    +331                | Err(ref e @ DnsError::ServerError { .. }) => {
    +332                    let remaining = total - i - 1;
    +333                    trace!(%name, ?qtype, remaining, reason = %e, "lookup failed");
    +334                    last_err = Some(e!(DnsError::NxDomain));
    +335                }
    +336                Err(e) => {
    +337                    debug!(%name, ?qtype, reason = %e, "lookup failed");
    +338                    return Err(e);
    +339                }
    +340            }
    +341        }
    +342        let err = last_err.unwrap_or_else(|| e!(DnsError::NoResponse));
    +343        debug!(%host, ?qtype, reason = %err, "resolve failed");
    +344        Err(err)
    +345    }
    +346
    +347    pub(super) async fn lookup_ipv4(
    +348        &self,
    +349        host: String,
    +350    ) -> Result<impl Iterator<Item = Ipv4Addr> + use<>, DnsError> {
    +351        // RFC 6761: localhost always resolves to loopback.
    +352        if is_localhost(&host) {
    +353            return Ok(vec![Ipv4Addr::LOCALHOST].into_iter());
    +354        }
    +355        let addrs = self
    +356            .lookup(
    +357                &host,
    +358                QueryType::A,
    +359                TYPE::A,
    +360                |r| match r {
    +361                    CachedRecord::A(v) => Some(v.clone()),
    +362                    _ => None,
    +363                },
    +364                query::parse_a_response,
    +365                CachedRecord::A,
    +366            )
    +367            .await?;
    +368        Ok(addrs.into_iter())
    +369    }
    +370
    +371    pub(super) async fn lookup_ipv6(
    +372        &self,
    +373        host: String,
    +374    ) -> Result<impl Iterator<Item = Ipv6Addr> + use<>, DnsError> {
    +375        // RFC 6761: localhost always resolves to loopback.
    +376        if is_localhost(&host) {
    +377            return Ok(vec![Ipv6Addr::LOCALHOST].into_iter());
    +378        }
    +379        let addrs = self
    +380            .lookup(
    +381                &host,
    +382                QueryType::AAAA,
    +383                TYPE::AAAA,
    +384                |r| match r {
    +385                    CachedRecord::Aaaa(v) => Some(v.clone()),
    +386                    _ => None,
    +387                },
    +388                query::parse_aaaa_response,
    +389                CachedRecord::Aaaa,
    +390            )
    +391            .await?;
    +392        Ok(addrs.into_iter())
    +393    }
    +394
    +395    pub(super) async fn lookup_txt(
    +396        &self,
    +397        host: String,
    +398    ) -> Result<impl Iterator<Item = TxtRecordData> + use<>, DnsError> {
    +399        let records = self
    +400            .lookup(
    +401                &host,
    +402                QueryType::TXT,
    +403                TYPE::TXT,
    +404                |r| match r {
    +405                    CachedRecord::Txt(v) => Some(v.clone()),
    +406                    _ => None,
    +407                },
    +408                query::parse_txt_response,
    +409                CachedRecord::Txt,
    +410            )
    +411            .await?;
    +412        Ok(records.into_iter())
    +413    }
    +414
    +415    pub(super) fn clear_cache(&self) {
    +416        self.cache.clear();
    +417    }
    +418
    +419    pub(super) fn reset(&self) -> Self {
    +420        Self::new(self.builder.clone())
    +421    }
    +422}
    +423
    +424impl Resolver for Arc<SimpleDnsResolver> {
    +425    fn lookup_ipv4(&self, host: String) -> BoxFuture<Result<BoxIter<Ipv4Addr>, DnsError>> {
    +426        let this = self.clone();
    +427        Box::pin(async move {
    +428            let iter = (*this).lookup_ipv4(host).await?;
    +429            let iter: BoxIter<_> = Box::new(iter);
    +430            Ok(iter)
    +431        })
    +432    }
    +433
    +434    fn lookup_ipv6(&self, host: String) -> BoxFuture<Result<BoxIter<Ipv6Addr>, DnsError>> {
    +435        let this = self.clone();
    +436        Box::pin(async move {
    +437            let iter = (*this).lookup_ipv6(host).await?;
    +438            let iter: BoxIter<_> = Box::new(iter);
    +439            Ok(iter)
    +440        })
    +441    }
    +442
    +443    fn lookup_txt(&self, host: String) -> BoxFuture<Result<BoxIter<TxtRecordData>, DnsError>> {
    +444        let this = self.clone();
    +445        Box::pin(async move {
    +446            let iter = (*this).lookup_txt(host).await?;
    +447            let iter: BoxIter<_> = Box::new(iter);
    +448            Ok(iter)
    +449        })
    +450    }
    +451
    +452    fn clear_cache(&self) {
    +453        SimpleDnsResolver::clear_cache(self);
    +454    }
    +455
    +456    fn reset(&self) -> Box<dyn Resolver> {
    +457        Box::new(Arc::new(SimpleDnsResolver::reset(self)))
    +458    }
    +459}
    +460
    +461#[cfg(test)]
    +462mod tests {
    +463    use std::net::{IpAddr, Ipv4Addr, SocketAddr};
     464
    -465    use super::super::{DnsProtocol, DnsResolver};
    +465    use n0_future::time::Duration;
     466
    -467    const TIMEOUT: Duration = Duration::from_secs(5);
    -468    const GOOGLE_DNS: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(8, 8, 8, 8)), 53);
    -469    const CLOUDFLARE_DNS: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(1, 1, 1, 1)), 53);
    -470    const GOOGLE_DNS_TLS: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(8, 8, 8, 8)), 853);
    -471    const CLOUDFLARE_DNS_HTTPS: SocketAddr =
    -472        SocketAddr::new(IpAddr::V4(Ipv4Addr::new(1, 1, 1, 1)), 443);
    -473
    -474    fn with_proto(addr: SocketAddr, proto: DnsProtocol) -> DnsResolver {
    -475        let mut builder = DnsResolver::builder().with_nameserver(addr, proto);
    -476        if proto == DnsProtocol::Tls {
    -477            let root_store =
    -478                rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
    -479            builder = builder.tls_client_config(
    -480                rustls::ClientConfig::builder()
    -481                    .with_root_certificates(root_store)
    -482                    .with_no_client_auth(),
    -483            );
    -484        }
    -485        builder.build()
    -486    }
    -487
    -488    async fn assert_resolves_ipv4(resolver: &DnsResolver, host: &str) {
    -489        let addrs: Vec<_> = resolver.lookup_ipv4(host, TIMEOUT).await.unwrap().collect();
    -490        assert!(!addrs.is_empty(), "{host} should have IPv4 addresses");
    -491    }
    -492
    -493    #[tokio::test]
    -494    #[ignore = "requires network access"]
    -495    async fn resolve_ipv4_udp() {
    -496        assert_resolves_ipv4(&with_proto(GOOGLE_DNS, DnsProtocol::Udp), "google.com").await;
    -497    }
    -498
    -499    #[tokio::test]
    -500    #[ignore = "requires network access"]
    -501    async fn resolve_ipv6_udp() {
    -502        let resolver = with_proto(GOOGLE_DNS, DnsProtocol::Udp);
    -503        let addrs: Vec<_> = resolver
    -504            .lookup_ipv6("google.com", TIMEOUT)
    -505            .await
    -506            .unwrap()
    -507            .collect();
    -508        assert!(!addrs.is_empty());
    -509    }
    -510
    -511    #[tokio::test]
    -512    #[ignore = "requires network access"]
    -513    async fn resolve_ipv4_tcp() {
    -514        assert_resolves_ipv4(&with_proto(CLOUDFLARE_DNS, DnsProtocol::Tcp), "google.com").await;
    -515    }
    -516
    -517    #[tokio::test]
    -518    #[ignore = "requires network access"]
    -519    async fn resolve_ipv4_tls() {
    -520        assert_resolves_ipv4(&with_proto(GOOGLE_DNS_TLS, DnsProtocol::Tls), "google.com").await;
    -521    }
    -522
    -523    #[tokio::test]
    -524    #[ignore = "requires network access"]
    -525    async fn resolve_ipv4_https() {
    -526        assert_resolves_ipv4(
    -527            &with_proto(CLOUDFLARE_DNS_HTTPS, DnsProtocol::Https),
    -528            "google.com",
    -529        )
    -530        .await;
    -531    }
    -532
    -533    #[tokio::test]
    -534    #[ignore = "requires network access"]
    -535    async fn resolve_txt_udp() {
    -536        let resolver = with_proto(GOOGLE_DNS, DnsProtocol::Udp);
    -537        let records: Vec<_> = resolver
    -538            .lookup_txt("google.com", TIMEOUT)
    -539            .await
    -540            .unwrap()
    -541            .collect();
    -542        assert!(!records.is_empty());
    -543    }
    -544
    -545    #[tokio::test]
    -546    #[ignore = "requires network access"]
    -547    async fn resolve_system_defaults() {
    -548        assert_resolves_ipv4(&DnsResolver::new(), "google.com").await;
    -549    }
    -550
    -551    #[tokio::test]
    -552    #[ignore = "requires network access"]
    -553    async fn resolve_multiple_sites() {
    -554        let resolver = DnsResolver::new();
    -555        for host in ["google.com", "cloudflare.com", "example.com"] {
    -556            assert_resolves_ipv4(&resolver, host).await;
    -557        }
    -558    }
    -559
    -560    /// Run with `cargo test -p iroh-relay resolve_success_and_nxdomain -- --ignored --nocapture`
    -561    /// and `RUST_LOG=iroh_relay::dns=trace` to see the log output.
    -562    #[tokio::test]
    -563    #[ignore = "requires network access"]
    -564    async fn resolve_success_and_nxdomain() {
    -565        let _ = tracing_subscriber::fmt::try_init();
    -566        let resolver = with_proto(GOOGLE_DNS, DnsProtocol::Udp);
    -567
    -568        tracing::info!("--- resolving example.com (first, expect network query) ---");
    -569        let addrs: Vec<_> = resolver
    -570            .lookup_ipv4("example.com", TIMEOUT)
    -571            .await
    -572            .unwrap()
    -573            .collect();
    -574        assert!(!addrs.is_empty());
    -575
    -576        tracing::info!("--- resolving example.com (second, expect cache hit) ---");
    -577        let addrs2: Vec<_> = resolver
    -578            .lookup_ipv4("example.com", TIMEOUT)
    -579            .await
    -580            .unwrap()
    -581            .collect();
    -582        assert_eq!(addrs, addrs2);
    -583
    -584        tracing::info!("--- resolving nonexistent domain (expect NXDOMAIN) ---");
    -585        let err = resolver
    -586            .lookup_ipv4("this-domain-does-not-exist.example.invalid", TIMEOUT)
    -587            .await
    -588            .map(|i| i.collect::<Vec<_>>());
    -589        assert!(err.is_err(), "expected NXDOMAIN, got {err:?}");
    -590    }
    -591
    -592    mod search_names {
    -593        use super::super::{super::Builder, *};
    -594
    -595        fn resolver_with_search(domains: &[&str]) -> SimpleDnsResolver {
    -596            let mut r = SimpleDnsResolver::new(Builder::default());
    -597            r.search_domains = domains.iter().map(|s| s.to_string()).collect();
    -598            r
    -599        }
    -600
    -601        #[test]
    -602        fn no_search_domains() {
    -603            let r = SimpleDnsResolver::new(Builder::default());
    -604            assert_eq!(r.search_names("myhost"), vec!["myhost"]);
    -605        }
    -606
    -607        #[test]
    -608        fn fqdn_bypasses_search() {
    -609            let r = resolver_with_search(&["example.com"]);
    -610            assert_eq!(
    -611                r.search_names("myhost.example.com."),
    -612                vec!["myhost.example.com."]
    -613            );
    -614        }
    -615
    -616        #[test]
    -617        fn short_name_tries_search_first() {
    -618            let r = resolver_with_search(&["example.com", "test.local"]);
    -619            // "myhost" has 0 dots (< ndots=1), so search domains come first.
    -620            assert_eq!(
    -621                r.search_names("myhost"),
    -622                vec!["myhost.example.com", "myhost.test.local", "myhost"]
    -623            );
    -624        }
    -625
    -626        #[test]
    -627        fn dotted_name_tries_bare_first() {
    -628            let r = resolver_with_search(&["example.com"]);
    -629            // "foo.bar" has 1 dot (>= ndots=1), so bare name comes first.
    -630            assert_eq!(
    -631                r.search_names("foo.bar"),
    -632                vec!["foo.bar", "foo.bar.example.com"]
    -633            );
    -634        }
    -635
    -636        #[test]
    -637        fn multi_dot_name_tries_bare_first() {
    -638            let r = resolver_with_search(&["example.com"]);
    -639            assert_eq!(r.search_names("a.b.c"), vec!["a.b.c", "a.b.c.example.com"]);
    -640        }
    -641
    -642        #[test]
    -643        fn high_ndots_k8s_style() {
    -644            let mut r = SimpleDnsResolver::new(Builder::default());
    -645            r.search_domains = vec!["ns.svc.cluster.local".into(), "svc.cluster.local".into()];
    -646            r.ndots = 5;
    -647            // 4 dots < ndots=5, so search domains come first (Kubernetes behavior).
    -648            assert_eq!(
    -649                r.search_names("my-svc.my-ns.svc.cluster.local"),
    -650                vec![
    -651                    "my-svc.my-ns.svc.cluster.local.ns.svc.cluster.local",
    -652                    "my-svc.my-ns.svc.cluster.local.svc.cluster.local",
    -653                    "my-svc.my-ns.svc.cluster.local",
    -654                ]
    -655            );
    -656        }
    -657    }
    -658}
    \ No newline at end of file +467 use super::super::{DnsProtocol, DnsResolver}; +468 +469 const TIMEOUT: Duration = Duration::from_secs(5); +470 const GOOGLE_DNS: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(8, 8, 8, 8)), 53); +471 const CLOUDFLARE_DNS: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(1, 1, 1, 1)), 53); +472 const GOOGLE_DNS_TLS: SocketAddr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(8, 8, 8, 8)), 853); +473 const CLOUDFLARE_DNS_HTTPS: SocketAddr = +474 SocketAddr::new(IpAddr::V4(Ipv4Addr::new(1, 1, 1, 1)), 443); +475 +476 fn with_proto(addr: SocketAddr, proto: DnsProtocol) -> DnsResolver { +477 let mut builder = DnsResolver::builder().with_nameserver(addr, proto); +478 if proto == DnsProtocol::Tls { +479 let root_store = +480 rustls::RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()); +481 builder = builder.tls_client_config( +482 rustls::ClientConfig::builder() +483 .with_root_certificates(root_store) +484 .with_no_client_auth(), +485 ); +486 } +487 builder.build() +488 } +489 +490 async fn assert_resolves_ipv4(resolver: &DnsResolver, host: &str) { +491 let addrs: Vec<_> = resolver.lookup_ipv4(host, TIMEOUT).await.unwrap().collect(); +492 assert!(!addrs.is_empty(), "{host} should have IPv4 addresses"); +493 } +494 +495 #[tokio::test] +496 #[ignore = "requires network access"] +497 async fn resolve_ipv4_udp() { +498 assert_resolves_ipv4(&with_proto(GOOGLE_DNS, DnsProtocol::Udp), "google.com").await; +499 } +500 +501 #[tokio::test] +502 #[ignore = "requires network access"] +503 async fn resolve_ipv6_udp() { +504 let resolver = with_proto(GOOGLE_DNS, DnsProtocol::Udp); +505 let addrs: Vec<_> = resolver +506 .lookup_ipv6("google.com", TIMEOUT) +507 .await +508 .unwrap() +509 .collect(); +510 assert!(!addrs.is_empty()); +511 } +512 +513 #[tokio::test] +514 #[ignore = "requires network access"] +515 async fn resolve_ipv4_tcp() { +516 assert_resolves_ipv4(&with_proto(CLOUDFLARE_DNS, DnsProtocol::Tcp), "google.com").await; +517 } +518 +519 #[tokio::test] +520 #[ignore = "requires network access"] +521 async fn resolve_ipv4_tls() { +522 assert_resolves_ipv4(&with_proto(GOOGLE_DNS_TLS, DnsProtocol::Tls), "google.com").await; +523 } +524 +525 #[tokio::test] +526 #[ignore = "requires network access"] +527 async fn resolve_ipv4_https() { +528 assert_resolves_ipv4( +529 &with_proto(CLOUDFLARE_DNS_HTTPS, DnsProtocol::Https), +530 "google.com", +531 ) +532 .await; +533 } +534 +535 #[tokio::test] +536 #[ignore = "requires network access"] +537 async fn resolve_txt_udp() { +538 let resolver = with_proto(GOOGLE_DNS, DnsProtocol::Udp); +539 let records: Vec<_> = resolver +540 .lookup_txt("google.com", TIMEOUT) +541 .await +542 .unwrap() +543 .collect(); +544 assert!(!records.is_empty()); +545 } +546 +547 #[tokio::test] +548 #[ignore = "requires network access"] +549 async fn resolve_system_defaults() { +550 assert_resolves_ipv4(&DnsResolver::new(), "google.com").await; +551 } +552 +553 #[tokio::test] +554 #[ignore = "requires network access"] +555 async fn resolve_multiple_sites() { +556 let resolver = DnsResolver::new(); +557 for host in ["google.com", "cloudflare.com", "example.com"] { +558 assert_resolves_ipv4(&resolver, host).await; +559 } +560 } +561 +562 /// Run with `cargo test -p iroh-relay resolve_success_and_nxdomain -- --ignored --nocapture` +563 /// and `RUST_LOG=iroh_relay::dns=trace` to see the log output. +564 #[tokio::test] +565 #[ignore = "requires network access"] +566 async fn resolve_success_and_nxdomain() { +567 let _ = tracing_subscriber::fmt::try_init(); +568 let resolver = with_proto(GOOGLE_DNS, DnsProtocol::Udp); +569 +570 tracing::info!("--- resolving example.com (first, expect network query) ---"); +571 let addrs: Vec<_> = resolver +572 .lookup_ipv4("example.com", TIMEOUT) +573 .await +574 .unwrap() +575 .collect(); +576 assert!(!addrs.is_empty()); +577 +578 tracing::info!("--- resolving example.com (second, expect cache hit) ---"); +579 let addrs2: Vec<_> = resolver +580 .lookup_ipv4("example.com", TIMEOUT) +581 .await +582 .unwrap() +583 .collect(); +584 assert_eq!(addrs, addrs2); +585 +586 tracing::info!("--- resolving nonexistent domain (expect NXDOMAIN) ---"); +587 let err = resolver +588 .lookup_ipv4("this-domain-does-not-exist.example.invalid", TIMEOUT) +589 .await +590 .map(|i| i.collect::<Vec<_>>()); +591 assert!(err.is_err(), "expected NXDOMAIN, got {err:?}"); +592 } +593 +594 mod search_names { +595 use super::super::{super::Builder, *}; +596 +597 fn resolver_with_search(domains: &[&str]) -> SimpleDnsResolver { +598 let mut r = SimpleDnsResolver::new(Builder::default()); +599 r.search_domains = domains.iter().map(|s| s.to_string()).collect(); +600 r +601 } +602 +603 #[test] +604 fn no_search_domains() { +605 let r = SimpleDnsResolver::new(Builder::default()); +606 assert_eq!(r.search_names("myhost"), vec!["myhost"]); +607 } +608 +609 #[test] +610 fn fqdn_bypasses_search() { +611 let r = resolver_with_search(&["example.com"]); +612 assert_eq!( +613 r.search_names("myhost.example.com."), +614 vec!["myhost.example.com."] +615 ); +616 } +617 +618 #[test] +619 fn short_name_tries_search_first() { +620 let r = resolver_with_search(&["example.com", "test.local"]); +621 // "myhost" has 0 dots (< ndots=1), so search domains come first. +622 assert_eq!( +623 r.search_names("myhost"), +624 vec!["myhost.example.com", "myhost.test.local", "myhost"] +625 ); +626 } +627 +628 #[test] +629 fn dotted_name_tries_bare_first() { +630 let r = resolver_with_search(&["example.com"]); +631 // "foo.bar" has 1 dot (>= ndots=1), so bare name comes first. +632 assert_eq!( +633 r.search_names("foo.bar"), +634 vec!["foo.bar", "foo.bar.example.com"] +635 ); +636 } +637 +638 #[test] +639 fn multi_dot_name_tries_bare_first() { +640 let r = resolver_with_search(&["example.com"]); +641 assert_eq!(r.search_names("a.b.c"), vec!["a.b.c", "a.b.c.example.com"]); +642 } +643 +644 #[test] +645 fn high_ndots_k8s_style() { +646 let mut r = SimpleDnsResolver::new(Builder::default()); +647 r.search_domains = vec!["ns.svc.cluster.local".into(), "svc.cluster.local".into()]; +648 r.ndots = 5; +649 // 4 dots < ndots=5, so search domains come first (Kubernetes behavior). +650 assert_eq!( +651 r.search_names("my-svc.my-ns.svc.cluster.local"), +652 vec![ +653 "my-svc.my-ns.svc.cluster.local.ns.svc.cluster.local", +654 "my-svc.my-ns.svc.cluster.local.svc.cluster.local", +655 "my-svc.my-ns.svc.cluster.local", +656 ] +657 ); +658 } +659 } +660}
    \ No newline at end of file diff --git a/pr/4036/docs/src/iroh_dns/endpoint_info.rs.html b/pr/4036/docs/src/iroh_dns/endpoint_info.rs.html index a0e9e883bb..f795051120 100644 --- a/pr/4036/docs/src/iroh_dns/endpoint_info.rs.html +++ b/pr/4036/docs/src/iroh_dns/endpoint_info.rs.html @@ -3,12 +3,12 @@ 3//! Dialing by [`EndpointId`] is supported by iroh endpoints publishing [Pkarr] records to DNS 4//! servers or the Mainline DHT. This module supports creating and parsing these records. 5//! -6//! [`EndpointInfo`] combines an [`iroh_base::EndpointId`] with [`EndpointData`] — +6//! [`EndpointInfo`] combines an [`iroh_base::EndpointId`] with [`EndpointData`]: 7//! the addressing and metadata that discovery services publish and resolve. 8//! Discovery services use [`AddrFilter`] to control which addresses are published. 9//! 10//! This module also provides serialization to and from pkarr signed packets and -11//! DNS TXT records. See the [`crate::attrs`] module for the on-the-wire format. +11//! DNS TXT records. 12//! 13//! DNS records are published under the following names: 14//! @@ -120,7 +120,7 @@ 120 self.add_addrs(addresses.into_iter().map(TransportAddr::Ip)) 121 } 122 -123 /// Adds addresses to the endpoint data in the given ordered, but with duplicates filtered. +123 /// Adds addresses to the endpoint data in the given order, but with duplicates filtered. 124 pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>) { 125 let mut addr_set = dedup(&mut self.addrs); 126 for addr in addrs.into_iter() { @@ -131,7 +131,7 @@ 131 } 132 } 133 -134 /// Sets the user-defined data and returns the updated endpoint data. +134 /// Sets the user-defined data. 135 pub fn set_user_data(&mut self, user_data: Option<UserData>) { 136 self.user_data = user_data; 137 } @@ -142,7 +142,7 @@ 142 .retain(|addr| !matches!(addr, TransportAddr::Ip(_))); 143 } 144 -145 /// Removes all direct addresses from the endpoint data. +145 /// Removes all relay URLs from the endpoint data. 146 pub fn clear_relay_urls(&mut self) { 147 self.addrs 148 .retain(|addr| !matches!(addr, TransportAddr::Relay(_))); @@ -169,12 +169,12 @@ 169 }) 170 } 171 -172 /// Returns the full list of all known addresses +172 /// Returns the full list of all known addresses. 173 pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr> { 174 self.addrs.iter() 175 } 176 -177 /// Does this have any addresses? +177 /// Returns whether this has any addresses. 178 pub fn has_addrs(&self) -> bool { 179 !self.addrs.is_empty() 180 } @@ -294,9 +294,9 @@ 294 } 295} 296 -297// User-defined data that can be published and resolved through endpoint discovery. -298/// -299/// Under the hood this is a UTF-8 String is no longer than [`UserData::MAX_LENGTH`] bytes. +297/// User-defined data that can be published and resolved through endpoint discovery. +298/// +299/// Under the hood this is a UTF-8 string no longer than [`UserData::MAX_LENGTH`] bytes. 300/// 301/// Iroh does not keep track of or examine the user-defined data. 302/// diff --git a/pr/4036/docs/src/iroh_dns_server/metrics.rs.html b/pr/4036/docs/src/iroh_dns_server/metrics.rs.html index e90d40cfcc..b98a45f93f 100644 --- a/pr/4036/docs/src/iroh_dns_server/metrics.rs.html +++ b/pr/4036/docs/src/iroh_dns_server/metrics.rs.html @@ -13,7 +13,7 @@ 13 pub pkarr_publish_noop: Counter, 14 /// Total number of DNS requests across all transports. 15 pub dns_requests: Counter, -16 /// Number of DNS requests received over UDP or TCP. +16 /// Number of DNS requests received over UDP. 17 pub dns_requests_udp: Counter, 18 /// Number of DNS requests received over HTTPS (DoH). 19 pub dns_requests_https: Counter, @@ -34,13 +34,15 @@ 34 /// Number of signed packets newly inserted into the store. 35 pub store_packets_inserted: Counter, 36 /// Number of signed packets removed from the store. -37 pub store_packets_removed: Counter, -38 /// Number of times an existing signed packet was replaced by a newer one. -39 pub store_packets_updated: Counter, -40 /// Number of signed packets removed by the eviction task. -41 pub store_packets_expired: Counter, -42 /// Current number of zones in the main cache -43 pub cache_zones: Gauge, -44 /// Current number of zones in the DHT cache -45 pub cache_zones_dht: Gauge, -46} \ No newline at end of file +37 /// +38 /// Currently always at 0 because the removal API is not used. +39 pub store_packets_removed: Counter, +40 /// Number of times an existing signed packet was replaced by a newer one. +41 pub store_packets_updated: Counter, +42 /// Number of signed packets removed by the eviction task. +43 pub store_packets_expired: Counter, +44 /// Current number of zones in the main cache +45 pub cache_zones: Gauge, +46 /// Current number of zones in the DHT cache +47 pub cache_zones_dht: Gauge, +48} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh_relay/http.rs.html b/pr/4036/docs/src/iroh_relay/http.rs.html index 3d735b381c..f6059ae0bf 100644 --- a/pr/4036/docs/src/iroh_relay/http.rs.html +++ b/pr/4036/docs/src/iroh_relay/http.rs.html @@ -77,7 +77,7 @@ 77 Self::all().collect::<Vec<_>>().join(", ") 78 } 79 -80 /// Returns all supported protocol versions in a comma-seperated string as an HTTP header value. +80 /// Returns all supported protocol versions in a comma-separated string as an HTTP header value. 81 pub fn all_as_header_value() -> HeaderValue { 82 HeaderValue::from_bytes(Self::all_joined().as_bytes()).expect("valid header name") 83 } diff --git a/pr/4036/docs/src/iroh_relay/lib.rs.html b/pr/4036/docs/src/iroh_relay/lib.rs.html index fd678da0a8..9f9f1adb00 100644 --- a/pr/4036/docs/src/iroh_relay/lib.rs.html +++ b/pr/4036/docs/src/iroh_relay/lib.rs.html @@ -51,33 +51,31 @@ 51 relay_map::{RelayConfig, RelayMap, RelayQuicConfig}, 52}; 53 -54/// This trait allows anything that ends up potentially -55/// wrapping a TLS stream use the underlying [`export_keying_material`] -56/// function. -57/// -58/// [`export_keying_material`]: rustls::ConnectionCommon::export_keying_material -59/// Trait for extracting keying material from a TLS connection. -60/// -61/// This is used during the relay handshake to establish a shared secret -62/// between the client and server for authentication purposes. -63pub trait ExportKeyingMaterial { -64 /// If this type ends up wrapping a TLS stream, then this tries -65 /// to export keying material by calling the underlying [`export_keying_material`] -66 /// function. -67 /// -68 /// However unlike that function, this returns `Option`, in case the -69 /// underlying stream might not be wrapping TLS, e.g. as in the case of -70 /// `MaybeTlsStream`. -71 /// -72 /// For more information on what this function does, see the -73 /// [`export_keying_material`] documentation. -74 /// -75 /// [`export_keying_material`]: rustls::ConnectionCommon::export_keying_material -76 #[cfg_attr(wasm_browser, allow(unused))] -77 fn export_keying_material<T: AsMut<[u8]>>( -78 &self, -79 output: T, -80 label: &[u8], -81 context: Option<&[u8]>, -82 ) -> Option<T>; -83} \ No newline at end of file +54/// Trait for extracting keying material from a TLS connection. +55/// +56/// This allows anything that ends up potentially wrapping a TLS stream to use the +57/// underlying [`export_keying_material`] function. It is used during the relay handshake +58/// to establish a shared secret between the client and server for authentication purposes. +59/// +60/// [`export_keying_material`]: rustls::ConnectionCommon::export_keying_material +61pub trait ExportKeyingMaterial { +62 /// If this type ends up wrapping a TLS stream, then this tries +63 /// to export keying material by calling the underlying [`export_keying_material`] +64 /// function. +65 /// +66 /// However unlike that function, this returns `Option`, in case the +67 /// underlying stream might not be wrapping TLS, e.g. as in the case of +68 /// `MaybeTlsStream`. +69 /// +70 /// For more information on what this function does, see the +71 /// [`export_keying_material`] documentation. +72 /// +73 /// [`export_keying_material`]: rustls::ConnectionCommon::export_keying_material +74 #[cfg_attr(wasm_browser, allow(unused))] +75 fn export_keying_material<T: AsMut<[u8]>>( +76 &self, +77 output: T, +78 label: &[u8], +79 context: Option<&[u8]>, +80 ) -> Option<T>; +81} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh_relay/protos/common.rs.html b/pr/4036/docs/src/iroh_relay/protos/common.rs.html index efc2f00b75..93d9799c89 100644 --- a/pr/4036/docs/src/iroh_relay/protos/common.rs.html +++ b/pr/4036/docs/src/iroh_relay/protos/common.rs.html @@ -39,81 +39,80 @@ 39 /// 40 /// 32B pub key of peer that's gone 41 EndpointGone = 8, -42 /// Messages with these frames will be ignored. -43 /// 8 byte ping payload, to be echoed back in FrameType::Pong -44 Ping = 9, -45 /// 8 byte payload, the contents of ping being replied to -46 Pong = 10, -47 /// REMOVED since relay-protocol-v2, use `Self::Status` instead. -48 /// -49 /// Sent from server to client to tell the client if their connection is unhealthy somehow. -50 /// Contains only UTF-8 bytes. -51 Health = 11, -52 -53 /// Sent from server to client for the server to declare that it's restarting. -54 /// Payload is two big endian u32 durations in milliseconds: when to reconnect, -55 /// and how long to try total. -56 Restarting = 12, -57 -58 /// Sent from server to client to declare the connection health state. -59 /// -60 /// Added in `iroh-relay-v2` protocol. May not be sent to `iroh-relay-v1` clients. -61 /// -62 /// Uses a binary-encoded [`Status`] payload. -63 /// -64 /// [`Status`]: super::relay::Status -65 Status = 13, -66} -67 -68#[stack_error(derive, add_meta)] -69#[allow(missing_docs)] -70#[non_exhaustive] -71pub enum FrameTypeError { -72 #[error("not enough bytes to parse frame type")] -73 UnexpectedEnd { -74 #[error(std_err)] -75 source: UnexpectedEnd, -76 }, -77 #[error("frame type unknown")] -78 UnknownFrameType { tag: VarInt }, -79} -80 -81impl FrameType { -82 /// Writes the frame type to the buffer (as a QUIC-encoded varint). -83 pub(crate) fn write_to<O: BufMut>(&self, mut dst: O) -> O { -84 VarInt::from(*self).encode(&mut dst); -85 dst -86 } -87 -88 /// Returns the amount of bytes that [`Self::write_to`] would write. -89 pub(crate) fn encoded_len(&self) -> usize { -90 // Copied implementation from `VarInt::size` -91 let x: u32 = (*self).into(); -92 if x < 2u32.pow(6) { -93 1 // this will pretty much always be the case -94 } else if x < 2u32.pow(14) { -95 2 -96 } else if x < 2u32.pow(30) { -97 4 -98 } else { -99 unreachable!("Impossible FrameType primitive representation") -100 } -101 } -102 -103 /// Parses the frame type (as a QUIC-encoded varint) from the first couple of bytes given -104 /// and returns the frame type and the rest. -105 pub(crate) fn from_bytes(buf: &mut impl Buf) -> Result<Self, FrameTypeError> { -106 let tag = VarInt::decode(buf).map_err(|err| e!(FrameTypeError::UnexpectedEnd, err))?; -107 let tag_u32 = u32::try_from(u64::from(tag)) -108 .map_err(|_| e!(FrameTypeError::UnknownFrameType { tag }))?; -109 let frame_type = FrameType::from_repr(tag_u32) -110 .ok_or_else(|| e!(FrameTypeError::UnknownFrameType { tag }))?; -111 Ok(frame_type) -112 } -113} -114 -115impl From<FrameType> for VarInt { -116 fn from(value: FrameType) -> Self { -117 (value as u32).into() -118 } -119} \ No newline at end of file +42 /// 8 byte ping payload, to be echoed back in a [`FrameType::Pong`]. +43 Ping = 9, +44 /// 8 byte payload, the contents of ping being replied to +45 Pong = 10, +46 /// REMOVED since relay-protocol-v2, use `Self::Status` instead. +47 /// +48 /// Sent from server to client to tell the client if their connection is unhealthy somehow. +49 /// Contains only UTF-8 bytes. +50 Health = 11, +51 +52 /// Sent from server to client for the server to declare that it's restarting. +53 /// Payload is two big endian u32 durations in milliseconds: when to reconnect, +54 /// and how long to try total. +55 Restarting = 12, +56 +57 /// Sent from server to client to declare the connection health state. +58 /// +59 /// Added in `iroh-relay-v2` protocol. May not be sent to `iroh-relay-v1` clients. +60 /// +61 /// Uses a binary-encoded [`Status`] payload. +62 /// +63 /// [`Status`]: super::relay::Status +64 Status = 13, +65} +66 +67#[stack_error(derive, add_meta)] +68#[allow(missing_docs)] +69#[non_exhaustive] +70pub enum FrameTypeError { +71 #[error("not enough bytes to parse frame type")] +72 UnexpectedEnd { +73 #[error(std_err)] +74 source: UnexpectedEnd, +75 }, +76 #[error("frame type unknown")] +77 UnknownFrameType { tag: VarInt }, +78} +79 +80impl FrameType { +81 /// Writes the frame type to the buffer (as a QUIC-encoded varint). +82 pub(crate) fn write_to<O: BufMut>(&self, mut dst: O) -> O { +83 VarInt::from(*self).encode(&mut dst); +84 dst +85 } +86 +87 /// Returns the amount of bytes that [`Self::write_to`] would write. +88 pub(crate) fn encoded_len(&self) -> usize { +89 // Copied implementation from `VarInt::size` +90 let x: u32 = (*self).into(); +91 if x < 2u32.pow(6) { +92 1 // this will pretty much always be the case +93 } else if x < 2u32.pow(14) { +94 2 +95 } else if x < 2u32.pow(30) { +96 4 +97 } else { +98 unreachable!("Impossible FrameType primitive representation") +99 } +100 } +101 +102 /// Parses the frame type (as a QUIC-encoded varint) from the first couple of bytes given +103 /// and returns the frame type and the rest. +104 pub(crate) fn from_bytes(buf: &mut impl Buf) -> Result<Self, FrameTypeError> { +105 let tag = VarInt::decode(buf).map_err(|err| e!(FrameTypeError::UnexpectedEnd, err))?; +106 let tag_u32 = u32::try_from(u64::from(tag)) +107 .map_err(|_| e!(FrameTypeError::UnknownFrameType { tag }))?; +108 let frame_type = FrameType::from_repr(tag_u32) +109 .ok_or_else(|| e!(FrameTypeError::UnknownFrameType { tag }))?; +110 Ok(frame_type) +111 } +112} +113 +114impl From<FrameType> for VarInt { +115 fn from(value: FrameType) -> Self { +116 (value as u32).into() +117 } +118} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh_relay/protos/handshake.rs.html b/pr/4036/docs/src/iroh_relay/protos/handshake.rs.html index c6505eec49..b84dbf564a 100644 --- a/pr/4036/docs/src/iroh_relay/protos/handshake.rs.html +++ b/pr/4036/docs/src/iroh_relay/protos/handshake.rs.html @@ -377,533 +377,529 @@ 377 } 378} 379 -380/// This represents successful authentication for the client with the `client_key` public key -381/// via the authentication [`Mechanism`] `mechanism`. -382/// -383/// You must call [`SuccessfulAuthentication::authorize_if`] to finish the protocol. -384#[cfg(feature = "server")] -385/// Result of a successful authentication handshake. -386/// -387/// This struct represents a client that has successfully authenticated itself to the relay -388/// server. The authorization must still be confirmed by calling [`Self::authorize_if`] to -389/// complete the protocol and notify the client of success or failure. -390#[derive(Debug)] -391#[must_use = "the protocol is not finished unless `authorize_if` is called"] -392pub struct SuccessfulAuthentication { -393 /// The authenticated client's public key. -394 pub client_key: PublicKey, -395 /// The authentication mechanism that was used. -396 pub mechanism: Mechanism, -397} -398 -399/// The mechanism that was used for authentication. -400#[cfg(feature = "server")] -401#[derive(Debug, Clone, Copy, PartialEq, Eq)] -402#[non_exhaustive] -403pub enum Mechanism { -404 /// Authentication was performed by verifying a signature of a challenge we sent -405 SignedChallenge, -406 /// Authentication was performed by verifying a signature of shared extracted TLS keying material -407 SignedKeyMaterial, -408} -409 -410/// Runs the server side of the handshaking protocol. +380/// Result of a successful authentication handshake. +381/// +382/// This struct represents a client that has successfully authenticated itself to the relay +383/// server. The authorization must still be confirmed by calling [`Self::authorize_if`] to +384/// complete the protocol and notify the client of success or failure. +385#[cfg(feature = "server")] +386#[derive(Debug)] +387#[must_use = "the protocol is not finished unless `authorize_if` is called"] +388pub struct SuccessfulAuthentication { +389 /// The authenticated client's public key. +390 pub client_key: PublicKey, +391 /// The authentication mechanism that was used. +392 pub mechanism: Mechanism, +393} +394 +395/// The mechanism that was used for authentication. +396#[cfg(feature = "server")] +397#[derive(Debug, Clone, Copy, PartialEq, Eq)] +398#[non_exhaustive] +399pub enum Mechanism { +400 /// Authentication was performed by verifying a signature of a challenge we sent +401 SignedChallenge, +402 /// Authentication was performed by verifying a signature of shared extracted TLS keying material +403 SignedKeyMaterial, +404} +405 +406/// Runs the server side of the handshaking protocol. +407/// +408/// See the module documentation for an overview of the handshaking protocol. +409/// +410/// This takes `rng` to generate cryptographic randomness for the authentication challenge. 411/// -412/// See the module documentation for an overview of the handshaking protocol. -413/// -414/// This takes `rng` to generate cryptographic randomness for the authentication challenge. -415/// -416/// This also takes the `client_auth_header`, if present, to perform authentication without -417/// requiring sending a challenge, saving a round-trip, if possible. -418/// -419/// If this fails, the protocol falls back to doing a normal extra round trip with a challenge. -420/// -421/// The return value [`SuccessfulAuthentication`] still needs to be resolved by calling -422/// [`SuccessfulAuthentication::authorize_if`] to finish the whole authorization protocol -423/// (otherwise the client won't be notified about auth success or failure). -424#[cfg(feature = "server")] -425pub async fn serverside( -426 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), -427 client_auth_header: Option<HeaderValue>, -428) -> Result<SuccessfulAuthentication, Error> { -429 if let Some(client_auth_header) = client_auth_header { -430 let client_auth_bytes = data_encoding::BASE64URL_NOPAD -431 .decode(client_auth_header.as_ref()) -432 .map_err(|_| { -433 e!(Error::ClientAuthHeaderInvalid { -434 value: client_auth_header.clone() -435 }) -436 })?; -437 -438 let client_auth: KeyMaterialClientAuth = -439 postcard::from_bytes(&client_auth_bytes).map_err(|_| { -440 e!(Error::ClientAuthHeaderInvalid { -441 value: client_auth_header.clone() -442 }) -443 })?; -444 -445 if client_auth.verify(io).is_ok() { -446 trace!(?client_auth.public_key, "authentication succeeded via keying material"); -447 return Ok(SuccessfulAuthentication { -448 client_key: client_auth.public_key, -449 mechanism: Mechanism::SignedKeyMaterial, -450 }); -451 } -452 // Verification not succeeding is part of normal operation: The TLS exporter isn't required to match. -453 // We'll fall back to verification that takes another round trip more time. -454 } -455 -456 let challenge = ServerChallenge::new(&mut rand::rng()); -457 write_frame(io, &challenge).await?; -458 -459 let (_, frame) = read_frame(io, &[ClientAuth::TAG]).await?; -460 let client_auth: ClientAuth = deserialize_frame(frame)?; -461 -462 if let Err(err) = client_auth.verify(&challenge) { -463 trace!(?client_auth.public_key, ?err, "authentication failed"); -464 let denial = ServerDeniesAuth { -465 reason: "signature invalid".into(), -466 }; -467 write_frame(io, denial.clone()).await?; -468 Err(e!(Error::ServerDeniedAuth { -469 reason: denial.reason -470 })) -471 } else { -472 trace!(?client_auth.public_key, "authentication succeeded via challenge"); -473 Ok(SuccessfulAuthentication { -474 client_key: client_auth.public_key, -475 mechanism: Mechanism::SignedChallenge, -476 }) -477 } -478} -479 -480#[cfg(feature = "server")] -481impl SuccessfulAuthentication { -482 /// Authorizes a [`ClientRequest`] and completes the authorization protocol. -483 /// -484 /// This invokes [`AccessControl::on_connect`] with the [`ClientRequest`] and informs the client about the -485 /// authorization decision. -486 /// -487 /// Returns [`OnDisconnectGuard`] in case the authorization was successful and the confirmation -488 /// message was sent to the client. The handshake protocol is now complete. -489 /// -490 /// Returns an error if the authorization failed or if the confirmation message could not be sent. -491 /// -492 /// [`AccessControl::on_connect`]: crate::server::AccessControl::on_connect -493 pub async fn authorize_with( -494 self, -495 request: &ClientRequest, -496 access_control: &Arc<dyn DynAccessControl>, -497 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), -498 ) -> Result<OnDisconnectGuard, Error> { -499 match access_control.on_connect(request).await { -500 Access::Allow => { -501 let guard = OnDisconnectGuard::for_access_control(access_control.clone(), request); -502 self.accept(io).await?; -503 Ok(guard) -504 } -505 Access::Deny { reason } => Err(self.deny(reason, io).await), -506 } -507 } -508 /// Completes the authorization protocol by notifying the client of success or failure. +412/// This also takes the `client_auth_header`, if present, to perform authentication without +413/// requiring sending a challenge, saving a round-trip, if possible. +414/// +415/// If this fails, the protocol falls back to doing a normal extra round trip with a challenge. +416/// +417/// The return value [`SuccessfulAuthentication`] still needs to be resolved by calling +418/// [`SuccessfulAuthentication::authorize_if`] to finish the whole authorization protocol +419/// (otherwise the client won't be notified about auth success or failure). +420#[cfg(feature = "server")] +421pub async fn serverside( +422 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), +423 client_auth_header: Option<HeaderValue>, +424) -> Result<SuccessfulAuthentication, Error> { +425 if let Some(client_auth_header) = client_auth_header { +426 let client_auth_bytes = data_encoding::BASE64URL_NOPAD +427 .decode(client_auth_header.as_ref()) +428 .map_err(|_| { +429 e!(Error::ClientAuthHeaderInvalid { +430 value: client_auth_header.clone() +431 }) +432 })?; +433 +434 let client_auth: KeyMaterialClientAuth = +435 postcard::from_bytes(&client_auth_bytes).map_err(|_| { +436 e!(Error::ClientAuthHeaderInvalid { +437 value: client_auth_header.clone() +438 }) +439 })?; +440 +441 if client_auth.verify(io).is_ok() { +442 trace!(?client_auth.public_key, "authentication succeeded via keying material"); +443 return Ok(SuccessfulAuthentication { +444 client_key: client_auth.public_key, +445 mechanism: Mechanism::SignedKeyMaterial, +446 }); +447 } +448 // Verification not succeeding is part of normal operation: The TLS exporter isn't required to match. +449 // We'll fall back to verification that takes another round trip more time. +450 } +451 +452 let challenge = ServerChallenge::new(&mut rand::rng()); +453 write_frame(io, &challenge).await?; +454 +455 let (_, frame) = read_frame(io, &[ClientAuth::TAG]).await?; +456 let client_auth: ClientAuth = deserialize_frame(frame)?; +457 +458 if let Err(err) = client_auth.verify(&challenge) { +459 trace!(?client_auth.public_key, ?err, "authentication failed"); +460 let denial = ServerDeniesAuth { +461 reason: "signature invalid".into(), +462 }; +463 write_frame(io, denial.clone()).await?; +464 Err(e!(Error::ServerDeniedAuth { +465 reason: denial.reason +466 })) +467 } else { +468 trace!(?client_auth.public_key, "authentication succeeded via challenge"); +469 Ok(SuccessfulAuthentication { +470 client_key: client_auth.public_key, +471 mechanism: Mechanism::SignedChallenge, +472 }) +473 } +474} +475 +476#[cfg(feature = "server")] +477impl SuccessfulAuthentication { +478 /// Authorizes a [`ClientRequest`] and completes the authorization protocol. +479 /// +480 /// This invokes [`AccessControl::on_connect`] with the [`ClientRequest`] and informs the client about the +481 /// authorization decision. +482 /// +483 /// Returns [`OnDisconnectGuard`] in case the authorization was successful and the confirmation +484 /// message was sent to the client. The handshake protocol is now complete. +485 /// +486 /// Returns an error if the authorization failed or if the confirmation message could not be sent. +487 /// +488 /// [`AccessControl::on_connect`]: crate::server::AccessControl::on_connect +489 pub async fn authorize_with( +490 self, +491 request: &ClientRequest, +492 access_control: &Arc<dyn DynAccessControl>, +493 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), +494 ) -> Result<OnDisconnectGuard, Error> { +495 match access_control.on_connect(request).await { +496 Access::Allow => { +497 let guard = OnDisconnectGuard::for_access_control(access_control.clone(), request); +498 self.accept(io).await?; +499 Ok(guard) +500 } +501 Access::Deny { reason } => Err(self.deny(reason, io).await), +502 } +503 } +504 /// Completes the authorization protocol by notifying the client of success or failure. +505 /// +506 /// After a client has been successfully authenticated via [`serverside`], the server must +507 /// decide whether to authorize the client (allow access) or deny it. This method sends +508 /// the authorization decision to the client and completes the handshake protocol. 509 /// -510 /// After a client has been successfully authenticated via [`serverside`], the server must -511 /// decide whether to authorize the client (allow access) or deny it. This method sends -512 /// the authorization decision to the client and completes the handshake protocol. +510 /// # Arguments +511 /// * `access` - Whether to grant access to the authenticated client +512 /// * `io` - The WebSocket stream to send the authorization response on 513 /// -514 /// # Arguments -515 /// * `access` - Whether to grant access to the authenticated client -516 /// * `io` - The WebSocket stream to send the authorization response on -517 /// -518 /// # Returns -519 /// * `Ok(PublicKey)` - The client's public key if authorization was granted -520 /// * `Err(Error)` - If authorization was denied or communication failed -521 pub async fn authorize_if( -522 self, -523 access: Access, -524 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), -525 ) -> Result<PublicKey, Error> { -526 match access { -527 Access::Allow => self.accept(io).await, -528 Access::Deny { reason } => Err(self.deny(reason, io).await), -529 } -530 } -531 -532 async fn accept( -533 self, -534 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), -535 ) -> Result<PublicKey, Error> { -536 trace!("authorizing client"); -537 write_frame(io, ServerConfirmsAuth).await?; -538 Ok(self.client_key) -539 } -540 -541 async fn deny( -542 self, -543 reason: Option<String>, -544 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), -545 ) -> Error { -546 trace!("denying client auth"); -547 let reason = reason.unwrap_or_else(|| "not authorized".into()); -548 let denial = ServerDeniesAuth { reason }; -549 match write_frame(io, denial.clone()).await { -550 Err(err) => err, -551 Ok(()) => e!(Error::ServerDeniedAuth { -552 reason: denial.reason -553 }), -554 } -555 } -556} -557 -558async fn write_frame<F: serde::Serialize + Frame>( -559 io: &mut impl BytesStreamSink, -560 frame: F, -561) -> Result<(), Error> { -562 let mut bytes = BytesMut::new(); -563 trace!(frame_type = ?F::TAG, "Writing frame"); -564 F::TAG.write_to(&mut bytes); -565 let bytes = postcard::to_io(&frame, bytes.writer()) -566 .expect("serialization failed") // buffer can't become "full" without being a critical failure, datastructures shouldn't ever fail serialization -567 .into_inner() -568 .freeze(); -569 io.send(bytes) -570 .await -571 .map_err(|err| e!(Error::Websocket, anyerr!(err)))?; -572 io.flush() -573 .await -574 .map_err(|err| e!(Error::Websocket, anyerr!(err)))?; -575 Ok(()) -576} -577 -578async fn read_frame( -579 io: &mut impl BytesStreamSink, -580 expected_types: &[FrameType], -581) -> Result<(FrameType, Bytes), Error> { -582 let mut payload = io -583 .try_next() -584 .await -585 .map_err(|err| e!(Error::Websocket, anyerr!(err)))? -586 .ok_or_else(|| e!(Error::UnexpectedEnd))?; -587 -588 let frame_type = FrameType::from_bytes(&mut payload)?; -589 trace!(?frame_type, "Reading frame"); -590 ensure!( -591 expected_types.contains(&frame_type), -592 Error::UnexpectedFrameType { -593 frame_type, -594 expected_types: expected_types.to_vec() -595 } -596 ); -597 -598 Ok((frame_type, payload)) -599} -600 -601fn deserialize_frame<F: Frame + serde::de::DeserializeOwned>(frame: Bytes) -> Result<F, Error> { -602 postcard::from_bytes(&frame).map_err(|err| { -603 e!(Error::DeserializationError { -604 frame_type: F::TAG, -605 source: anyerr!(err) -606 }) -607 }) -608} -609 -610#[cfg(all(test, feature = "server"))] -611mod tests { -612 use bytes::BytesMut; -613 use iroh_base::{PublicKey, SecretKey}; -614 use n0_error::{AnyError, Result, StackResultExt, StdResultExt}; -615 use n0_future::{Sink, SinkExt, Stream, TryStreamExt}; -616 use n0_tracing_test::traced_test; -617 use rand::{RngExt, SeedableRng}; -618 use tokio_util::codec::{Framed, LengthDelimitedCodec}; -619 use tracing::{Instrument, info_span}; -620 -621 use super::{ -622 ClientAuth, KeyMaterialClientAuth, Mechanism, ServerChallenge, ServerConfirmsAuth, -623 }; -624 use crate::{ExportKeyingMaterial, server::Access}; -625 -626 struct TestKeyingMaterial<IO> { -627 shared_secret: Option<u64>, -628 inner: IO, +514 /// # Returns +515 /// * `Ok(PublicKey)` - The client's public key if authorization was granted +516 /// * `Err(Error)` - If authorization was denied or communication failed +517 pub async fn authorize_if( +518 self, +519 access: Access, +520 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), +521 ) -> Result<PublicKey, Error> { +522 match access { +523 Access::Allow => self.accept(io).await, +524 Access::Deny { reason } => Err(self.deny(reason, io).await), +525 } +526 } +527 +528 async fn accept( +529 self, +530 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), +531 ) -> Result<PublicKey, Error> { +532 trace!("authorizing client"); +533 write_frame(io, ServerConfirmsAuth).await?; +534 Ok(self.client_key) +535 } +536 +537 async fn deny( +538 self, +539 reason: Option<String>, +540 io: &mut (impl BytesStreamSink + ExportKeyingMaterial), +541 ) -> Error { +542 trace!("denying client auth"); +543 let reason = reason.unwrap_or_else(|| "not authorized".into()); +544 let denial = ServerDeniesAuth { reason }; +545 match write_frame(io, denial.clone()).await { +546 Err(err) => err, +547 Ok(()) => e!(Error::ServerDeniedAuth { +548 reason: denial.reason +549 }), +550 } +551 } +552} +553 +554async fn write_frame<F: serde::Serialize + Frame>( +555 io: &mut impl BytesStreamSink, +556 frame: F, +557) -> Result<(), Error> { +558 let mut bytes = BytesMut::new(); +559 trace!(frame_type = ?F::TAG, "Writing frame"); +560 F::TAG.write_to(&mut bytes); +561 let bytes = postcard::to_io(&frame, bytes.writer()) +562 .expect("serialization failed") // buffer can't become "full" without being a critical failure, datastructures shouldn't ever fail serialization +563 .into_inner() +564 .freeze(); +565 io.send(bytes) +566 .await +567 .map_err(|err| e!(Error::Websocket, anyerr!(err)))?; +568 io.flush() +569 .await +570 .map_err(|err| e!(Error::Websocket, anyerr!(err)))?; +571 Ok(()) +572} +573 +574async fn read_frame( +575 io: &mut impl BytesStreamSink, +576 expected_types: &[FrameType], +577) -> Result<(FrameType, Bytes), Error> { +578 let mut payload = io +579 .try_next() +580 .await +581 .map_err(|err| e!(Error::Websocket, anyerr!(err)))? +582 .ok_or_else(|| e!(Error::UnexpectedEnd))?; +583 +584 let frame_type = FrameType::from_bytes(&mut payload)?; +585 trace!(?frame_type, "Reading frame"); +586 ensure!( +587 expected_types.contains(&frame_type), +588 Error::UnexpectedFrameType { +589 frame_type, +590 expected_types: expected_types.to_vec() +591 } +592 ); +593 +594 Ok((frame_type, payload)) +595} +596 +597fn deserialize_frame<F: Frame + serde::de::DeserializeOwned>(frame: Bytes) -> Result<F, Error> { +598 postcard::from_bytes(&frame).map_err(|err| { +599 e!(Error::DeserializationError { +600 frame_type: F::TAG, +601 source: anyerr!(err) +602 }) +603 }) +604} +605 +606#[cfg(all(test, feature = "server"))] +607mod tests { +608 use bytes::BytesMut; +609 use iroh_base::{PublicKey, SecretKey}; +610 use n0_error::{AnyError, Result, StackResultExt, StdResultExt}; +611 use n0_future::{Sink, SinkExt, Stream, TryStreamExt}; +612 use n0_tracing_test::traced_test; +613 use rand::{RngExt, SeedableRng}; +614 use tokio_util::codec::{Framed, LengthDelimitedCodec}; +615 use tracing::{Instrument, info_span}; +616 +617 use super::{ +618 ClientAuth, KeyMaterialClientAuth, Mechanism, ServerChallenge, ServerConfirmsAuth, +619 }; +620 use crate::{ExportKeyingMaterial, server::Access}; +621 +622 struct TestKeyingMaterial<IO> { +623 shared_secret: Option<u64>, +624 inner: IO, +625 } +626 +627 trait WithTlsSharedSecret: Sized { +628 fn with_shared_secret(self, shared_secret: Option<u64>) -> TestKeyingMaterial<Self>; 629 } 630 -631 trait WithTlsSharedSecret: Sized { -632 fn with_shared_secret(self, shared_secret: Option<u64>) -> TestKeyingMaterial<Self>; -633 } -634 -635 impl<T: Sized> WithTlsSharedSecret for T { -636 fn with_shared_secret(self, shared_secret: Option<u64>) -> TestKeyingMaterial<Self> { -637 TestKeyingMaterial { -638 shared_secret, -639 inner: self, -640 } -641 } -642 } -643 -644 impl<IO> ExportKeyingMaterial for TestKeyingMaterial<IO> { -645 fn export_keying_material<T: AsMut<[u8]>>( -646 &self, -647 mut output: T, -648 label: &[u8], -649 context: Option<&[u8]>, -650 ) -> Option<T> { -651 // we simulate something like exporting keying material using blake3 -652 -653 let label_key = blake3::hash(label); -654 let context_key = blake3::keyed_hash(label_key.as_bytes(), context.unwrap_or(&[])); -655 let mut hasher = blake3::Hasher::new_keyed(context_key.as_bytes()); -656 hasher.update(&self.shared_secret?.to_le_bytes()); -657 hasher.finalize_xof().fill(output.as_mut()); +631 impl<T: Sized> WithTlsSharedSecret for T { +632 fn with_shared_secret(self, shared_secret: Option<u64>) -> TestKeyingMaterial<Self> { +633 TestKeyingMaterial { +634 shared_secret, +635 inner: self, +636 } +637 } +638 } +639 +640 impl<IO> ExportKeyingMaterial for TestKeyingMaterial<IO> { +641 fn export_keying_material<T: AsMut<[u8]>>( +642 &self, +643 mut output: T, +644 label: &[u8], +645 context: Option<&[u8]>, +646 ) -> Option<T> { +647 // we simulate something like exporting keying material using blake3 +648 +649 let label_key = blake3::hash(label); +650 let context_key = blake3::keyed_hash(label_key.as_bytes(), context.unwrap_or(&[])); +651 let mut hasher = blake3::Hasher::new_keyed(context_key.as_bytes()); +652 hasher.update(&self.shared_secret?.to_le_bytes()); +653 hasher.finalize_xof().fill(output.as_mut()); +654 +655 Some(output) +656 } +657 } 658 -659 Some(output) -660 } -661 } -662 -663 impl<V, IO: Stream<Item = V> + Unpin> Stream for TestKeyingMaterial<IO> { -664 type Item = V; -665 -666 fn poll_next( -667 mut self: std::pin::Pin<&mut Self>, -668 cx: &mut std::task::Context<'_>, -669 ) -> std::task::Poll<Option<Self::Item>> { -670 std::pin::Pin::new(&mut self.inner).poll_next(cx) -671 } -672 } -673 -674 impl<V, E, IO: Sink<V, Error = E> + Unpin> Sink<V> for TestKeyingMaterial<IO> { -675 type Error = E; -676 -677 fn poll_ready( -678 mut self: std::pin::Pin<&mut Self>, -679 cx: &mut std::task::Context<'_>, -680 ) -> std::task::Poll<Result<(), Self::Error>> { -681 std::pin::Pin::new(&mut self.inner).poll_ready(cx) +659 impl<V, IO: Stream<Item = V> + Unpin> Stream for TestKeyingMaterial<IO> { +660 type Item = V; +661 +662 fn poll_next( +663 mut self: std::pin::Pin<&mut Self>, +664 cx: &mut std::task::Context<'_>, +665 ) -> std::task::Poll<Option<Self::Item>> { +666 std::pin::Pin::new(&mut self.inner).poll_next(cx) +667 } +668 } +669 +670 impl<V, E, IO: Sink<V, Error = E> + Unpin> Sink<V> for TestKeyingMaterial<IO> { +671 type Error = E; +672 +673 fn poll_ready( +674 mut self: std::pin::Pin<&mut Self>, +675 cx: &mut std::task::Context<'_>, +676 ) -> std::task::Poll<Result<(), Self::Error>> { +677 std::pin::Pin::new(&mut self.inner).poll_ready(cx) +678 } +679 +680 fn start_send(mut self: std::pin::Pin<&mut Self>, item: V) -> Result<(), Self::Error> { +681 std::pin::Pin::new(&mut self.inner).start_send(item) 682 } 683 -684 fn start_send(mut self: std::pin::Pin<&mut Self>, item: V) -> Result<(), Self::Error> { -685 std::pin::Pin::new(&mut self.inner).start_send(item) -686 } -687 -688 fn poll_flush( -689 mut self: std::pin::Pin<&mut Self>, -690 cx: &mut std::task::Context<'_>, -691 ) -> std::task::Poll<Result<(), Self::Error>> { -692 std::pin::Pin::new(&mut self.inner).poll_flush(cx) -693 } -694 -695 fn poll_close( -696 mut self: std::pin::Pin<&mut Self>, -697 cx: &mut std::task::Context<'_>, -698 ) -> std::task::Poll<Result<(), Self::Error>> { -699 std::pin::Pin::new(&mut self.inner).poll_close(cx) -700 } -701 } -702 -703 async fn simulate_handshake( -704 secret_key: &SecretKey, -705 client_shared_secret: Option<u64>, -706 server_shared_secret: Option<u64>, -707 restricted_to: Option<PublicKey>, -708 ) -> (Result<ServerConfirmsAuth>, Result<(PublicKey, Mechanism)>) { -709 let (client, server) = tokio::io::duplex(1024); -710 -711 let mut client_io = Framed::new(client, LengthDelimitedCodec::new()) -712 .map_ok(BytesMut::freeze) -713 .map_err(AnyError::from_std) -714 .sink_map_err(AnyError::from_std) -715 .with_shared_secret(client_shared_secret); -716 let mut server_io = Framed::new(server, LengthDelimitedCodec::new()) -717 .map_ok(BytesMut::freeze) -718 .map_err(AnyError::from_std) -719 .sink_map_err(AnyError::from_std) -720 .with_shared_secret(server_shared_secret); -721 -722 let client_auth_header = KeyMaterialClientAuth::new(secret_key, &client_io) -723 .map(KeyMaterialClientAuth::into_header_value); -724 -725 n0_future::future::zip( -726 async { -727 super::clientside(&mut client_io, secret_key) -728 .await -729 .context("clientside") -730 } -731 .instrument(info_span!("clientside")), -732 async { -733 let auth_n = super::serverside(&mut server_io, client_auth_header) -734 .await -735 .context("serverside")?; -736 let mechanism = auth_n.mechanism; -737 let is_authorized = match restricted_to.is_none_or(|key| key == auth_n.client_key) { -738 true => Access::Allow, -739 false => Access::Deny { reason: None }, -740 }; -741 let key = auth_n.authorize_if(is_authorized, &mut server_io).await?; -742 Ok((key, mechanism)) -743 } -744 .instrument(info_span!("serverside")), -745 ) -746 .await -747 } -748 -749 #[tokio::test] -750 #[traced_test] -751 async fn test_handshake_via_shared_secrets() -> Result { -752 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -753 -754 let secret_key = SecretKey::from_bytes(&rng.random()); -755 let (client, server) = simulate_handshake(&secret_key, Some(42), Some(42), None).await; -756 client?; -757 let (public_key, auth) = server?; -758 assert_eq!(public_key, secret_key.public()); -759 assert_eq!(auth, Mechanism::SignedKeyMaterial); // it got verified via shared key material -760 Ok(()) -761 } -762 -763 #[tokio::test] -764 #[traced_test] -765 async fn test_handshake_via_challenge() -> Result { -766 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -767 -768 let secret_key = SecretKey::from_bytes(&rng.random()); -769 let (client, server) = simulate_handshake(&secret_key, None, None, None).await; -770 client?; -771 let (public_key, auth) = server?; -772 assert_eq!(public_key, secret_key.public()); -773 assert_eq!(auth, Mechanism::SignedChallenge); -774 Ok(()) -775 } -776 -777 #[tokio::test] -778 #[traced_test] -779 async fn test_handshake_mismatching_shared_secrets() -> Result { -780 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -781 -782 let secret_key = SecretKey::from_bytes(&rng.random()); -783 // mismatching shared secrets *might* happen with HTTPS proxies that don't also middle-man the shared secret -784 let (client, server) = simulate_handshake(&secret_key, Some(10), Some(99), None).await; -785 client?; -786 let (public_key, auth) = server?; -787 assert_eq!(public_key, secret_key.public()); -788 assert_eq!(auth, Mechanism::SignedChallenge); -789 Ok(()) -790 } -791 -792 #[tokio::test] -793 #[traced_test] -794 async fn test_handshake_challenge_fallback() -> Result { -795 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -796 let secret_key = SecretKey::from_bytes(&rng.random()); -797 // clients might not have access to shared secrets -798 let (client, server) = simulate_handshake(&secret_key, None, Some(99), None).await; -799 client?; -800 let (public_key, auth) = server?; -801 assert_eq!(public_key, secret_key.public()); -802 assert_eq!(auth, Mechanism::SignedChallenge); -803 Ok(()) -804 } -805 -806 #[tokio::test] -807 #[traced_test] -808 async fn test_handshake_with_auth_positive() -> Result { -809 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -810 let secret_key = SecretKey::from_bytes(&rng.random()); -811 let public_key = secret_key.public(); -812 let (client, server) = simulate_handshake(&secret_key, None, None, Some(public_key)).await; -813 client?; -814 let (public_key, _) = server?; -815 assert_eq!(public_key, secret_key.public()); -816 Ok(()) -817 } -818 -819 #[tokio::test] -820 #[traced_test] -821 async fn test_handshake_with_auth_negative() -> Result { -822 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -823 let secret_key = SecretKey::from_bytes(&rng.random()); -824 let public_key = secret_key.public(); -825 let wrong_secret_key = SecretKey::from_bytes(&rng.random()); -826 let (client, server) = -827 simulate_handshake(&wrong_secret_key, None, None, Some(public_key)).await; -828 assert!(client.is_err()); -829 assert!(server.is_err()); -830 Ok(()) -831 } -832 -833 #[tokio::test] -834 #[traced_test] -835 async fn test_handshake_via_shared_secret_with_auth_negative() -> Result { -836 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -837 let secret_key = SecretKey::from_bytes(&rng.random()); -838 let public_key = secret_key.public(); -839 let wrong_secret_key = SecretKey::from_bytes(&rng.random()); -840 let (client, server) = -841 simulate_handshake(&wrong_secret_key, Some(42), Some(42), Some(public_key)).await; -842 assert!(client.is_err()); -843 assert!(server.is_err()); -844 Ok(()) -845 } -846 -847 #[test] -848 fn test_client_auth_roundtrip() -> Result { -849 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -850 let secret_key = SecretKey::from_bytes(&rng.random()); -851 let challenge = ServerChallenge::new(&mut rng); -852 let client_auth = ClientAuth::new(&secret_key, &challenge); -853 -854 let bytes = postcard::to_allocvec(&client_auth).anyerr()?; -855 let decoded: ClientAuth = postcard::from_bytes(&bytes).anyerr()?; -856 -857 assert_eq!(client_auth.public_key, decoded.public_key); -858 assert_eq!(client_auth.signature, decoded.signature); -859 -860 Ok(()) -861 } -862 -863 #[test] -864 fn test_km_client_auth_roundtrip() -> Result { -865 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -866 let secret_key = SecretKey::from_bytes(&rng.random()); -867 let client_auth = KeyMaterialClientAuth::new( -868 &secret_key, -869 &TestKeyingMaterial { -870 inner: (), -871 shared_secret: Some(42), -872 }, -873 ) -874 .anyerr()?; -875 -876 let bytes = postcard::to_allocvec(&client_auth).anyerr()?; -877 let decoded: KeyMaterialClientAuth = postcard::from_bytes(&bytes).anyerr()?; -878 -879 assert_eq!(client_auth.public_key, decoded.public_key); -880 assert_eq!(client_auth.signature, decoded.signature); -881 -882 Ok(()) -883 } -884 -885 #[test] -886 fn test_challenge_verification() -> Result { -887 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -888 let secret_key = SecretKey::from_bytes(&rng.random()); -889 let challenge = ServerChallenge::new(&mut rng); -890 let client_auth = ClientAuth::new(&secret_key, &challenge); -891 assert!(client_auth.verify(&challenge).is_ok()); -892 -893 Ok(()) -894 } -895 -896 #[test] -897 fn test_key_material_verification() -> Result { -898 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -899 let secret_key = SecretKey::from_bytes(&rng.random()); -900 let io = TestKeyingMaterial { -901 inner: (), -902 shared_secret: Some(42), -903 }; -904 let client_auth = KeyMaterialClientAuth::new(&secret_key, &io).anyerr()?; -905 assert!(client_auth.verify(&io).is_ok()); -906 -907 Ok(()) -908 } -909} \ No newline at end of file +684 fn poll_flush( +685 mut self: std::pin::Pin<&mut Self>, +686 cx: &mut std::task::Context<'_>, +687 ) -> std::task::Poll<Result<(), Self::Error>> { +688 std::pin::Pin::new(&mut self.inner).poll_flush(cx) +689 } +690 +691 fn poll_close( +692 mut self: std::pin::Pin<&mut Self>, +693 cx: &mut std::task::Context<'_>, +694 ) -> std::task::Poll<Result<(), Self::Error>> { +695 std::pin::Pin::new(&mut self.inner).poll_close(cx) +696 } +697 } +698 +699 async fn simulate_handshake( +700 secret_key: &SecretKey, +701 client_shared_secret: Option<u64>, +702 server_shared_secret: Option<u64>, +703 restricted_to: Option<PublicKey>, +704 ) -> (Result<ServerConfirmsAuth>, Result<(PublicKey, Mechanism)>) { +705 let (client, server) = tokio::io::duplex(1024); +706 +707 let mut client_io = Framed::new(client, LengthDelimitedCodec::new()) +708 .map_ok(BytesMut::freeze) +709 .map_err(AnyError::from_std) +710 .sink_map_err(AnyError::from_std) +711 .with_shared_secret(client_shared_secret); +712 let mut server_io = Framed::new(server, LengthDelimitedCodec::new()) +713 .map_ok(BytesMut::freeze) +714 .map_err(AnyError::from_std) +715 .sink_map_err(AnyError::from_std) +716 .with_shared_secret(server_shared_secret); +717 +718 let client_auth_header = KeyMaterialClientAuth::new(secret_key, &client_io) +719 .map(KeyMaterialClientAuth::into_header_value); +720 +721 n0_future::future::zip( +722 async { +723 super::clientside(&mut client_io, secret_key) +724 .await +725 .context("clientside") +726 } +727 .instrument(info_span!("clientside")), +728 async { +729 let auth_n = super::serverside(&mut server_io, client_auth_header) +730 .await +731 .context("serverside")?; +732 let mechanism = auth_n.mechanism; +733 let is_authorized = match restricted_to.is_none_or(|key| key == auth_n.client_key) { +734 true => Access::Allow, +735 false => Access::Deny { reason: None }, +736 }; +737 let key = auth_n.authorize_if(is_authorized, &mut server_io).await?; +738 Ok((key, mechanism)) +739 } +740 .instrument(info_span!("serverside")), +741 ) +742 .await +743 } +744 +745 #[tokio::test] +746 #[traced_test] +747 async fn test_handshake_via_shared_secrets() -> Result { +748 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +749 +750 let secret_key = SecretKey::from_bytes(&rng.random()); +751 let (client, server) = simulate_handshake(&secret_key, Some(42), Some(42), None).await; +752 client?; +753 let (public_key, auth) = server?; +754 assert_eq!(public_key, secret_key.public()); +755 assert_eq!(auth, Mechanism::SignedKeyMaterial); // it got verified via shared key material +756 Ok(()) +757 } +758 +759 #[tokio::test] +760 #[traced_test] +761 async fn test_handshake_via_challenge() -> Result { +762 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +763 +764 let secret_key = SecretKey::from_bytes(&rng.random()); +765 let (client, server) = simulate_handshake(&secret_key, None, None, None).await; +766 client?; +767 let (public_key, auth) = server?; +768 assert_eq!(public_key, secret_key.public()); +769 assert_eq!(auth, Mechanism::SignedChallenge); +770 Ok(()) +771 } +772 +773 #[tokio::test] +774 #[traced_test] +775 async fn test_handshake_mismatching_shared_secrets() -> Result { +776 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +777 +778 let secret_key = SecretKey::from_bytes(&rng.random()); +779 // mismatching shared secrets *might* happen with HTTPS proxies that don't also middle-man the shared secret +780 let (client, server) = simulate_handshake(&secret_key, Some(10), Some(99), None).await; +781 client?; +782 let (public_key, auth) = server?; +783 assert_eq!(public_key, secret_key.public()); +784 assert_eq!(auth, Mechanism::SignedChallenge); +785 Ok(()) +786 } +787 +788 #[tokio::test] +789 #[traced_test] +790 async fn test_handshake_challenge_fallback() -> Result { +791 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +792 let secret_key = SecretKey::from_bytes(&rng.random()); +793 // clients might not have access to shared secrets +794 let (client, server) = simulate_handshake(&secret_key, None, Some(99), None).await; +795 client?; +796 let (public_key, auth) = server?; +797 assert_eq!(public_key, secret_key.public()); +798 assert_eq!(auth, Mechanism::SignedChallenge); +799 Ok(()) +800 } +801 +802 #[tokio::test] +803 #[traced_test] +804 async fn test_handshake_with_auth_positive() -> Result { +805 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +806 let secret_key = SecretKey::from_bytes(&rng.random()); +807 let public_key = secret_key.public(); +808 let (client, server) = simulate_handshake(&secret_key, None, None, Some(public_key)).await; +809 client?; +810 let (public_key, _) = server?; +811 assert_eq!(public_key, secret_key.public()); +812 Ok(()) +813 } +814 +815 #[tokio::test] +816 #[traced_test] +817 async fn test_handshake_with_auth_negative() -> Result { +818 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +819 let secret_key = SecretKey::from_bytes(&rng.random()); +820 let public_key = secret_key.public(); +821 let wrong_secret_key = SecretKey::from_bytes(&rng.random()); +822 let (client, server) = +823 simulate_handshake(&wrong_secret_key, None, None, Some(public_key)).await; +824 assert!(client.is_err()); +825 assert!(server.is_err()); +826 Ok(()) +827 } +828 +829 #[tokio::test] +830 #[traced_test] +831 async fn test_handshake_via_shared_secret_with_auth_negative() -> Result { +832 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +833 let secret_key = SecretKey::from_bytes(&rng.random()); +834 let public_key = secret_key.public(); +835 let wrong_secret_key = SecretKey::from_bytes(&rng.random()); +836 let (client, server) = +837 simulate_handshake(&wrong_secret_key, Some(42), Some(42), Some(public_key)).await; +838 assert!(client.is_err()); +839 assert!(server.is_err()); +840 Ok(()) +841 } +842 +843 #[test] +844 fn test_client_auth_roundtrip() -> Result { +845 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +846 let secret_key = SecretKey::from_bytes(&rng.random()); +847 let challenge = ServerChallenge::new(&mut rng); +848 let client_auth = ClientAuth::new(&secret_key, &challenge); +849 +850 let bytes = postcard::to_allocvec(&client_auth).anyerr()?; +851 let decoded: ClientAuth = postcard::from_bytes(&bytes).anyerr()?; +852 +853 assert_eq!(client_auth.public_key, decoded.public_key); +854 assert_eq!(client_auth.signature, decoded.signature); +855 +856 Ok(()) +857 } +858 +859 #[test] +860 fn test_km_client_auth_roundtrip() -> Result { +861 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +862 let secret_key = SecretKey::from_bytes(&rng.random()); +863 let client_auth = KeyMaterialClientAuth::new( +864 &secret_key, +865 &TestKeyingMaterial { +866 inner: (), +867 shared_secret: Some(42), +868 }, +869 ) +870 .anyerr()?; +871 +872 let bytes = postcard::to_allocvec(&client_auth).anyerr()?; +873 let decoded: KeyMaterialClientAuth = postcard::from_bytes(&bytes).anyerr()?; +874 +875 assert_eq!(client_auth.public_key, decoded.public_key); +876 assert_eq!(client_auth.signature, decoded.signature); +877 +878 Ok(()) +879 } +880 +881 #[test] +882 fn test_challenge_verification() -> Result { +883 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +884 let secret_key = SecretKey::from_bytes(&rng.random()); +885 let challenge = ServerChallenge::new(&mut rng); +886 let client_auth = ClientAuth::new(&secret_key, &challenge); +887 assert!(client_auth.verify(&challenge).is_ok()); +888 +889 Ok(()) +890 } +891 +892 #[test] +893 fn test_key_material_verification() -> Result { +894 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +895 let secret_key = SecretKey::from_bytes(&rng.random()); +896 let io = TestKeyingMaterial { +897 inner: (), +898 shared_secret: Some(42), +899 }; +900 let client_auth = KeyMaterialClientAuth::new(&secret_key, &io).anyerr()?; +901 assert!(client_auth.verify(&io).is_ok()); +902 +903 Ok(()) +904 } +905} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh_relay/server.rs.html b/pr/4036/docs/src/iroh_relay/server.rs.html index 055923e8dc..dfc844c87e 100644 --- a/pr/4036/docs/src/iroh_relay/server.rs.html +++ b/pr/4036/docs/src/iroh_relay/server.rs.html @@ -465,7 +465,7 @@ 465 /// the main relay server this has to be on a different port. When TLS is not enabled 466 /// this is served on the [`RelayConfig::http_bind_addr`] socket address. 467 /// -468 /// Normally you'd choose port `80`. +468 /// Normally you'd choose port `443`. 469 pub https_bind_addr: SocketAddr, 470 /// Mode for getting a cert. 471 pub cert: CertConfig, @@ -486,1125 +486,1129 @@ 486#[derive(Debug, Default)] 487#[non_exhaustive] 488pub struct Limits { -489 /// Rate limit for accepting new connection. Unlimited if not set. -490 pub accept_conn_limit: Option<f64>, -491 /// Burst limit for accepting new connection. Unlimited if not set. -492 pub accept_conn_burst: Option<usize>, -493 /// Rate limits for incoming traffic from a client connection. -494 pub client_rx: Option<ClientRateLimit>, -495} -496 -497/// Per-client rate limit configuration. -498#[derive(Debug, Copy, Clone)] -499#[non_exhaustive] -500pub struct ClientRateLimit { -501 /// Max number of bytes per second to read from the client connection. -502 pub bytes_per_second: NonZeroU32, -503 /// Max number of bytes to read in a single burst. -504 pub max_burst_bytes: Option<NonZeroU32>, -505} -506 -507impl ClientRateLimit { -508 /// Creates a new [`ClientRateLimit`] with the given byte rate. -509 /// -510 /// `max_burst_bytes` is left unset; assign it after construction to allow bursting. -511 pub fn new(bytes_per_second: NonZeroU32) -> Self { -512 Self { -513 bytes_per_second, -514 max_burst_bytes: None, -515 } -516 } -517} -518 -519/// TLS certificate configuration. -520#[derive(Debug)] -521#[non_exhaustive] -522pub enum CertConfig { -523 /// Use Let's Encrypt. -524 LetsEncrypt { -525 /// Configuration for the ACME client. -526 acme_config: AcmeConfig, -527 /// Builder for the [`rustls::ServerConfig`]. -528 /// -529 /// The ACME resolver will be injected when starting the server. -530 server_config_builder: rustls::ConfigBuilder<rustls::ServerConfig, WantsServerCert>, -531 }, -532 /// Use a TLS key and certificate chain that can be reloaded. -533 Manual { -534 /// The [`rustls::ServerConfig`] to use. -535 /// -536 /// This needs to have the certificates or a certificate loader, it will be used by the server as-is. -537 server_config: rustls::ServerConfig, -538 }, -539} -540 -541/// Configuration for the ACME client. -542#[derive(Debug, Clone)] -543pub struct AcmeConfig { -544 pub(crate) directory_url: String, -545 pub(crate) domains: Vec<String>, -546 pub(crate) contact: Vec<String>, -547 pub(crate) cache_path: Option<PathBuf>, -548} -549 -550impl AcmeConfig { -551 /// Creates a new [`AcmeConfig`] with a ACME directory URL. -552 pub fn new(directory_url: String) -> Self { -553 Self { -554 directory_url, -555 domains: Vec::new(), -556 contact: Vec::new(), -557 cache_path: None, -558 } -559 } -560 -561 /// Creates a new [`AcmeConfig`] with the Let's Encrypt directory URL. -562 pub fn letsencrypt(production: bool) -> Self { -563 let url = if production { -564 LETS_ENCRYPT_PRODUCTION_DIRECTORY -565 } else { -566 LETS_ENCRYPT_STAGING_DIRECTORY -567 }; -568 Self::new(url.to_string()) -569 } -570 -571 /// Provides the list of domains for which certificates should be obtained. -572 pub fn domains(mut self, domains: Vec<String>) -> Self { -573 self.domains = domains; -574 self -575 } -576 -577 /// Provides a list of contacts for the account. -578 /// -579 /// Note that email addresses must include a `mailto:` prefix. -580 pub fn contact(mut self, contact: Vec<String>) -> Self { -581 self.contact = contact; -582 self -583 } -584 -585 /// Sets the directory where to cache certificates. -586 /// -587 /// If not called certificates will not be cached. -588 pub fn cache_path(mut self, path: PathBuf) -> Self { -589 self.cache_path = Some(path); -590 self -591 } -592} -593 -594/// A running Relay + QAD server. -595/// -596/// This is a full Relay server, including QAD, Relay and various associated HTTP services. -597/// -598/// Dropping this will stop the server. -599#[derive(Debug)] -600pub struct Server { -601 /// The address of the HTTP server, if configured. -602 http_addr: Option<SocketAddr>, -603 /// The address of the HTTPS server, if the relay server is using TLS. -604 /// -605 /// If the Relay server is not using TLS then it is served from the -606 /// [`Server::http_addr`]. -607 https_addr: Option<SocketAddr>, -608 /// The address of the QUIC server, if configured. -609 quic_addr: Option<SocketAddr>, -610 /// Handle to the relay server. -611 relay_handle: Option<http_server::ServerHandle>, -612 /// Handle to the relay service for runtime control. -613 relay_service: Option<http_server::RelayService>, -614 /// Handle to the quic server. -615 quic_handle: Option<QuicServerHandle>, -616 /// The main task running the server. -617 supervisor: AbortOnDropHandle<Result<(), SupervisorError>>, -618 metrics: RelayMetrics, -619 metrics_server: Option<iroh_metrics::service::MetricsServer>, -620} -621 -622/// Server spawn errors -623#[allow(missing_docs)] -624#[stack_error(derive, add_meta, std_sources)] -625#[non_exhaustive] -626pub enum SpawnError { -627 #[error("Unable to get local address")] -628 LocalAddr { source: std::io::Error }, -629 #[error("Failed to bind QAD listener")] -630 QuicSpawn { source: QuicSpawnError }, -631 #[error("Failed to parse TLS header")] -632 TlsHeaderParse { source: InvalidHeaderValue }, -633 #[error("Failed to bind TcpListener")] -634 BindTlsListener { source: std::io::Error }, -635 #[error("No local address")] -636 NoLocalAddr { source: std::io::Error }, -637 #[error("Failed to bind server socket to {addr}")] -638 BindTcpListener { -639 source: std::io::Error, -640 addr: SocketAddr, -641 }, -642 #[error("Error starting metrics server")] -643 Metrics { -644 #[error(std_err)] -645 source: std::io::Error, -646 }, -647} -648 -649/// Server task errors -650#[allow(missing_docs)] -651#[stack_error(derive, add_meta)] -652#[non_exhaustive] -653pub enum SupervisorError { -654 #[error("Acme event stream finished")] -655 AcmeEventStreamFinished {}, -656 #[error(transparent)] -657 JoinError { -658 #[error(from, std_err)] -659 source: JoinError, -660 }, -661 #[error("No relay services are enabled")] -662 NoRelayServicesEnabled {}, -663 #[error("Task cancelled")] -664 TaskCancelled {}, -665} -666 -667impl Server { -668 /// Starts the server. -669 pub async fn spawn(config: ServerConfig) -> Result<Self, SpawnError> { -670 let mut tasks = JoinSet::new(); -671 -672 let metrics = RelayMetrics::default(); -673 -674 #[cfg(not(feature = "metrics"))] -675 let metrics_server = None; -676 -677 #[cfg(feature = "metrics")] -678 let metrics_server = if let Some(addr) = config.metrics_addr { -679 debug!("Starting metrics server"); -680 let mut registry = iroh_metrics::Registry::default(); -681 registry.register_all(&metrics); -682 let server = iroh_metrics::service::MetricsServer::spawn(addr, Arc::new(registry)) -683 .await -684 .map_err(|err| e!(SpawnError::Metrics, err))?; -685 Some(server) -686 } else { -687 None -688 }; -689 -690 let (relay_server, http_addr, tls_config) = match config.relay { -691 Some(relay_config) => { -692 debug!("Starting Relay server"); -693 let mut headers = HeaderMap::new(); -694 for (name, value) in TLS_HEADERS.iter() { -695 headers.insert( -696 *name, -697 value -698 .parse() -699 .map_err(|err| e!(SpawnError::TlsHeaderParse, err))?, -700 ); -701 } -702 let relay_bind_addr = match relay_config.tls { -703 Some(ref tls) => tls.https_bind_addr, -704 None => relay_config.http_bind_addr, -705 }; -706 let key_cache_capacity = relay_config -707 .key_cache_capacity -708 .unwrap_or(DEFAULT_KEY_CACHE_CAPACITY); -709 let mut builder = http_server::ServerBuilder::new(relay_bind_addr) -710 .metrics(metrics.server.clone()) -711 .headers(headers) -712 .key_cache_capacity(key_cache_capacity) -713 .access(relay_config.access) -714 .request_handler(Method::GET, "/", Box::new(root_handler)) -715 .request_handler(Method::GET, "/index.html", Box::new(root_handler)) -716 .request_handler(Method::GET, RELAY_PROBE_PATH, Box::new(probe_handler)) -717 .request_handler(Method::GET, "/robots.txt", Box::new(robots_handler)) -718 .request_handler(Method::GET, "/healthz", Box::new(healthz_handler)); -719 if let Some(cfg) = relay_config.limits.client_rx { -720 builder = builder.client_rx_ratelimit(cfg); -721 } -722 let (http_addr, tls_config) = match relay_config.tls { -723 Some(tls_config) => { -724 let server_tls_config = match tls_config.cert { -725 CertConfig::LetsEncrypt { -726 acme_config, -727 server_config_builder, -728 } => { -729 let cache = acme_config.cache_path.map(DirCache::new); -730 let config = -731 tokio_rustls_acme::AcmeConfig::new(acme_config.domains) -732 .contact(acme_config.contact) -733 .directory(acme_config.directory_url) -734 .cache_option(cache); -735 let mut state = config.state(); -736 let resolver = state.resolver().clone(); -737 let server_config = -738 server_config_builder.with_cert_resolver(resolver); -739 let acceptor = -740 http_server::TlsAcceptor::LetsEncrypt(state.acceptor()); -741 tasks.spawn( -742 async move { -743 while let Some(event) = state.next().await { -744 match event { -745 Ok(ok) => debug!("acme event: {ok:?}"), -746 Err(err) => error!("error: {err:?}"), -747 } -748 } -749 Err(e!(SupervisorError::AcmeEventStreamFinished)) -750 } -751 .instrument(info_span!("acme")), -752 ); -753 http_server::TlsConfig { -754 config: Arc::new(server_config), -755 acceptor, -756 } -757 } -758 CertConfig::Manual { server_config } => { -759 let server_config = Arc::new(server_config); -760 let acceptor = -761 tokio_rustls::TlsAcceptor::from(server_config.clone()); -762 let acceptor = http_server::TlsAcceptor::Manual(acceptor); -763 http_server::TlsConfig { -764 config: server_config, -765 acceptor, -766 } -767 } -768 }; -769 builder = builder.tls_config(Some(server_tls_config.clone())); -770 -771 // Some services always need to be served over HTTP without TLS. Run -772 // these standalone. -773 let http_listener = TcpListener::bind(&relay_config.http_bind_addr) -774 .await -775 .map_err(|err| e!(SpawnError::BindTlsListener, err))?; -776 let http_addr = http_listener -777 .local_addr() -778 .map_err(|err| e!(SpawnError::NoLocalAddr, err))?; -779 tasks.spawn( -780 async move { -781 run_captive_portal_service(http_listener).await; -782 Ok(()) -783 } -784 .instrument(info_span!("http-service", addr = %http_addr)), -785 ); -786 (Some(http_addr), Some(server_tls_config)) -787 } -788 None => { -789 // If running Relay without TLS add the plain HTTP server directly -790 // to the Relay server. -791 builder = builder.request_handler( -792 Method::GET, -793 "/generate_204", -794 Box::new(serve_no_content_handler), -795 ); -796 (None, None) -797 } -798 }; -799 let relay_server = builder.spawn().await?; -800 (Some(relay_server), http_addr, tls_config) -801 } -802 None => (None, None, None), -803 }; -804 // If http_addr is Some then relay_server is serving HTTPS. If http_addr is None -805 // relay_server is serving HTTP, including the /generate_204 service. -806 let relay_addr = relay_server.as_ref().map(|srv| srv.addr()); -807 let relay_handle = relay_server.as_ref().map(|srv| srv.handle()); -808 let relay_service = relay_server.as_ref().map(|srv| srv.service().clone()); -809 -810 let quic_server = match config.quic { -811 Some(quic_config) => { -812 debug!("Starting QUIC server {}", quic_config.bind_addr); -813 let server_config = quic_config -814 .server_config -815 .or(tls_config.map(|config| (*config.config).clone())) -816 .ok_or_else(|| { -817 e!(SpawnError::QuicSpawn, e!(QuicSpawnError::TlsNotConfigured)) -818 })?; -819 Some( -820 QuicServer::spawn(quic_config.bind_addr, server_config, metrics.server.clone()) -821 .map_err(|err| e!(SpawnError::QuicSpawn, err))?, -822 ) -823 } -824 None => None, -825 }; -826 let quic_addr = quic_server.as_ref().map(|srv| srv.bind_addr()); -827 let quic_handle = quic_server.as_ref().map(|srv| srv.handle()); -828 -829 let task = tokio::spawn(relay_supervisor(tasks, relay_server, quic_server)); -830 -831 Ok(Self { -832 http_addr: http_addr.or(relay_addr), -833 https_addr: http_addr.and(relay_addr), -834 quic_addr, -835 relay_handle, -836 relay_service, -837 quic_handle, -838 supervisor: AbortOnDropHandle::new(task), -839 metrics, -840 metrics_server, -841 }) -842 } -843 -844 /// Requests graceful shutdown. -845 /// -846 /// Returns once all server tasks have stopped. -847 pub async fn shutdown(self) -> Result<(), SupervisorError> { -848 // Only the Relay server and QUIC server need shutting down, the supervisor will abort the tasks in -849 // the JoinSet when the server terminates. -850 if let Some(handle) = self.relay_handle { -851 handle.shutdown(); -852 } -853 if let Some(handle) = self.quic_handle { -854 handle.shutdown(); -855 } -856 if let Some(server) = self.metrics_server { -857 server.shutdown().await; -858 } -859 self.supervisor.await? -860 } -861 -862 /// Waits for the server's supervisor task to finish. -863 /// -864 /// Returns the exit result of the supervisor task. Unlike [`Self::shutdown`], this does -865 /// *not* request shutdown, it only waits for the server to terminate on its own (for -866 /// example, after an internal error or because the supervisor was aborted from -867 /// elsewhere). The outer [`JoinError`] is only produced if the supervisor task itself -868 /// panics or is aborted. -869 pub async fn join(&mut self) -> Result<Result<(), SupervisorError>, JoinError> { -870 (&mut self.supervisor).await -871 } -872 -873 /// The socket address the HTTPS server is listening on. -874 pub fn https_addr(&self) -> Option<SocketAddr> { -875 self.https_addr -876 } -877 -878 /// The socket address the HTTP server is listening on. -879 pub fn http_addr(&self) -> Option<SocketAddr> { -880 self.http_addr -881 } -882 -883 /// The socket address the QUIC server is listening on. -884 pub fn quic_addr(&self) -> Option<SocketAddr> { -885 self.quic_addr -886 } -887 -888 /// Get the server's https [`RelayUrl`]. -889 /// -890 /// This uses [`Self::https_addr`] so it's mostly useful for local development. -891 #[cfg(feature = "test-utils")] -892 pub fn https_url(&self) -> Option<RelayUrl> { -893 self.https_addr.map(|addr| { -894 url::Url::parse(&format!("https://{addr}")) -895 .expect("valid url") -896 .into() -897 }) -898 } -899 -900 /// Get the server's http [`RelayUrl`]. -901 /// -902 /// This uses [`Self::http_addr`] so it's mostly useful for local development. -903 #[cfg(feature = "test-utils")] -904 pub fn http_url(&self) -> Option<RelayUrl> { -905 self.http_addr.map(|addr| { -906 url::Url::parse(&format!("http://{addr}")) -907 .expect("valid url") -908 .into() -909 }) -910 } -911 -912 /// Returns the metrics collected in the relay server. -913 pub fn metrics(&self) -> &RelayMetrics { -914 &self.metrics -915 } -916 -917 /// Returns a handle to the embedded [`RelayService`] for runtime control. -918 pub fn relay_service(&self) -> Option<&RelayService> { -919 self.relay_service.as_ref() -920 } -921} -922 -923/// Supervisor for the relay server tasks. -924/// -925/// As soon as one of the tasks exits, all other tasks are stopped and the server stops. -926/// The supervisor finishes once all tasks are finished. -927#[instrument(skip_all)] -928async fn relay_supervisor( -929 mut tasks: JoinSet<Result<(), SupervisorError>>, -930 mut relay_http_server: Option<http_server::Server>, -931 mut quic_server: Option<QuicServer>, -932) -> Result<(), SupervisorError> { -933 let quic_enabled = quic_server.is_some(); -934 let mut quic_fut = match quic_server { -935 Some(ref mut server) => n0_future::Either::Left(server.task_handle()), -936 None => n0_future::Either::Right(n0_future::future::pending()), -937 }; -938 let relay_enabled = relay_http_server.is_some(); -939 let mut relay_fut = match relay_http_server { -940 Some(ref mut server) => n0_future::Either::Left(server.task_handle()), -941 None => n0_future::Either::Right(n0_future::future::pending()), -942 }; -943 let res = tokio::select! { -944 biased; -945 Some(ret) = tasks.join_next() => ret, -946 ret = &mut quic_fut, if quic_enabled => ret.map(Ok), -947 ret = &mut relay_fut, if relay_enabled => ret.map(Ok), -948 else => Ok(Err(e!(SupervisorError::NoRelayServicesEnabled))), -949 }; -950 let ret = match res { -951 Ok(Ok(())) => { -952 debug!("Task exited"); -953 Ok(()) -954 } -955 Ok(Err(err)) => { -956 error!(%err, "Task failed"); -957 Err(err) +489 /// Rate limits for incoming traffic from a client connection. +490 pub client_rx: Option<ClientRateLimit>, +491 /// Rate limit for accepting new connections. Unlimited if not set. +492 /// +493 /// Not currently implemented, setting this has no effect. +494 pub accept_conn_limit: Option<f64>, +495 /// Burst limit for accepting new connections. Unlimited if not set. +496 /// +497 /// Not currently implemented, setting this has no effect. +498 pub accept_conn_burst: Option<usize>, +499} +500 +501/// Per-client rate limit configuration. +502#[derive(Debug, Copy, Clone)] +503#[non_exhaustive] +504pub struct ClientRateLimit { +505 /// Max number of bytes per second to read from the client connection. +506 pub bytes_per_second: NonZeroU32, +507 /// Max number of bytes to read in a single burst. +508 pub max_burst_bytes: Option<NonZeroU32>, +509} +510 +511impl ClientRateLimit { +512 /// Creates a new [`ClientRateLimit`] with the given byte rate. +513 /// +514 /// `max_burst_bytes` is left unset; assign it after construction to allow bursting. +515 pub fn new(bytes_per_second: NonZeroU32) -> Self { +516 Self { +517 bytes_per_second, +518 max_burst_bytes: None, +519 } +520 } +521} +522 +523/// TLS certificate configuration. +524#[derive(Debug)] +525#[non_exhaustive] +526pub enum CertConfig { +527 /// Use Let's Encrypt. +528 LetsEncrypt { +529 /// Configuration for the ACME client. +530 acme_config: AcmeConfig, +531 /// Builder for the [`rustls::ServerConfig`]. +532 /// +533 /// The ACME resolver will be injected when starting the server. +534 server_config_builder: rustls::ConfigBuilder<rustls::ServerConfig, WantsServerCert>, +535 }, +536 /// Use a TLS key and certificate chain that can be reloaded. +537 Manual { +538 /// The [`rustls::ServerConfig`] to use. +539 /// +540 /// This needs to have the certificates or a certificate loader, it will be used by the server as-is. +541 server_config: rustls::ServerConfig, +542 }, +543} +544 +545/// Configuration for the ACME client. +546#[derive(Debug, Clone)] +547pub struct AcmeConfig { +548 pub(crate) directory_url: String, +549 pub(crate) domains: Vec<String>, +550 pub(crate) contact: Vec<String>, +551 pub(crate) cache_path: Option<PathBuf>, +552} +553 +554impl AcmeConfig { +555 /// Creates a new [`AcmeConfig`] with a ACME directory URL. +556 pub fn new(directory_url: String) -> Self { +557 Self { +558 directory_url, +559 domains: Vec::new(), +560 contact: Vec::new(), +561 cache_path: None, +562 } +563 } +564 +565 /// Creates a new [`AcmeConfig`] with the Let's Encrypt directory URL. +566 pub fn letsencrypt(production: bool) -> Self { +567 let url = if production { +568 LETS_ENCRYPT_PRODUCTION_DIRECTORY +569 } else { +570 LETS_ENCRYPT_STAGING_DIRECTORY +571 }; +572 Self::new(url.to_string()) +573 } +574 +575 /// Provides the list of domains for which certificates should be obtained. +576 pub fn domains(mut self, domains: Vec<String>) -> Self { +577 self.domains = domains; +578 self +579 } +580 +581 /// Provides a list of contacts for the account. +582 /// +583 /// Note that email addresses must include a `mailto:` prefix. +584 pub fn contact(mut self, contact: Vec<String>) -> Self { +585 self.contact = contact; +586 self +587 } +588 +589 /// Sets the directory where to cache certificates. +590 /// +591 /// If not called certificates will not be cached. +592 pub fn cache_path(mut self, path: PathBuf) -> Self { +593 self.cache_path = Some(path); +594 self +595 } +596} +597 +598/// A running Relay + QAD server. +599/// +600/// This is a full Relay server, including QAD, Relay and various associated HTTP services. +601/// +602/// Dropping this will stop the server. +603#[derive(Debug)] +604pub struct Server { +605 /// The address of the HTTP server, if configured. +606 http_addr: Option<SocketAddr>, +607 /// The address of the HTTPS server, if the relay server is using TLS. +608 /// +609 /// If the Relay server is not using TLS then it is served from the +610 /// [`Server::http_addr`]. +611 https_addr: Option<SocketAddr>, +612 /// The address of the QUIC server, if configured. +613 quic_addr: Option<SocketAddr>, +614 /// Handle to the relay server. +615 relay_handle: Option<http_server::ServerHandle>, +616 /// Handle to the relay service for runtime control. +617 relay_service: Option<http_server::RelayService>, +618 /// Handle to the quic server. +619 quic_handle: Option<QuicServerHandle>, +620 /// The main task running the server. +621 supervisor: AbortOnDropHandle<Result<(), SupervisorError>>, +622 metrics: RelayMetrics, +623 metrics_server: Option<iroh_metrics::service::MetricsServer>, +624} +625 +626/// Server spawn errors +627#[allow(missing_docs)] +628#[stack_error(derive, add_meta, std_sources)] +629#[non_exhaustive] +630pub enum SpawnError { +631 #[error("Unable to get local address")] +632 LocalAddr { source: std::io::Error }, +633 #[error("Failed to bind QAD listener")] +634 QuicSpawn { source: QuicSpawnError }, +635 #[error("Failed to parse TLS header")] +636 TlsHeaderParse { source: InvalidHeaderValue }, +637 #[error("Failed to bind TcpListener")] +638 BindTlsListener { source: std::io::Error }, +639 #[error("No local address")] +640 NoLocalAddr { source: std::io::Error }, +641 #[error("Failed to bind server socket to {addr}")] +642 BindTcpListener { +643 source: std::io::Error, +644 addr: SocketAddr, +645 }, +646 #[error("Error starting metrics server")] +647 Metrics { +648 #[error(std_err)] +649 source: std::io::Error, +650 }, +651} +652 +653/// Server task errors +654#[allow(missing_docs)] +655#[stack_error(derive, add_meta)] +656#[non_exhaustive] +657pub enum SupervisorError { +658 #[error("Acme event stream finished")] +659 AcmeEventStreamFinished {}, +660 #[error(transparent)] +661 JoinError { +662 #[error(from, std_err)] +663 source: JoinError, +664 }, +665 #[error("No relay services are enabled")] +666 NoRelayServicesEnabled {}, +667 #[error("Task cancelled")] +668 TaskCancelled {}, +669} +670 +671impl Server { +672 /// Starts the server. +673 pub async fn spawn(config: ServerConfig) -> Result<Self, SpawnError> { +674 let mut tasks = JoinSet::new(); +675 +676 let metrics = RelayMetrics::default(); +677 +678 #[cfg(not(feature = "metrics"))] +679 let metrics_server = None; +680 +681 #[cfg(feature = "metrics")] +682 let metrics_server = if let Some(addr) = config.metrics_addr { +683 debug!("Starting metrics server"); +684 let mut registry = iroh_metrics::Registry::default(); +685 registry.register_all(&metrics); +686 let server = iroh_metrics::service::MetricsServer::spawn(addr, Arc::new(registry)) +687 .await +688 .map_err(|err| e!(SpawnError::Metrics, err))?; +689 Some(server) +690 } else { +691 None +692 }; +693 +694 let (relay_server, http_addr, tls_config) = match config.relay { +695 Some(relay_config) => { +696 debug!("Starting Relay server"); +697 let mut headers = HeaderMap::new(); +698 for (name, value) in TLS_HEADERS.iter() { +699 headers.insert( +700 *name, +701 value +702 .parse() +703 .map_err(|err| e!(SpawnError::TlsHeaderParse, err))?, +704 ); +705 } +706 let relay_bind_addr = match relay_config.tls { +707 Some(ref tls) => tls.https_bind_addr, +708 None => relay_config.http_bind_addr, +709 }; +710 let key_cache_capacity = relay_config +711 .key_cache_capacity +712 .unwrap_or(DEFAULT_KEY_CACHE_CAPACITY); +713 let mut builder = http_server::ServerBuilder::new(relay_bind_addr) +714 .metrics(metrics.server.clone()) +715 .headers(headers) +716 .key_cache_capacity(key_cache_capacity) +717 .access(relay_config.access) +718 .request_handler(Method::GET, "/", Box::new(root_handler)) +719 .request_handler(Method::GET, "/index.html", Box::new(root_handler)) +720 .request_handler(Method::GET, RELAY_PROBE_PATH, Box::new(probe_handler)) +721 .request_handler(Method::GET, "/robots.txt", Box::new(robots_handler)) +722 .request_handler(Method::GET, "/healthz", Box::new(healthz_handler)); +723 if let Some(cfg) = relay_config.limits.client_rx { +724 builder = builder.client_rx_ratelimit(cfg); +725 } +726 let (http_addr, tls_config) = match relay_config.tls { +727 Some(tls_config) => { +728 let server_tls_config = match tls_config.cert { +729 CertConfig::LetsEncrypt { +730 acme_config, +731 server_config_builder, +732 } => { +733 let cache = acme_config.cache_path.map(DirCache::new); +734 let config = +735 tokio_rustls_acme::AcmeConfig::new(acme_config.domains) +736 .contact(acme_config.contact) +737 .directory(acme_config.directory_url) +738 .cache_option(cache); +739 let mut state = config.state(); +740 let resolver = state.resolver().clone(); +741 let server_config = +742 server_config_builder.with_cert_resolver(resolver); +743 let acceptor = +744 http_server::TlsAcceptor::LetsEncrypt(state.acceptor()); +745 tasks.spawn( +746 async move { +747 while let Some(event) = state.next().await { +748 match event { +749 Ok(ok) => debug!("acme event: {ok:?}"), +750 Err(err) => error!("error: {err:?}"), +751 } +752 } +753 Err(e!(SupervisorError::AcmeEventStreamFinished)) +754 } +755 .instrument(info_span!("acme")), +756 ); +757 http_server::TlsConfig { +758 config: Arc::new(server_config), +759 acceptor, +760 } +761 } +762 CertConfig::Manual { server_config } => { +763 let server_config = Arc::new(server_config); +764 let acceptor = +765 tokio_rustls::TlsAcceptor::from(server_config.clone()); +766 let acceptor = http_server::TlsAcceptor::Manual(acceptor); +767 http_server::TlsConfig { +768 config: server_config, +769 acceptor, +770 } +771 } +772 }; +773 builder = builder.tls_config(Some(server_tls_config.clone())); +774 +775 // Some services always need to be served over HTTP without TLS. Run +776 // these standalone. +777 let http_listener = TcpListener::bind(&relay_config.http_bind_addr) +778 .await +779 .map_err(|err| e!(SpawnError::BindTlsListener, err))?; +780 let http_addr = http_listener +781 .local_addr() +782 .map_err(|err| e!(SpawnError::NoLocalAddr, err))?; +783 tasks.spawn( +784 async move { +785 run_captive_portal_service(http_listener).await; +786 Ok(()) +787 } +788 .instrument(info_span!("http-service", addr = %http_addr)), +789 ); +790 (Some(http_addr), Some(server_tls_config)) +791 } +792 None => { +793 // If running Relay without TLS add the plain HTTP server directly +794 // to the Relay server. +795 builder = builder.request_handler( +796 Method::GET, +797 "/generate_204", +798 Box::new(serve_no_content_handler), +799 ); +800 (None, None) +801 } +802 }; +803 let relay_server = builder.spawn().await?; +804 (Some(relay_server), http_addr, tls_config) +805 } +806 None => (None, None, None), +807 }; +808 // If http_addr is Some then relay_server is serving HTTPS. If http_addr is None +809 // relay_server is serving HTTP, including the /generate_204 service. +810 let relay_addr = relay_server.as_ref().map(|srv| srv.addr()); +811 let relay_handle = relay_server.as_ref().map(|srv| srv.handle()); +812 let relay_service = relay_server.as_ref().map(|srv| srv.service().clone()); +813 +814 let quic_server = match config.quic { +815 Some(quic_config) => { +816 debug!("Starting QUIC server {}", quic_config.bind_addr); +817 let server_config = quic_config +818 .server_config +819 .or(tls_config.map(|config| (*config.config).clone())) +820 .ok_or_else(|| { +821 e!(SpawnError::QuicSpawn, e!(QuicSpawnError::TlsNotConfigured)) +822 })?; +823 Some( +824 QuicServer::spawn(quic_config.bind_addr, server_config, metrics.server.clone()) +825 .map_err(|err| e!(SpawnError::QuicSpawn, err))?, +826 ) +827 } +828 None => None, +829 }; +830 let quic_addr = quic_server.as_ref().map(|srv| srv.bind_addr()); +831 let quic_handle = quic_server.as_ref().map(|srv| srv.handle()); +832 +833 let task = tokio::spawn(relay_supervisor(tasks, relay_server, quic_server)); +834 +835 Ok(Self { +836 http_addr: http_addr.or(relay_addr), +837 https_addr: http_addr.and(relay_addr), +838 quic_addr, +839 relay_handle, +840 relay_service, +841 quic_handle, +842 supervisor: AbortOnDropHandle::new(task), +843 metrics, +844 metrics_server, +845 }) +846 } +847 +848 /// Requests graceful shutdown. +849 /// +850 /// Returns once all server tasks have stopped. +851 pub async fn shutdown(self) -> Result<(), SupervisorError> { +852 // Only the Relay server and QUIC server need shutting down, the supervisor will abort the tasks in +853 // the JoinSet when the server terminates. +854 if let Some(handle) = self.relay_handle { +855 handle.shutdown(); +856 } +857 if let Some(handle) = self.quic_handle { +858 handle.shutdown(); +859 } +860 if let Some(server) = self.metrics_server { +861 server.shutdown().await; +862 } +863 self.supervisor.await? +864 } +865 +866 /// Waits for the server's supervisor task to finish. +867 /// +868 /// Returns the exit result of the supervisor task. Unlike [`Self::shutdown`], this does +869 /// *not* request shutdown, it only waits for the server to terminate on its own (for +870 /// example, after an internal error or because the supervisor was aborted from +871 /// elsewhere). The outer [`JoinError`] is only produced if the supervisor task itself +872 /// panics or is aborted. +873 pub async fn join(&mut self) -> Result<Result<(), SupervisorError>, JoinError> { +874 (&mut self.supervisor).await +875 } +876 +877 /// The socket address the HTTPS server is listening on. +878 pub fn https_addr(&self) -> Option<SocketAddr> { +879 self.https_addr +880 } +881 +882 /// The socket address the HTTP server is listening on. +883 pub fn http_addr(&self) -> Option<SocketAddr> { +884 self.http_addr +885 } +886 +887 /// The socket address the QUIC server is listening on. +888 pub fn quic_addr(&self) -> Option<SocketAddr> { +889 self.quic_addr +890 } +891 +892 /// Get the server's https [`RelayUrl`]. +893 /// +894 /// This uses [`Self::https_addr`] so it's mostly useful for local development. +895 #[cfg(feature = "test-utils")] +896 pub fn https_url(&self) -> Option<RelayUrl> { +897 self.https_addr.map(|addr| { +898 url::Url::parse(&format!("https://{addr}")) +899 .expect("valid url") +900 .into() +901 }) +902 } +903 +904 /// Get the server's http [`RelayUrl`]. +905 /// +906 /// This uses [`Self::http_addr`] so it's mostly useful for local development. +907 #[cfg(feature = "test-utils")] +908 pub fn http_url(&self) -> Option<RelayUrl> { +909 self.http_addr.map(|addr| { +910 url::Url::parse(&format!("http://{addr}")) +911 .expect("valid url") +912 .into() +913 }) +914 } +915 +916 /// Returns the metrics collected in the relay server. +917 pub fn metrics(&self) -> &RelayMetrics { +918 &self.metrics +919 } +920 +921 /// Returns a handle to the embedded [`RelayService`] for runtime control. +922 pub fn relay_service(&self) -> Option<&RelayService> { +923 self.relay_service.as_ref() +924 } +925} +926 +927/// Supervisor for the relay server tasks. +928/// +929/// As soon as one of the tasks exits, all other tasks are stopped and the server stops. +930/// The supervisor finishes once all tasks are finished. +931#[instrument(skip_all)] +932async fn relay_supervisor( +933 mut tasks: JoinSet<Result<(), SupervisorError>>, +934 mut relay_http_server: Option<http_server::Server>, +935 mut quic_server: Option<QuicServer>, +936) -> Result<(), SupervisorError> { +937 let quic_enabled = quic_server.is_some(); +938 let mut quic_fut = match quic_server { +939 Some(ref mut server) => n0_future::Either::Left(server.task_handle()), +940 None => n0_future::Either::Right(n0_future::future::pending()), +941 }; +942 let relay_enabled = relay_http_server.is_some(); +943 let mut relay_fut = match relay_http_server { +944 Some(ref mut server) => n0_future::Either::Left(server.task_handle()), +945 None => n0_future::Either::Right(n0_future::future::pending()), +946 }; +947 let res = tokio::select! { +948 biased; +949 Some(ret) = tasks.join_next() => ret, +950 ret = &mut quic_fut, if quic_enabled => ret.map(Ok), +951 ret = &mut relay_fut, if relay_enabled => ret.map(Ok), +952 else => Ok(Err(e!(SupervisorError::NoRelayServicesEnabled))), +953 }; +954 let ret = match res { +955 Ok(Ok(())) => { +956 debug!("Task exited"); +957 Ok(()) 958 } -959 Err(err) => { -960 if let Ok(panic) = err.try_into_panic() { -961 error!("Task panicked"); -962 std::panic::resume_unwind(panic); -963 } -964 debug!("Task cancelled"); -965 Err(e!(SupervisorError::TaskCancelled)) -966 } -967 }; -968 -969 // Ensure the HTTP server terminated, there is no harm in calling this after it is -970 // already shut down. -971 if let Some(server) = relay_http_server { -972 server.shutdown(); -973 } -974 -975 // Ensure the QUIC server is closed -976 if let Some(server) = quic_server { -977 server.shutdown().await; -978 } -979 -980 // Stop all remaining tasks -981 tasks.shutdown().await; -982 -983 ret -984} -985 -986fn root_handler( -987 _r: Request<Incoming>, -988 response: ResponseBuilder, -989) -> HyperResult<Response<BytesBody>> { -990 let body: BytesBody = Box::new(Full::from(INDEX)); -991 response -992 .status(StatusCode::OK) -993 .header("Content-Type", "text/html; charset=utf-8") -994 .body(body) -995 .map_err(|err| Box::new(err) as HyperError) -996} -997 -998/// HTTP latency queries -999fn probe_handler( -1000 _r: Request<Incoming>, -1001 response: ResponseBuilder, -1002) -> HyperResult<Response<BytesBody>> { -1003 response -1004 .status(StatusCode::OK) -1005 .header("Access-Control-Allow-Origin", "*") -1006 .body(body_empty()) -1007 .map_err(|err| Box::new(err) as HyperError) -1008} -1009 -1010fn robots_handler( -1011 _r: Request<Incoming>, -1012 response: ResponseBuilder, -1013) -> HyperResult<Response<BytesBody>> { -1014 let body: BytesBody = Box::new(Full::from(ROBOTS_TXT)); -1015 response -1016 .status(StatusCode::OK) -1017 .body(body) -1018 .map_err(|err| Box::new(err) as HyperError) -1019} -1020 -1021/// For captive portal detection. -1022fn serve_no_content_handler<B: hyper::body::Body>( -1023 r: Request<B>, -1024 mut response: ResponseBuilder, -1025) -> HyperResult<Response<BytesBody>> { -1026 let check = |c: &HeaderValue| { -1027 !c.is_empty() && c.len() < 64 && c.as_bytes().iter().all(|c| is_challenge_char(*c as char)) -1028 }; -1029 -1030 if let Some(challenge) = r.headers().get(NO_CONTENT_CHALLENGE_HEADER) -1031 && check(challenge) -1032 { -1033 response = response.header( -1034 NO_CONTENT_RESPONSE_HEADER, -1035 format!("response {}", challenge.to_str()?), -1036 ); -1037 } -1038 -1039 response -1040 .status(StatusCode::NO_CONTENT) -1041 .body(body_empty()) -1042 .map_err(|err| Box::new(err) as HyperError) -1043} -1044 -1045fn is_challenge_char(c: char) -> bool { -1046 // Semi-randomly chosen as a limited set of valid characters -1047 c.is_ascii_lowercase() -1048 || c.is_ascii_uppercase() -1049 || c.is_ascii_digit() -1050 || c == '.' -1051 || c == '-' -1052 || c == '_' -1053} -1054 -1055/// Health check response -1056#[derive(Serialize)] -1057struct Health { -1058 status: &'static str, -1059 version: &'static str, -1060 git_hash: &'static str, -1061} -1062 -1063fn healthz_handler( -1064 _r: Request<Incoming>, -1065 response: ResponseBuilder, -1066) -> HyperResult<Response<BytesBody>> { -1067 let health = Health { -1068 status: "ok", -1069 version: env!("CARGO_PKG_VERSION"), -1070 git_hash: option_env!("VERGEN_GIT_SHA").unwrap_or("unknown"), -1071 }; -1072 let body = serde_json::to_string(&health).unwrap_or_else(|_| r#"{"status":"error"}"#.into()); -1073 let body: BytesBody = Box::new(Full::from(body)); -1074 response -1075 .status(StatusCode::OK) -1076 .header("Content-Type", "application/json") -1077 .body(body) -1078 .map_err(|err| Box::new(err) as HyperError) -1079} -1080 -1081/// This is a future that never returns, drop it to cancel/abort. -1082async fn run_captive_portal_service(http_listener: TcpListener) { -1083 info!("serving"); +959 Ok(Err(err)) => { +960 error!(%err, "Task failed"); +961 Err(err) +962 } +963 Err(err) => { +964 if let Ok(panic) = err.try_into_panic() { +965 error!("Task panicked"); +966 std::panic::resume_unwind(panic); +967 } +968 debug!("Task cancelled"); +969 Err(e!(SupervisorError::TaskCancelled)) +970 } +971 }; +972 +973 // Ensure the HTTP server terminated, there is no harm in calling this after it is +974 // already shut down. +975 if let Some(server) = relay_http_server { +976 server.shutdown(); +977 } +978 +979 // Ensure the QUIC server is closed +980 if let Some(server) = quic_server { +981 server.shutdown().await; +982 } +983 +984 // Stop all remaining tasks +985 tasks.shutdown().await; +986 +987 ret +988} +989 +990fn root_handler( +991 _r: Request<Incoming>, +992 response: ResponseBuilder, +993) -> HyperResult<Response<BytesBody>> { +994 let body: BytesBody = Box::new(Full::from(INDEX)); +995 response +996 .status(StatusCode::OK) +997 .header("Content-Type", "text/html; charset=utf-8") +998 .body(body) +999 .map_err(|err| Box::new(err) as HyperError) +1000} +1001 +1002/// HTTP latency queries +1003fn probe_handler( +1004 _r: Request<Incoming>, +1005 response: ResponseBuilder, +1006) -> HyperResult<Response<BytesBody>> { +1007 response +1008 .status(StatusCode::OK) +1009 .header("Access-Control-Allow-Origin", "*") +1010 .body(body_empty()) +1011 .map_err(|err| Box::new(err) as HyperError) +1012} +1013 +1014fn robots_handler( +1015 _r: Request<Incoming>, +1016 response: ResponseBuilder, +1017) -> HyperResult<Response<BytesBody>> { +1018 let body: BytesBody = Box::new(Full::from(ROBOTS_TXT)); +1019 response +1020 .status(StatusCode::OK) +1021 .body(body) +1022 .map_err(|err| Box::new(err) as HyperError) +1023} +1024 +1025/// For captive portal detection. +1026fn serve_no_content_handler<B: hyper::body::Body>( +1027 r: Request<B>, +1028 mut response: ResponseBuilder, +1029) -> HyperResult<Response<BytesBody>> { +1030 let check = |c: &HeaderValue| { +1031 !c.is_empty() && c.len() < 64 && c.as_bytes().iter().all(|c| is_challenge_char(*c as char)) +1032 }; +1033 +1034 if let Some(challenge) = r.headers().get(NO_CONTENT_CHALLENGE_HEADER) +1035 && check(challenge) +1036 { +1037 response = response.header( +1038 NO_CONTENT_RESPONSE_HEADER, +1039 format!("response {}", challenge.to_str()?), +1040 ); +1041 } +1042 +1043 response +1044 .status(StatusCode::NO_CONTENT) +1045 .body(body_empty()) +1046 .map_err(|err| Box::new(err) as HyperError) +1047} +1048 +1049fn is_challenge_char(c: char) -> bool { +1050 // Semi-randomly chosen as a limited set of valid characters +1051 c.is_ascii_lowercase() +1052 || c.is_ascii_uppercase() +1053 || c.is_ascii_digit() +1054 || c == '.' +1055 || c == '-' +1056 || c == '_' +1057} +1058 +1059/// Health check response +1060#[derive(Serialize)] +1061struct Health { +1062 status: &'static str, +1063 version: &'static str, +1064 git_hash: &'static str, +1065} +1066 +1067fn healthz_handler( +1068 _r: Request<Incoming>, +1069 response: ResponseBuilder, +1070) -> HyperResult<Response<BytesBody>> { +1071 let health = Health { +1072 status: "ok", +1073 version: env!("CARGO_PKG_VERSION"), +1074 git_hash: option_env!("VERGEN_GIT_SHA").unwrap_or("unknown"), +1075 }; +1076 let body = serde_json::to_string(&health).unwrap_or_else(|_| r#"{"status":"error"}"#.into()); +1077 let body: BytesBody = Box::new(Full::from(body)); +1078 response +1079 .status(StatusCode::OK) +1080 .header("Content-Type", "application/json") +1081 .body(body) +1082 .map_err(|err| Box::new(err) as HyperError) +1083} 1084 -1085 // If this future is cancelled, this is dropped and all tasks are aborted. -1086 let mut tasks = JoinSet::new(); -1087 -1088 loop { -1089 tokio::select! { -1090 biased; +1085/// This is a future that never returns, drop it to cancel/abort. +1086async fn run_captive_portal_service(http_listener: TcpListener) { +1087 info!("serving"); +1088 +1089 // If this future is cancelled, this is dropped and all tasks are aborted. +1090 let mut tasks = JoinSet::new(); 1091 -1092 Some(res) = tasks.join_next() => { -1093 if let Err(err) = res -1094 && err.is_panic() -1095 { -1096 panic!("task panicked: {err:#?}"); -1097 } -1098 } -1099 -1100 res = http_listener.accept() => { -1101 match res { -1102 Ok((stream, peer_addr)) => { -1103 debug!(%peer_addr, "Connection opened",); -1104 let handler = CaptivePortalService; -1105 -1106 tasks.spawn(async move { -1107 let stream = crate::server::streams::MaybeTlsStream::Plain(stream); -1108 let stream = hyper_util::rt::TokioIo::new(stream); -1109 if let Err(err) = hyper::server::conn::http1::Builder::new() -1110 .serve_connection(stream, handler) -1111 .with_upgrades() -1112 .await -1113 { -1114 error!("Failed to serve connection: {err:?}"); -1115 } -1116 }); -1117 } -1118 Err(err) => { -1119 error!( -1120 "[CaptivePortalService] failed to accept connection: {:#?}", -1121 err -1122 ); -1123 } -1124 } -1125 } -1126 } -1127 } -1128} -1129 -1130#[derive(Clone)] -1131struct CaptivePortalService; -1132 -1133impl hyper::service::Service<Request<Incoming>> for CaptivePortalService { -1134 type Response = Response<BytesBody>; -1135 type Error = HyperError; -1136 type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>; -1137 -1138 fn call(&self, req: Request<Incoming>) -> Self::Future { -1139 match (req.method(), req.uri().path()) { -1140 // Captive Portal checker -1141 (&Method::GET, "/generate_204") => { -1142 Box::pin(async move { serve_no_content_handler(req, Response::builder()) }) -1143 } -1144 _ => { -1145 // Return 404 not found response. -1146 let body: BytesBody = Box::new(Full::from(NOTFOUND)); -1147 let r = Response::builder() -1148 .status(StatusCode::NOT_FOUND) -1149 .body(body) -1150 .map_err(|err| Box::new(err) as HyperError); -1151 Box::pin(async move { r }) -1152 } -1153 } -1154 } -1155} -1156 -1157#[cfg(test)] -1158mod tests { -1159 use std::{net::Ipv4Addr, sync::Arc, time::Duration}; +1092 loop { +1093 tokio::select! { +1094 biased; +1095 +1096 Some(res) = tasks.join_next() => { +1097 if let Err(err) = res +1098 && err.is_panic() +1099 { +1100 panic!("task panicked: {err:#?}"); +1101 } +1102 } +1103 +1104 res = http_listener.accept() => { +1105 match res { +1106 Ok((stream, peer_addr)) => { +1107 debug!(%peer_addr, "Connection opened",); +1108 let handler = CaptivePortalService; +1109 +1110 tasks.spawn(async move { +1111 let stream = crate::server::streams::MaybeTlsStream::Plain(stream); +1112 let stream = hyper_util::rt::TokioIo::new(stream); +1113 if let Err(err) = hyper::server::conn::http1::Builder::new() +1114 .serve_connection(stream, handler) +1115 .with_upgrades() +1116 .await +1117 { +1118 error!("Failed to serve connection: {err:?}"); +1119 } +1120 }); +1121 } +1122 Err(err) => { +1123 error!( +1124 "[CaptivePortalService] failed to accept connection: {:#?}", +1125 err +1126 ); +1127 } +1128 } +1129 } +1130 } +1131 } +1132} +1133 +1134#[derive(Clone)] +1135struct CaptivePortalService; +1136 +1137impl hyper::service::Service<Request<Incoming>> for CaptivePortalService { +1138 type Response = Response<BytesBody>; +1139 type Error = HyperError; +1140 type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>; +1141 +1142 fn call(&self, req: Request<Incoming>) -> Self::Future { +1143 match (req.method(), req.uri().path()) { +1144 // Captive Portal checker +1145 (&Method::GET, "/generate_204") => { +1146 Box::pin(async move { serve_no_content_handler(req, Response::builder()) }) +1147 } +1148 _ => { +1149 // Return 404 not found response. +1150 let body: BytesBody = Box::new(Full::from(NOTFOUND)); +1151 let r = Response::builder() +1152 .status(StatusCode::NOT_FOUND) +1153 .body(body) +1154 .map_err(|err| Box::new(err) as HyperError); +1155 Box::pin(async move { r }) +1156 } +1157 } +1158 } +1159} 1160 -1161 use http::StatusCode; -1162 use iroh_base::{EndpointId, RelayUrl, SecretKey}; -1163 use iroh_dns::dns::DnsResolver; -1164 use n0_error::{Result, StackResultExt, StdResultExt}; -1165 use n0_future::{SinkExt, StreamExt}; -1166 use n0_tracing_test::traced_test; -1167 use rand::{RngExt, SeedableRng}; -1168 use tracing::{info, instrument}; -1169 use url::Url; -1170 -1171 use super::{ -1172 Access, AccessControl, ClientRequest, NO_CONTENT_CHALLENGE_HEADER, -1173 NO_CONTENT_RESPONSE_HEADER, RelayConfig, Server, ServerConfig, SpawnError, -1174 }; -1175 use crate::{ -1176 client::{ClientBuilder, ConnectError}, -1177 protos::{ -1178 handshake, -1179 relay::{ClientToRelayMsg, Datagrams, RelayToClientMsg}, -1180 }, -1181 test_utils::static_resolver, -1182 tls::{self, CaTlsConfig, default_provider}, -1183 }; -1184 -1185 /// An [`AccessControl`] backed by a closure, for tests. -1186 #[derive(derive_more::Debug)] -1187 struct TestAccess(#[debug("access fn")] Box<dyn Fn(&ClientRequest) -> Access + Send + Sync>); +1161#[cfg(test)] +1162mod tests { +1163 use std::{net::Ipv4Addr, sync::Arc, time::Duration}; +1164 +1165 use http::StatusCode; +1166 use iroh_base::{EndpointId, RelayUrl, SecretKey}; +1167 use iroh_dns::dns::DnsResolver; +1168 use n0_error::{Result, StackResultExt, StdResultExt}; +1169 use n0_future::{SinkExt, StreamExt}; +1170 use n0_tracing_test::traced_test; +1171 use rand::{RngExt, SeedableRng}; +1172 use tracing::{info, instrument}; +1173 use url::Url; +1174 +1175 use super::{ +1176 Access, AccessControl, ClientRequest, NO_CONTENT_CHALLENGE_HEADER, +1177 NO_CONTENT_RESPONSE_HEADER, RelayConfig, Server, ServerConfig, SpawnError, +1178 }; +1179 use crate::{ +1180 client::{ClientBuilder, ConnectError}, +1181 protos::{ +1182 handshake, +1183 relay::{ClientToRelayMsg, Datagrams, RelayToClientMsg}, +1184 }, +1185 test_utils::static_resolver, +1186 tls::{self, CaTlsConfig, default_provider}, +1187 }; 1188 -1189 impl AccessControl for TestAccess { -1190 async fn on_connect(&self, request: &ClientRequest) -> Access { -1191 (self.0)(request) -1192 } -1193 } -1194 -1195 async fn spawn_local_relay() -> std::result::Result<Server, SpawnError> { -1196 let mut relay = RelayConfig::new((Ipv4Addr::LOCALHOST, 0)); -1197 relay.key_cache_capacity = Some(1024); -1198 Server::spawn(ServerConfig { -1199 relay: Some(relay), -1200 quic: None, -1201 metrics_addr: None, -1202 }) -1203 .await -1204 } -1205 -1206 #[instrument] -1207 async fn try_send_recv( -1208 client_a: &mut crate::client::Client, -1209 client_b: &mut crate::client::Client, -1210 b_key: EndpointId, -1211 msg: Datagrams, -1212 ) -> Result<RelayToClientMsg> { -1213 // try resend 10 times -1214 for _ in 0..10 { -1215 client_a -1216 .send(ClientToRelayMsg::Datagrams { -1217 dst_endpoint_id: b_key, -1218 datagrams: msg.clone(), -1219 }) -1220 .await?; -1221 let Ok(res) = tokio::time::timeout(Duration::from_millis(500), client_b.next()).await -1222 else { -1223 continue; -1224 }; -1225 let res = res.expect("stream finished")?; -1226 return Ok(res); -1227 } -1228 panic!("failed to send and recv message"); -1229 } -1230 -1231 fn dns_resolver() -> DnsResolver { -1232 DnsResolver::new() +1189 /// An [`AccessControl`] backed by a closure, for tests. +1190 #[derive(derive_more::Debug)] +1191 struct TestAccess(#[debug("access fn")] Box<dyn Fn(&ClientRequest) -> Access + Send + Sync>); +1192 +1193 impl AccessControl for TestAccess { +1194 async fn on_connect(&self, request: &ClientRequest) -> Access { +1195 (self.0)(request) +1196 } +1197 } +1198 +1199 async fn spawn_local_relay() -> std::result::Result<Server, SpawnError> { +1200 let mut relay = RelayConfig::new((Ipv4Addr::LOCALHOST, 0)); +1201 relay.key_cache_capacity = Some(1024); +1202 Server::spawn(ServerConfig { +1203 relay: Some(relay), +1204 quic: None, +1205 metrics_addr: None, +1206 }) +1207 .await +1208 } +1209 +1210 #[instrument] +1211 async fn try_send_recv( +1212 client_a: &mut crate::client::Client, +1213 client_b: &mut crate::client::Client, +1214 b_key: EndpointId, +1215 msg: Datagrams, +1216 ) -> Result<RelayToClientMsg> { +1217 // try resend 10 times +1218 for _ in 0..10 { +1219 client_a +1220 .send(ClientToRelayMsg::Datagrams { +1221 dst_endpoint_id: b_key, +1222 datagrams: msg.clone(), +1223 }) +1224 .await?; +1225 let Ok(res) = tokio::time::timeout(Duration::from_millis(500), client_b.next()).await +1226 else { +1227 continue; +1228 }; +1229 let res = res.expect("stream finished")?; +1230 return Ok(res); +1231 } +1232 panic!("failed to send and recv message"); 1233 } 1234 -1235 fn ring_config() -> rustls::ClientConfig { -1236 rustls::ClientConfig::builder_with_provider(Arc::new( -1237 rustls::crypto::ring::default_provider(), -1238 )) -1239 .with_safe_default_protocol_versions() -1240 .unwrap() -1241 .with_root_certificates(rustls::RootCertStore::empty()) -1242 .with_no_client_auth() -1243 } -1244 -1245 #[tokio::test] -1246 #[traced_test] -1247 async fn test_no_services() { -1248 let mut server = Server::spawn(ServerConfig::default()).await.unwrap(); -1249 let res = tokio::time::timeout(Duration::from_secs(5), server.join()) -1250 .await -1251 .expect("timeout, server not finished") -1252 .expect("server task JoinError"); -1253 assert!(res.is_err()); -1254 } -1255 -1256 #[tokio::test] -1257 #[traced_test] -1258 async fn test_conflicting_bind() { -1259 let mut relay = RelayConfig::new((Ipv4Addr::LOCALHOST, 1234)); -1260 relay.key_cache_capacity = Some(1024); -1261 let res = Server::spawn(ServerConfig { -1262 relay: Some(relay), -1263 quic: None, -1264 metrics_addr: Some((Ipv4Addr::LOCALHOST, 1234).into()), -1265 }) -1266 .await; -1267 assert!(res.is_err()); // AddrInUse -1268 } -1269 -1270 #[tokio::test] -1271 #[traced_test] -1272 async fn test_root_handler() { -1273 let server = spawn_local_relay().await.unwrap(); -1274 let url = format!("http://{}", server.http_addr().unwrap()); -1275 -1276 let client = reqwest::Client::builder() -1277 .use_preconfigured_tls(ring_config()) -1278 .build() -1279 .unwrap(); -1280 let response = client.get(&url).send().await.unwrap(); -1281 assert_eq!(response.status(), 200); -1282 let body = response.text().await.unwrap(); -1283 assert!(body.contains("iroh.computer")); -1284 } -1285 -1286 #[tokio::test] -1287 #[traced_test] -1288 async fn test_captive_portal_service() { -1289 let server = spawn_local_relay().await.unwrap(); -1290 let url = format!("http://{}/generate_204", server.http_addr().unwrap()); -1291 let challenge = "123az__."; -1292 -1293 let client = reqwest::Client::builder() -1294 .use_preconfigured_tls(ring_config()) -1295 .build() -1296 .unwrap(); -1297 let response = client -1298 .get(&url) -1299 .header(NO_CONTENT_CHALLENGE_HEADER, challenge) -1300 .send() -1301 .await -1302 .unwrap(); -1303 assert_eq!(response.status(), StatusCode::NO_CONTENT); -1304 let header = response.headers().get(NO_CONTENT_RESPONSE_HEADER).unwrap(); -1305 assert_eq!(header.to_str().unwrap(), format!("response {challenge}")); -1306 let body = response.text().await.unwrap(); -1307 assert!(body.is_empty()); -1308 } -1309 -1310 #[tokio::test] -1311 #[traced_test] -1312 async fn test_relay_clients() -> Result<()> { -1313 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -1314 let server = spawn_local_relay().await?; -1315 -1316 let relay_url = format!("http://{}", server.http_addr().unwrap()); -1317 let relay_url: RelayUrl = relay_url.parse()?; -1318 -1319 let client_config = CaTlsConfig::default() -1320 .client_config(default_provider()) -1321 .unwrap(); +1235 fn dns_resolver() -> DnsResolver { +1236 DnsResolver::new() +1237 } +1238 +1239 fn ring_config() -> rustls::ClientConfig { +1240 rustls::ClientConfig::builder_with_provider(Arc::new( +1241 rustls::crypto::ring::default_provider(), +1242 )) +1243 .with_safe_default_protocol_versions() +1244 .unwrap() +1245 .with_root_certificates(rustls::RootCertStore::empty()) +1246 .with_no_client_auth() +1247 } +1248 +1249 #[tokio::test] +1250 #[traced_test] +1251 async fn test_no_services() { +1252 let mut server = Server::spawn(ServerConfig::default()).await.unwrap(); +1253 let res = tokio::time::timeout(Duration::from_secs(5), server.join()) +1254 .await +1255 .expect("timeout, server not finished") +1256 .expect("server task JoinError"); +1257 assert!(res.is_err()); +1258 } +1259 +1260 #[tokio::test] +1261 #[traced_test] +1262 async fn test_conflicting_bind() { +1263 let mut relay = RelayConfig::new((Ipv4Addr::LOCALHOST, 1234)); +1264 relay.key_cache_capacity = Some(1024); +1265 let res = Server::spawn(ServerConfig { +1266 relay: Some(relay), +1267 quic: None, +1268 metrics_addr: Some((Ipv4Addr::LOCALHOST, 1234).into()), +1269 }) +1270 .await; +1271 assert!(res.is_err()); // AddrInUse +1272 } +1273 +1274 #[tokio::test] +1275 #[traced_test] +1276 async fn test_root_handler() { +1277 let server = spawn_local_relay().await.unwrap(); +1278 let url = format!("http://{}", server.http_addr().unwrap()); +1279 +1280 let client = reqwest::Client::builder() +1281 .use_preconfigured_tls(ring_config()) +1282 .build() +1283 .unwrap(); +1284 let response = client.get(&url).send().await.unwrap(); +1285 assert_eq!(response.status(), 200); +1286 let body = response.text().await.unwrap(); +1287 assert!(body.contains("iroh.computer")); +1288 } +1289 +1290 #[tokio::test] +1291 #[traced_test] +1292 async fn test_captive_portal_service() { +1293 let server = spawn_local_relay().await.unwrap(); +1294 let url = format!("http://{}/generate_204", server.http_addr().unwrap()); +1295 let challenge = "123az__."; +1296 +1297 let client = reqwest::Client::builder() +1298 .use_preconfigured_tls(ring_config()) +1299 .build() +1300 .unwrap(); +1301 let response = client +1302 .get(&url) +1303 .header(NO_CONTENT_CHALLENGE_HEADER, challenge) +1304 .send() +1305 .await +1306 .unwrap(); +1307 assert_eq!(response.status(), StatusCode::NO_CONTENT); +1308 let header = response.headers().get(NO_CONTENT_RESPONSE_HEADER).unwrap(); +1309 assert_eq!(header.to_str().unwrap(), format!("response {challenge}")); +1310 let body = response.text().await.unwrap(); +1311 assert!(body.is_empty()); +1312 } +1313 +1314 #[tokio::test] +1315 #[traced_test] +1316 async fn test_relay_clients() -> Result<()> { +1317 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1318 let server = spawn_local_relay().await?; +1319 +1320 let relay_url = format!("http://{}", server.http_addr().unwrap()); +1321 let relay_url: RelayUrl = relay_url.parse()?; 1322 -1323 // set up client a -1324 let a_secret_key = SecretKey::from_bytes(&rng.random()); -1325 let a_key = a_secret_key.public(); -1326 let resolver = dns_resolver(); -1327 info!("client a build & connect"); -1328 let mut client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone()) -1329 .tls_client_config(client_config.clone()) -1330 .connect() -1331 .await?; -1332 -1333 // set up client b -1334 let b_secret_key = SecretKey::from_bytes(&rng.random()); -1335 let b_key = b_secret_key.public(); -1336 info!("client b build & connect"); -1337 let mut client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone()) -1338 .tls_client_config(client_config) -1339 .connect() -1340 .await?; -1341 -1342 info!("sending a -> b"); -1343 -1344 // send message from a to b -1345 let msg = Datagrams::from("hello, b"); -1346 let res = try_send_recv(&mut client_a, &mut client_b, b_key, msg.clone()).await?; -1347 let RelayToClientMsg::Datagrams { -1348 remote_endpoint_id, -1349 datagrams, -1350 } = res -1351 else { -1352 panic!("client_b received unexpected message {res:?}"); -1353 }; -1354 -1355 assert_eq!(a_key, remote_endpoint_id); -1356 assert_eq!(msg, datagrams); -1357 -1358 info!("sending b -> a"); -1359 // send message from b to a -1360 let msg = Datagrams::from("howdy, a"); -1361 let res = try_send_recv(&mut client_b, &mut client_a, a_key, msg.clone()).await?; -1362 -1363 let RelayToClientMsg::Datagrams { -1364 remote_endpoint_id, -1365 datagrams, -1366 } = res -1367 else { -1368 panic!("client_a received unexpected message {res:?}"); -1369 }; -1370 -1371 assert_eq!(b_key, remote_endpoint_id); -1372 assert_eq!(msg, datagrams); -1373 -1374 Ok(()) -1375 } -1376 -1377 #[tokio::test] -1378 #[traced_test] -1379 async fn test_relay_access_control() -> Result<()> { -1380 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -1381 let current_span = tracing::info_span!("this is a test"); -1382 let _guard = current_span.enter(); -1383 -1384 let client_config = CaTlsConfig::default() -1385 .client_config(default_provider()) -1386 .unwrap(); +1323 let client_config = CaTlsConfig::default() +1324 .client_config(default_provider()) +1325 .unwrap(); +1326 +1327 // set up client a +1328 let a_secret_key = SecretKey::from_bytes(&rng.random()); +1329 let a_key = a_secret_key.public(); +1330 let resolver = dns_resolver(); +1331 info!("client a build & connect"); +1332 let mut client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone()) +1333 .tls_client_config(client_config.clone()) +1334 .connect() +1335 .await?; +1336 +1337 // set up client b +1338 let b_secret_key = SecretKey::from_bytes(&rng.random()); +1339 let b_key = b_secret_key.public(); +1340 info!("client b build & connect"); +1341 let mut client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone()) +1342 .tls_client_config(client_config) +1343 .connect() +1344 .await?; +1345 +1346 info!("sending a -> b"); +1347 +1348 // send message from a to b +1349 let msg = Datagrams::from("hello, b"); +1350 let res = try_send_recv(&mut client_a, &mut client_b, b_key, msg.clone()).await?; +1351 let RelayToClientMsg::Datagrams { +1352 remote_endpoint_id, +1353 datagrams, +1354 } = res +1355 else { +1356 panic!("client_b received unexpected message {res:?}"); +1357 }; +1358 +1359 assert_eq!(a_key, remote_endpoint_id); +1360 assert_eq!(msg, datagrams); +1361 +1362 info!("sending b -> a"); +1363 // send message from b to a +1364 let msg = Datagrams::from("howdy, a"); +1365 let res = try_send_recv(&mut client_b, &mut client_a, a_key, msg.clone()).await?; +1366 +1367 let RelayToClientMsg::Datagrams { +1368 remote_endpoint_id, +1369 datagrams, +1370 } = res +1371 else { +1372 panic!("client_a received unexpected message {res:?}"); +1373 }; +1374 +1375 assert_eq!(b_key, remote_endpoint_id); +1376 assert_eq!(msg, datagrams); +1377 +1378 Ok(()) +1379 } +1380 +1381 #[tokio::test] +1382 #[traced_test] +1383 async fn test_relay_access_control() -> Result<()> { +1384 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1385 let current_span = tracing::info_span!("this is a test"); +1386 let _guard = current_span.enter(); 1387 -1388 let a_secret_key = SecretKey::from_bytes(&rng.random()); -1389 let a_key = a_secret_key.public(); -1390 -1391 let mut relay = RelayConfig::new((Ipv4Addr::LOCALHOST, 0)); -1392 relay.key_cache_capacity = Some(1024); -1393 relay.access = Arc::new(TestAccess(Box::new(move |request| { -1394 let endpoint_id = request.endpoint_id(); -1395 info!("checking {}", endpoint_id); -1396 // reject endpoint a -1397 if endpoint_id == a_key { -1398 Access::Deny { reason: None } -1399 } else { -1400 Access::Allow -1401 } -1402 }))); -1403 let server = Server::spawn(ServerConfig { -1404 relay: Some(relay), -1405 quic: None, -1406 metrics_addr: None, -1407 }) -1408 .await?; -1409 -1410 let relay_url = format!("http://{}", server.http_addr().unwrap()); -1411 let relay_url: RelayUrl = relay_url.parse()?; -1412 -1413 // set up client a -1414 let resolver = dns_resolver(); -1415 let result = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver) -1416 .tls_client_config(client_config.clone()) -1417 .connect() -1418 .await; -1419 -1420 assert!( -1421 matches!(result, Err(ConnectError::Handshake { source: handshake::Error::ServerDeniedAuth { reason, .. }, .. }) if reason == "not authorized") -1422 ); +1388 let client_config = CaTlsConfig::default() +1389 .client_config(default_provider()) +1390 .unwrap(); +1391 +1392 let a_secret_key = SecretKey::from_bytes(&rng.random()); +1393 let a_key = a_secret_key.public(); +1394 +1395 let mut relay = RelayConfig::new((Ipv4Addr::LOCALHOST, 0)); +1396 relay.key_cache_capacity = Some(1024); +1397 relay.access = Arc::new(TestAccess(Box::new(move |request| { +1398 let endpoint_id = request.endpoint_id(); +1399 info!("checking {}", endpoint_id); +1400 // reject endpoint a +1401 if endpoint_id == a_key { +1402 Access::Deny { reason: None } +1403 } else { +1404 Access::Allow +1405 } +1406 }))); +1407 let server = Server::spawn(ServerConfig { +1408 relay: Some(relay), +1409 quic: None, +1410 metrics_addr: None, +1411 }) +1412 .await?; +1413 +1414 let relay_url = format!("http://{}", server.http_addr().unwrap()); +1415 let relay_url: RelayUrl = relay_url.parse()?; +1416 +1417 // set up client a +1418 let resolver = dns_resolver(); +1419 let result = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver) +1420 .tls_client_config(client_config.clone()) +1421 .connect() +1422 .await; 1423 -1424 // test that another client has access -1425 -1426 // set up client b -1427 let b_secret_key = SecretKey::from_bytes(&rng.random()); -1428 let b_key = b_secret_key.public(); +1424 assert!( +1425 matches!(result, Err(ConnectError::Handshake { source: handshake::Error::ServerDeniedAuth { reason, .. }, .. }) if reason == "not authorized") +1426 ); +1427 +1428 // test that another client has access 1429 -1430 let resolver = dns_resolver(); -1431 let mut client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver) -1432 .tls_client_config(client_config.clone()) -1433 .connect() -1434 .await?; -1435 -1436 // set up client c -1437 let c_secret_key = SecretKey::from_bytes(&rng.random()); -1438 let c_key = c_secret_key.public(); +1430 // set up client b +1431 let b_secret_key = SecretKey::from_bytes(&rng.random()); +1432 let b_key = b_secret_key.public(); +1433 +1434 let resolver = dns_resolver(); +1435 let mut client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver) +1436 .tls_client_config(client_config.clone()) +1437 .connect() +1438 .await?; 1439 -1440 let resolver = dns_resolver(); -1441 let mut client_c = ClientBuilder::new(relay_url.clone(), c_secret_key, resolver) -1442 .tls_client_config(client_config) -1443 .connect() -1444 .await?; -1445 -1446 // send message from b to c -1447 let msg = Datagrams::from("hello, c"); -1448 let res = try_send_recv(&mut client_b, &mut client_c, c_key, msg.clone()).await?; +1440 // set up client c +1441 let c_secret_key = SecretKey::from_bytes(&rng.random()); +1442 let c_key = c_secret_key.public(); +1443 +1444 let resolver = dns_resolver(); +1445 let mut client_c = ClientBuilder::new(relay_url.clone(), c_secret_key, resolver) +1446 .tls_client_config(client_config) +1447 .connect() +1448 .await?; 1449 -1450 if let RelayToClientMsg::Datagrams { -1451 remote_endpoint_id, -1452 datagrams, -1453 } = res -1454 { -1455 assert_eq!(b_key, remote_endpoint_id); -1456 assert_eq!(msg, datagrams); -1457 } else { -1458 panic!("client_c received unexpected message {res:?}"); -1459 } -1460 -1461 Ok(()) -1462 } -1463 -1464 /// Verifies that [`ClientBuilder::auth_token`] forwards a token to the -1465 /// relay so the [`AccessControl::on_connect`] hook can read it via -1466 /// [`ClientRequest::auth_token`]. -1467 #[tokio::test] -1468 #[traced_test] -1469 async fn test_relay_client_auth_token_forwarded() -> Result<()> { -1470 const TOKEN: &str = "secret-token"; -1471 -1472 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -1473 let client_config = CaTlsConfig::default() -1474 .client_config(default_provider()) -1475 .unwrap(); -1476 -1477 let mut relay = RelayConfig::new((Ipv4Addr::LOCALHOST, 0)); -1478 relay.key_cache_capacity = Some(1024); -1479 relay.access = Arc::new(TestAccess(Box::new(move |request| { -1480 if request.auth_token().as_deref() == Some(TOKEN) { -1481 Access::Allow -1482 } else { -1483 Access::Deny { reason: None } -1484 } -1485 }))); -1486 let server = Server::spawn(ServerConfig { -1487 relay: Some(relay), -1488 quic: None, -1489 metrics_addr: None, -1490 }) -1491 .await?; -1492 -1493 let relay_url = format!("http://{}", server.http_addr().unwrap()); -1494 let relay_url: RelayUrl = relay_url.parse()?; -1495 -1496 // No query param: denied. -1497 let secret_key = SecretKey::from_bytes(&rng.random()); -1498 let result = ClientBuilder::new(relay_url.clone(), secret_key, dns_resolver()) -1499 .tls_client_config(client_config.clone()) -1500 .connect() -1501 .await; -1502 assert!(matches!( -1503 result, -1504 Err(ConnectError::Handshake { source: handshake::Error::ServerDeniedAuth { reason, .. }, .. }) -1505 if reason == "not authorized" -1506 )); -1507 -1508 // Wrong token: denied. -1509 let secret_key = SecretKey::from_bytes(&rng.random()); -1510 let result = ClientBuilder::new(relay_url.clone(), secret_key, dns_resolver()) -1511 .tls_client_config(client_config.clone()) -1512 .auth_token("wrong-token") -1513 .connect() -1514 .await; -1515 assert!(matches!( -1516 result, -1517 Err(ConnectError::Handshake { source: handshake::Error::ServerDeniedAuth { reason, .. }, .. }) -1518 if reason == "not authorized" -1519 )); -1520 -1521 // Correct token: connection succeeds. -1522 let secret_key = SecretKey::from_bytes(&rng.random()); -1523 let _client = ClientBuilder::new(relay_url, secret_key, dns_resolver()) -1524 .tls_client_config(client_config) -1525 .auth_token(TOKEN) -1526 .connect() -1527 .await?; -1528 -1529 Ok(()) -1530 } -1531 -1532 #[tokio::test] -1533 #[traced_test] -1534 async fn test_relay_clients_full() -> Result<()> { -1535 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -1536 let server = spawn_local_relay().await.unwrap(); -1537 let relay_url = format!("http://{}", server.http_addr().unwrap()); -1538 let relay_url: RelayUrl = relay_url.parse().unwrap(); -1539 -1540 let client_config = CaTlsConfig::default() -1541 .client_config(default_provider()) -1542 .unwrap(); +1450 // send message from b to c +1451 let msg = Datagrams::from("hello, c"); +1452 let res = try_send_recv(&mut client_b, &mut client_c, c_key, msg.clone()).await?; +1453 +1454 if let RelayToClientMsg::Datagrams { +1455 remote_endpoint_id, +1456 datagrams, +1457 } = res +1458 { +1459 assert_eq!(b_key, remote_endpoint_id); +1460 assert_eq!(msg, datagrams); +1461 } else { +1462 panic!("client_c received unexpected message {res:?}"); +1463 } +1464 +1465 Ok(()) +1466 } +1467 +1468 /// Verifies that [`ClientBuilder::auth_token`] forwards a token to the +1469 /// relay so the [`AccessControl::on_connect`] hook can read it via +1470 /// [`ClientRequest::auth_token`]. +1471 #[tokio::test] +1472 #[traced_test] +1473 async fn test_relay_client_auth_token_forwarded() -> Result<()> { +1474 const TOKEN: &str = "secret-token"; +1475 +1476 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1477 let client_config = CaTlsConfig::default() +1478 .client_config(default_provider()) +1479 .unwrap(); +1480 +1481 let mut relay = RelayConfig::new((Ipv4Addr::LOCALHOST, 0)); +1482 relay.key_cache_capacity = Some(1024); +1483 relay.access = Arc::new(TestAccess(Box::new(move |request| { +1484 if request.auth_token().as_deref() == Some(TOKEN) { +1485 Access::Allow +1486 } else { +1487 Access::Deny { reason: None } +1488 } +1489 }))); +1490 let server = Server::spawn(ServerConfig { +1491 relay: Some(relay), +1492 quic: None, +1493 metrics_addr: None, +1494 }) +1495 .await?; +1496 +1497 let relay_url = format!("http://{}", server.http_addr().unwrap()); +1498 let relay_url: RelayUrl = relay_url.parse()?; +1499 +1500 // No query param: denied. +1501 let secret_key = SecretKey::from_bytes(&rng.random()); +1502 let result = ClientBuilder::new(relay_url.clone(), secret_key, dns_resolver()) +1503 .tls_client_config(client_config.clone()) +1504 .connect() +1505 .await; +1506 assert!(matches!( +1507 result, +1508 Err(ConnectError::Handshake { source: handshake::Error::ServerDeniedAuth { reason, .. }, .. }) +1509 if reason == "not authorized" +1510 )); +1511 +1512 // Wrong token: denied. +1513 let secret_key = SecretKey::from_bytes(&rng.random()); +1514 let result = ClientBuilder::new(relay_url.clone(), secret_key, dns_resolver()) +1515 .tls_client_config(client_config.clone()) +1516 .auth_token("wrong-token") +1517 .connect() +1518 .await; +1519 assert!(matches!( +1520 result, +1521 Err(ConnectError::Handshake { source: handshake::Error::ServerDeniedAuth { reason, .. }, .. }) +1522 if reason == "not authorized" +1523 )); +1524 +1525 // Correct token: connection succeeds. +1526 let secret_key = SecretKey::from_bytes(&rng.random()); +1527 let _client = ClientBuilder::new(relay_url, secret_key, dns_resolver()) +1528 .tls_client_config(client_config) +1529 .auth_token(TOKEN) +1530 .connect() +1531 .await?; +1532 +1533 Ok(()) +1534 } +1535 +1536 #[tokio::test] +1537 #[traced_test] +1538 async fn test_relay_clients_full() -> Result<()> { +1539 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1540 let server = spawn_local_relay().await.unwrap(); +1541 let relay_url = format!("http://{}", server.http_addr().unwrap()); +1542 let relay_url: RelayUrl = relay_url.parse().unwrap(); 1543 -1544 // set up client a -1545 let a_secret_key = SecretKey::from_bytes(&rng.random()); -1546 let resolver = dns_resolver(); -1547 let mut client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone()) -1548 .tls_client_config(client_config.clone()) -1549 .connect() -1550 .await?; -1551 -1552 // set up client b -1553 let b_secret_key = SecretKey::from_bytes(&rng.random()); -1554 let b_key = b_secret_key.public(); -1555 let _client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone()) -1556 .tls_client_config(client_config) -1557 .connect() -1558 .await?; -1559 -1560 // send messages from a to b, without b receiving anything. -1561 // we should still keep succeeding to send, even if the packet won't be forwarded -1562 // by the relay server because the server's send queue for b fills up. -1563 let msg = Datagrams::from("hello, b"); -1564 for _i in 0..1000 { -1565 client_a -1566 .send(ClientToRelayMsg::Datagrams { -1567 dst_endpoint_id: b_key, -1568 datagrams: msg.clone(), -1569 }) -1570 .await?; -1571 } -1572 Ok(()) -1573 } -1574 -1575 /// Regression test: A relay client that prefers IPv6 falls back to IPv4 -1576 /// when the advertised IPv6 address is unreachable. -1577 #[tokio::test] -1578 #[traced_test] -1579 async fn test_relay_client_falls_back_to_ipv4() -> Result { -1580 // A relay reachable only over IPv4. -1581 let config = ServerConfig { -1582 relay: Some(RelayConfig::new((Ipv4Addr::LOCALHOST, 0))), -1583 ..Default::default() -1584 }; -1585 let server = Server::spawn(config).await?; -1586 let addr = server.http_addr().expect("http relay address"); -1587 -1588 // Resolves to both the real IPv4 address and an unreachable IPv6 address. -1589 let resolver = static_resolver( -1590 vec![Ipv4Addr::LOCALHOST], -1591 vec!["2001:db8::dead".parse().expect("valid IPv6")], -1592 ); -1593 let url: Url = format!("http://relay.test:{}", addr.port()) -1594 .parse() -1595 .expect("valid relay url"); -1596 -1597 let client = ClientBuilder::new(url, SecretKey::generate(), resolver) -1598 .tls_client_config(tls::make_dangerous_client_config()) -1599 // Force IPv6 preference -1600 .address_family_selector(|| true); -1601 -1602 tokio::time::timeout(Duration::from_secs(10), client.connect()) -1603 .await -1604 .with_std_context(|_| "relay connect timed out")? -1605 .context("relay connect")?; -1606 -1607 server.shutdown().await.context("relay server shutdown")?; -1608 Ok(()) -1609 } -1610} \ No newline at end of file +1544 let client_config = CaTlsConfig::default() +1545 .client_config(default_provider()) +1546 .unwrap(); +1547 +1548 // set up client a +1549 let a_secret_key = SecretKey::from_bytes(&rng.random()); +1550 let resolver = dns_resolver(); +1551 let mut client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone()) +1552 .tls_client_config(client_config.clone()) +1553 .connect() +1554 .await?; +1555 +1556 // set up client b +1557 let b_secret_key = SecretKey::from_bytes(&rng.random()); +1558 let b_key = b_secret_key.public(); +1559 let _client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone()) +1560 .tls_client_config(client_config) +1561 .connect() +1562 .await?; +1563 +1564 // send messages from a to b, without b receiving anything. +1565 // we should still keep succeeding to send, even if the packet won't be forwarded +1566 // by the relay server because the server's send queue for b fills up. +1567 let msg = Datagrams::from("hello, b"); +1568 for _i in 0..1000 { +1569 client_a +1570 .send(ClientToRelayMsg::Datagrams { +1571 dst_endpoint_id: b_key, +1572 datagrams: msg.clone(), +1573 }) +1574 .await?; +1575 } +1576 Ok(()) +1577 } +1578 +1579 /// Regression test: A relay client that prefers IPv6 falls back to IPv4 +1580 /// when the advertised IPv6 address is unreachable. +1581 #[tokio::test] +1582 #[traced_test] +1583 async fn test_relay_client_falls_back_to_ipv4() -> Result { +1584 // A relay reachable only over IPv4. +1585 let config = ServerConfig { +1586 relay: Some(RelayConfig::new((Ipv4Addr::LOCALHOST, 0))), +1587 ..Default::default() +1588 }; +1589 let server = Server::spawn(config).await?; +1590 let addr = server.http_addr().expect("http relay address"); +1591 +1592 // Resolves to both the real IPv4 address and an unreachable IPv6 address. +1593 let resolver = static_resolver( +1594 vec![Ipv4Addr::LOCALHOST], +1595 vec!["2001:db8::dead".parse().expect("valid IPv6")], +1596 ); +1597 let url: Url = format!("http://relay.test:{}", addr.port()) +1598 .parse() +1599 .expect("valid relay url"); +1600 +1601 let client = ClientBuilder::new(url, SecretKey::generate(), resolver) +1602 .tls_client_config(tls::make_dangerous_client_config()) +1603 // Force IPv6 preference +1604 .address_family_selector(|| true); +1605 +1606 tokio::time::timeout(Duration::from_secs(10), client.connect()) +1607 .await +1608 .with_std_context(|_| "relay connect timed out")? +1609 .context("relay connect")?; +1610 +1611 server.shutdown().await.context("relay server shutdown")?; +1612 Ok(()) +1613 } +1614} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh_relay/server/client.rs.html b/pr/4036/docs/src/iroh_relay/server/client.rs.html index 47f5995e8d..e498f2c2f9 100644 --- a/pr/4036/docs/src/iroh_relay/server/client.rs.html +++ b/pr/4036/docs/src/iroh_relay/server/client.rs.html @@ -42,7 +42,7 @@ 42 data: Datagrams, 43} 44 -45/// Configuration for a [`Client`]. +45/// Configuration for a client connection. 46/// 47/// Generic over the stream type to support different WebSocket implementations. 48#[derive(Debug)] diff --git a/pr/4036/docs/src/iroh_relay/server/clients.rs.html b/pr/4036/docs/src/iroh_relay/server/clients.rs.html index 7bf37ea280..a10f75b679 100644 --- a/pr/4036/docs/src/iroh_relay/server/clients.rs.html +++ b/pr/4036/docs/src/iroh_relay/server/clients.rs.html @@ -21,501 +21,500 @@ 21 server::{client::SendError, metrics::Metrics}, 22}; 23 -24/// Manages the connections to all currently connected clients. -25#[derive(Debug, Clone, Default)] -26/// Registry of connected relay clients. -27/// -28/// This type manages the collection of active client connections and -29/// handles routing messages between them. -30pub struct Clients(Arc<Inner>); -31 -32#[derive(Debug, Default)] -33struct Inner { -34 /// The list of all currently connected clients. -35 clients: DashMap<EndpointId, ClientState>, -36 /// Map of which client has sent where -37 sent_to: DashMap<EndpointId, HashSet<EndpointId>>, -38} -39 -40#[derive(Debug)] -41struct ClientState { -42 active: Client, -43 inactive: Vec<Client>, -44} -45 -46impl ClientState { -47 async fn shutdown_all(mut self) { -48 [self.active] -49 .into_iter() -50 .chain(self.inactive.drain(..)) -51 .map(Client::shutdown) -52 .join_all() -53 .await; -54 } -55} -56 -57impl Clients { -58 /// Shuts down all connected clients. -59 /// -60 /// This method gracefully disconnects all active client connections managed by -61 /// this registry. It will wait for all clients to complete their shutdown before -62 /// returning. -63 pub async fn shutdown(&self) { -64 let keys: Vec<_> = self.0.clients.iter().map(|x| *x.key()).collect(); -65 trace!("shutting down {} clients", keys.len()); -66 let clients = keys.into_iter().filter_map(|k| self.0.clients.remove(&k)); -67 n0_future::join_all(clients.map(|(_, state)| state.shutdown_all())).await; -68 } -69 -70 /// Builds the client handler and starts the read & write loops for the connection. -71 /// -72 /// Once the client disconnects, the [`OnDisconnectGuard`] set in `config` will be dropped, -73 /// allowing callers to be notified of the disconnect. -74 pub fn register<S>(&self, client_config: Config<S>, metrics: Arc<Metrics>) -75 where -76 S: BytesStreamSink + Send + 'static, -77 { -78 let endpoint_id = client_config.guard.endpoint_id; -79 trace!(remote_endpoint = %endpoint_id.fmt_short(), "registering client"); -80 -81 let client = Client::new(client_config, self, metrics.clone()); -82 match self.0.clients.entry(endpoint_id) { -83 dashmap::Entry::Occupied(mut entry) => { -84 let state = entry.get_mut(); -85 let old_client = std::mem::replace(&mut state.active, client); -86 debug!( -87 remote_endpoint = %endpoint_id.fmt_short(), -88 "multiple connections found, deactivating old connection", -89 ); -90 old_client -91 .try_send_health(Status::SameEndpointIdConnected) -92 .ok(); -93 state.inactive.push(old_client); -94 metrics.clients_inactive_added.inc(); -95 } -96 dashmap::Entry::Vacant(entry) => { -97 entry.insert(ClientState { -98 active: client, -99 inactive: Vec::new(), -100 }); -101 } -102 } -103 } -104 -105 /// Removes the client from the map of clients, & sends a notification -106 /// to each client that peers has sent data to, to let them know that -107 /// peer is gone from the network. -108 /// -109 /// Must be passed a matching connection_id. -110 pub(super) fn unregister(&self, guard: OnDisconnectGuard, metrics: &Metrics) { -111 let endpoint_id = guard.endpoint_id; -112 let connection_id = guard.connection_id; -113 trace!( -114 endpoint_id = %endpoint_id.fmt_short(), -115 %connection_id, "unregistering client" -116 ); -117 -118 let mut notify_peers = None; -119 -120 self.0.clients.remove_if_mut(&endpoint_id, |_id, state| { -121 if state.active.connection_id() == connection_id { -122 // The unregistering client is the currently active client -123 if let Some(last_inactive_client) = state.inactive.pop() { -124 metrics.clients_inactive_removed.inc(); -125 // There is an inactive client, promote to active again. -126 state.active = last_inactive_client; -127 // Inform the old client that it is healthy again. -128 state.active.try_send_health(Status::Healthy).ok(); -129 // Don't remove the entry from client map. -130 false -131 } else { -132 // No inactive clients: collect sent_to set for peer-gone notifications. -133 notify_peers = self.0.sent_to.remove(&endpoint_id).map(|(_, peers)| peers); -134 // Remove entry from the client map. -135 true -136 } -137 } else { -138 // The unregistering client is already inactive. Remove from the list of inactive clients. -139 state -140 .inactive -141 .retain(|client| client.connection_id() != connection_id); -142 metrics.clients_inactive_removed.inc(); -143 // Active client is unmodified: keep entry in map. -144 false -145 } -146 }); -147 -148 // Inform peers that this endpoint is gone. -149 // Done outside the remove_if_mut closure to avoid DashMap deadlocks. -150 if let Some(peers) = notify_peers { -151 for peer_id in peers { -152 if let Some(peer) = self.0.clients.get(&peer_id) { -153 match peer.active.try_send_peer_gone(endpoint_id) { -154 Ok(_) => {} -155 Err(TrySendError::Full(_)) => { -156 debug!( -157 dst = %peer_id.fmt_short(), -158 "client too busy to receive peer gone notification, dropping" -159 ); -160 } -161 Err(TrySendError::Closed(_)) => { -162 debug!( -163 dst = %peer_id.fmt_short(), -164 "can no longer write to client, dropping peer gone notification" -165 ); -166 } -167 } -168 } -169 } -170 } -171 } -172 -173 /// Disconnects connections registered for `endpoint_id`. -174 /// -175 /// With `Some(connection_id)`, disconnects only that connection (active or -176 /// an inactive duplicate). With `None`, disconnects every connection for the -177 /// endpoint. Returns `true` if a matching connection was found, or `false` -178 /// otherwise. -179 /// -180 /// Shutdown happens asynchronously: each per-connection actor exits its run -181 /// loop and unregisters itself after this call returns. -182 pub fn disconnect(&self, endpoint_id: EndpointId, connection_id: Option<ConnectionId>) -> bool { -183 let Some(state) = self.0.clients.get(&endpoint_id) else { -184 return false; -185 }; -186 let mut clients = state.inactive.iter().chain([&state.active]); -187 if let Some(id) = connection_id { -188 let Some(client) = clients.find(|c| c.connection_id() == id) else { -189 return false; -190 }; -191 client.start_shutdown(); -192 } else { -193 for client in clients { -194 client.start_shutdown(); -195 } -196 } -197 true -198 } -199 -200 /// Attempt to send a packet to client with [`EndpointId`] `dst`. -201 pub(super) fn send_packet( -202 &self, -203 dst: EndpointId, -204 data: Datagrams, -205 src: EndpointId, -206 metrics: &Metrics, -207 ) -> Result<(), ForwardPacketError> { -208 let Some(client) = self.0.clients.get(&dst) else { -209 debug!(dst = %dst.fmt_short(), "no connected client, dropped packet"); -210 metrics.send_packets_dropped.inc(); -211 return Ok(()); -212 }; -213 match client.active.try_send_packet(src, data) { -214 Ok(_) => { -215 // Record sent_to relationship -216 self.0.sent_to.entry(src).or_default().insert(dst); -217 Ok(()) -218 } -219 Err(TrySendError::Full(_)) => { -220 debug!( -221 dst = %dst.fmt_short(), -222 "client too busy to receive packet, dropping packet" -223 ); -224 Err(ForwardPacketError::new(SendError::Full)) -225 } -226 Err(TrySendError::Closed(_)) => { -227 debug!( -228 dst = %dst.fmt_short(), -229 "can no longer write to client, dropping message and pruning connection" -230 ); -231 client.active.start_shutdown(); -232 Err(ForwardPacketError::new(SendError::Closed)) -233 } -234 } -235 } -236 -237 #[cfg(test)] -238 fn active_connection_id(&self, endpoint_id: EndpointId) -> Option<ConnectionId> { -239 self.0 -240 .clients -241 .get(&endpoint_id) -242 .map(|s| s.active.connection_id()) -243 } -244} -245 -246#[cfg(test)] -247mod tests { -248 use std::time::Duration; -249 -250 use iroh_base::SecretKey; -251 use n0_error::{Result, StdResultExt}; -252 use n0_future::{Stream, StreamExt}; -253 use n0_tracing_test::traced_test; -254 use rand::{RngExt, SeedableRng}; -255 -256 use super::*; -257 use crate::{ -258 client::conn::Conn, -259 http::ProtocolVersion, -260 protos::{common::FrameType, relay::RelayToClientMsg, streams::WsBytesFramed}, -261 server::streams::{MaybeTlsStream, RateLimited, ServerRelayedStream}, -262 }; -263 -264 async fn recv_frame< -265 E: std::error::Error + Sync + Send + 'static, -266 S: Stream<Item = Result<RelayToClientMsg, E>> + Unpin, -267 >( -268 frame_type: FrameType, -269 mut stream: S, -270 ) -> Result<RelayToClientMsg> { -271 match stream.next().await { -272 Some(Ok(frame)) => { -273 if frame_type != frame.typ() { -274 n0_error::bail_any!( -275 "Unexpected frame, got {:?}, but expected {:?}", -276 frame.typ(), -277 frame_type -278 ); -279 } -280 Ok(frame) -281 } -282 Some(Err(err)) => Err(err).anyerr(), -283 None => n0_error::bail_any!("Unexpected EOF, expected frame {frame_type:?}"), -284 } -285 } -286 -287 fn test_client_builder( -288 key: EndpointId, -289 ) -> (Config<WsBytesFramed<RateLimited<MaybeTlsStream>>>, Conn) { -290 let (server, client) = tokio::io::duplex(1024); -291 let guard = OnDisconnectGuard::empty(key); -292 let protocol_version = ProtocolVersion::default(); -293 let mut config = Config::new(guard, ServerRelayedStream::test(server), protocol_version); -294 config.write_timeout = Duration::from_secs(1); -295 config.channel_capacity = 10; -296 (config, Conn::test(client, protocol_version)) -297 } -298 -299 #[tokio::test] -300 #[traced_test] -301 async fn test_clients() -> Result { -302 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -303 let a_key = SecretKey::from_bytes(&rng.random()).public(); -304 let b_key = SecretKey::from_bytes(&rng.random()).public(); -305 -306 let (builder_a, mut a_rw) = test_client_builder(a_key); -307 -308 let clients = Clients::default(); -309 let metrics = Arc::new(Metrics::default()); -310 clients.register(builder_a, metrics.clone()); -311 -312 // send packet -313 let data = b"hello world!"; -314 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; -315 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a_rw).await?; -316 assert_eq!( -317 frame, -318 RelayToClientMsg::Datagrams { -319 remote_endpoint_id: b_key, -320 datagrams: data.to_vec().into(), -321 } -322 ); -323 -324 { -325 let client = clients.0.clients.get(&a_key).unwrap(); -326 // shutdown client a, this should trigger the removal from the clients list -327 client.active.start_shutdown(); -328 } -329 -330 // need to wait a moment for the removal to be processed -331 let c = clients.clone(); -332 tokio::time::timeout(Duration::from_secs(1), async move { -333 loop { -334 if !c.0.clients.contains_key(&a_key) { -335 break; -336 } -337 tokio::time::sleep(Duration::from_millis(100)).await; -338 } -339 }) -340 .await -341 .std_context("timeout")?; -342 clients.shutdown().await; -343 -344 Ok(()) -345 } -346 -347 #[tokio::test] -348 #[traced_test] -349 async fn test_clients_same_endpoint_id() -> Result { -350 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -351 let a_key = SecretKey::from_bytes(&rng.random()).public(); -352 let b_key = SecretKey::from_bytes(&rng.random()).public(); -353 -354 let (a1_builder, mut a1_rw) = test_client_builder(a_key); -355 -356 let clients = Clients::default(); -357 let metrics = Arc::new(Metrics::default()); -358 -359 // register client a -360 clients.register(a1_builder, metrics.clone()); -361 let a1_conn_id = clients.active_connection_id(a_key).unwrap(); -362 -363 // send packet and verify it is send to a1 -364 let data = b"hello world!"; -365 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; -366 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a1_rw).await?; -367 assert_eq!( -368 frame, -369 RelayToClientMsg::Datagrams { -370 remote_endpoint_id: b_key, -371 datagrams: data.to_vec().into(), -372 } -373 ); -374 -375 // register new client with same endpoint id -376 let (a2_builder, mut a2_rw) = test_client_builder(a_key); -377 clients.register(a2_builder, metrics.clone()); -378 let a2_conn_id = clients.active_connection_id(a_key).unwrap(); -379 assert!(a2_conn_id != a1_conn_id); -380 -381 // a1 is marked inactive and should receive a health frame -382 let frame = recv_frame(FrameType::Status, &mut a1_rw).await?; -383 assert_eq!( -384 frame, -385 RelayToClientMsg::Status(Status::SameEndpointIdConnected) -386 ); -387 -388 // send packet and verify it is send to a2 -389 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; -390 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a2_rw).await?; -391 assert_eq!( -392 frame, -393 RelayToClientMsg::Datagrams { -394 remote_endpoint_id: b_key, -395 datagrams: data.to_vec().into(), -396 } -397 ); -398 -399 // disconnect a2 -400 clients -401 .0 -402 .clients -403 .get(&a_key) -404 .unwrap() -405 .active -406 .start_shutdown(); -407 -408 // need to wait a moment for the removal to be processed -409 tokio::time::timeout(Duration::from_secs(1), { -410 let clients = clients.clone(); -411 async move { -412 // wait until the active connection is no longer a2 (which we unregistered) -413 while clients.active_connection_id(a_key) == Some(a2_conn_id) { -414 tokio::time::sleep(Duration::from_millis(100)).await; -415 } -416 } -417 }) -418 .await -419 .std_context("timeout")?; -420 -421 // a1 should be marked active again now -422 assert_eq!(clients.active_connection_id(a_key), Some(a1_conn_id)); -423 -424 // a1 is marked active again and should receive a health frame -425 let frame = recv_frame(FrameType::Status, &mut a1_rw).await?; -426 assert_eq!(frame, RelayToClientMsg::Status(Status::Healthy)); -427 -428 // a1 should receive packets -429 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; -430 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a1_rw).await?; -431 assert_eq!( -432 frame, -433 RelayToClientMsg::Datagrams { -434 remote_endpoint_id: b_key, -435 datagrams: data.to_vec().into(), -436 } -437 ); -438 -439 // after shutting down the now-active client, there should no longer be an entry for that endpoint id -440 clients -441 .0 -442 .clients -443 .get(&a_key) -444 .unwrap() -445 .active -446 .start_shutdown(); -447 -448 // need to wait a moment for the removal to be processed -449 tokio::time::timeout(Duration::from_secs(1), { -450 let clients = clients.clone(); -451 async move { -452 // wait until the active connection is no longer a2 (which we unregistered) -453 while clients.0.clients.contains_key(&a_key) { -454 tokio::time::sleep(Duration::from_millis(100)).await; -455 } -456 } -457 }) -458 .await -459 .std_context("timeout")?; -460 -461 clients.shutdown().await; -462 -463 Ok(()) -464 } -465 -466 #[tokio::test] -467 #[traced_test] -468 async fn test_peer_gone_notification() -> Result { -469 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); -470 let a_key = SecretKey::from_bytes(&rng.random()).public(); -471 let b_key = SecretKey::from_bytes(&rng.random()).public(); -472 -473 let clients = Clients::default(); -474 let metrics = Arc::new(Metrics::default()); -475 -476 // Register both clients -477 let (builder_a, _a_rw) = test_client_builder(a_key); -478 let (builder_b, mut b_rw) = test_client_builder(b_key); -479 clients.register(builder_a, metrics.clone()); -480 clients.register(builder_b, metrics.clone()); -481 -482 // A sends a packet to B (records sent_to[A] = {B}) -483 let data = b"hello b!"; -484 clients.send_packet(b_key, Datagrams::from(&data[..]), a_key, &metrics)?; -485 -486 // B receives the packet -487 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut b_rw).await?; -488 assert_eq!( -489 frame, -490 RelayToClientMsg::Datagrams { -491 remote_endpoint_id: a_key, -492 datagrams: data.to_vec().into(), -493 } -494 ); -495 -496 // Disconnect A -497 { -498 let client = clients.0.clients.get(&a_key).unwrap(); -499 client.active.start_shutdown(); -500 } -501 -502 // Wait for A to unregister -503 tokio::time::timeout(Duration::from_secs(1), { -504 let clients = clients.clone(); -505 async move { -506 while clients.0.clients.contains_key(&a_key) { -507 tokio::time::sleep(Duration::from_millis(100)).await; -508 } -509 } -510 }) -511 .await -512 .std_context("timeout waiting for A to unregister")?; -513 -514 // B should receive EndpointGone(a_key): notifying B that A is gone -515 let frame = recv_frame(FrameType::EndpointGone, &mut b_rw).await?; -516 assert_eq!(frame, RelayToClientMsg::EndpointGone(a_key)); -517 -518 clients.shutdown().await; -519 Ok(()) -520 } -521} \ No newline at end of file +24/// Registry of connected relay clients. +25/// +26/// This type manages the collection of active client connections and +27/// handles routing messages between them. +28#[derive(Debug, Clone, Default)] +29pub struct Clients(Arc<Inner>); +30 +31#[derive(Debug, Default)] +32struct Inner { +33 /// The list of all currently connected clients. +34 clients: DashMap<EndpointId, ClientState>, +35 /// Map of which client has sent where +36 sent_to: DashMap<EndpointId, HashSet<EndpointId>>, +37} +38 +39#[derive(Debug)] +40struct ClientState { +41 active: Client, +42 inactive: Vec<Client>, +43} +44 +45impl ClientState { +46 async fn shutdown_all(mut self) { +47 [self.active] +48 .into_iter() +49 .chain(self.inactive.drain(..)) +50 .map(Client::shutdown) +51 .join_all() +52 .await; +53 } +54} +55 +56impl Clients { +57 /// Shuts down all connected clients. +58 /// +59 /// This method gracefully disconnects all active client connections managed by +60 /// this registry. It will wait for all clients to complete their shutdown before +61 /// returning. +62 pub async fn shutdown(&self) { +63 let keys: Vec<_> = self.0.clients.iter().map(|x| *x.key()).collect(); +64 trace!("shutting down {} clients", keys.len()); +65 let clients = keys.into_iter().filter_map(|k| self.0.clients.remove(&k)); +66 n0_future::join_all(clients.map(|(_, state)| state.shutdown_all())).await; +67 } +68 +69 /// Builds the client handler and starts the read & write loops for the connection. +70 /// +71 /// Once the client disconnects, the [`OnDisconnectGuard`] set in `config` will be dropped, +72 /// allowing callers to be notified of the disconnect. +73 pub fn register<S>(&self, client_config: Config<S>, metrics: Arc<Metrics>) +74 where +75 S: BytesStreamSink + Send + 'static, +76 { +77 let endpoint_id = client_config.guard.endpoint_id; +78 trace!(remote_endpoint = %endpoint_id.fmt_short(), "registering client"); +79 +80 let client = Client::new(client_config, self, metrics.clone()); +81 match self.0.clients.entry(endpoint_id) { +82 dashmap::Entry::Occupied(mut entry) => { +83 let state = entry.get_mut(); +84 let old_client = std::mem::replace(&mut state.active, client); +85 debug!( +86 remote_endpoint = %endpoint_id.fmt_short(), +87 "multiple connections found, deactivating old connection", +88 ); +89 old_client +90 .try_send_health(Status::SameEndpointIdConnected) +91 .ok(); +92 state.inactive.push(old_client); +93 metrics.clients_inactive_added.inc(); +94 } +95 dashmap::Entry::Vacant(entry) => { +96 entry.insert(ClientState { +97 active: client, +98 inactive: Vec::new(), +99 }); +100 } +101 } +102 } +103 +104 /// Removes the client from the map of clients, & sends a notification +105 /// to each client that peers has sent data to, to let them know that +106 /// peer is gone from the network. +107 /// +108 /// Must be passed a matching connection_id. +109 pub(super) fn unregister(&self, guard: OnDisconnectGuard, metrics: &Metrics) { +110 let endpoint_id = guard.endpoint_id; +111 let connection_id = guard.connection_id; +112 trace!( +113 endpoint_id = %endpoint_id.fmt_short(), +114 %connection_id, "unregistering client" +115 ); +116 +117 let mut notify_peers = None; +118 +119 self.0.clients.remove_if_mut(&endpoint_id, |_id, state| { +120 if state.active.connection_id() == connection_id { +121 // The unregistering client is the currently active client +122 if let Some(last_inactive_client) = state.inactive.pop() { +123 metrics.clients_inactive_removed.inc(); +124 // There is an inactive client, promote to active again. +125 state.active = last_inactive_client; +126 // Inform the old client that it is healthy again. +127 state.active.try_send_health(Status::Healthy).ok(); +128 // Don't remove the entry from client map. +129 false +130 } else { +131 // No inactive clients: collect sent_to set for peer-gone notifications. +132 notify_peers = self.0.sent_to.remove(&endpoint_id).map(|(_, peers)| peers); +133 // Remove entry from the client map. +134 true +135 } +136 } else { +137 // The unregistering client is already inactive. Remove from the list of inactive clients. +138 state +139 .inactive +140 .retain(|client| client.connection_id() != connection_id); +141 metrics.clients_inactive_removed.inc(); +142 // Active client is unmodified: keep entry in map. +143 false +144 } +145 }); +146 +147 // Inform peers that this endpoint is gone. +148 // Done outside the remove_if_mut closure to avoid DashMap deadlocks. +149 if let Some(peers) = notify_peers { +150 for peer_id in peers { +151 if let Some(peer) = self.0.clients.get(&peer_id) { +152 match peer.active.try_send_peer_gone(endpoint_id) { +153 Ok(_) => {} +154 Err(TrySendError::Full(_)) => { +155 debug!( +156 dst = %peer_id.fmt_short(), +157 "client too busy to receive peer gone notification, dropping" +158 ); +159 } +160 Err(TrySendError::Closed(_)) => { +161 debug!( +162 dst = %peer_id.fmt_short(), +163 "can no longer write to client, dropping peer gone notification" +164 ); +165 } +166 } +167 } +168 } +169 } +170 } +171 +172 /// Disconnects connections registered for `endpoint_id`. +173 /// +174 /// With `Some(connection_id)`, disconnects only that connection (active or +175 /// an inactive duplicate). With `None`, disconnects every connection for the +176 /// endpoint. Returns `true` if a matching connection was found, or `false` +177 /// otherwise. +178 /// +179 /// Shutdown happens asynchronously: each per-connection actor exits its run +180 /// loop and unregisters itself after this call returns. +181 pub fn disconnect(&self, endpoint_id: EndpointId, connection_id: Option<ConnectionId>) -> bool { +182 let Some(state) = self.0.clients.get(&endpoint_id) else { +183 return false; +184 }; +185 let mut clients = state.inactive.iter().chain([&state.active]); +186 if let Some(id) = connection_id { +187 let Some(client) = clients.find(|c| c.connection_id() == id) else { +188 return false; +189 }; +190 client.start_shutdown(); +191 } else { +192 for client in clients { +193 client.start_shutdown(); +194 } +195 } +196 true +197 } +198 +199 /// Attempt to send a packet to client with [`EndpointId`] `dst`. +200 pub(super) fn send_packet( +201 &self, +202 dst: EndpointId, +203 data: Datagrams, +204 src: EndpointId, +205 metrics: &Metrics, +206 ) -> Result<(), ForwardPacketError> { +207 let Some(client) = self.0.clients.get(&dst) else { +208 debug!(dst = %dst.fmt_short(), "no connected client, dropped packet"); +209 metrics.send_packets_dropped.inc(); +210 return Ok(()); +211 }; +212 match client.active.try_send_packet(src, data) { +213 Ok(_) => { +214 // Record sent_to relationship +215 self.0.sent_to.entry(src).or_default().insert(dst); +216 Ok(()) +217 } +218 Err(TrySendError::Full(_)) => { +219 debug!( +220 dst = %dst.fmt_short(), +221 "client too busy to receive packet, dropping packet" +222 ); +223 Err(ForwardPacketError::new(SendError::Full)) +224 } +225 Err(TrySendError::Closed(_)) => { +226 debug!( +227 dst = %dst.fmt_short(), +228 "can no longer write to client, dropping message and pruning connection" +229 ); +230 client.active.start_shutdown(); +231 Err(ForwardPacketError::new(SendError::Closed)) +232 } +233 } +234 } +235 +236 #[cfg(test)] +237 fn active_connection_id(&self, endpoint_id: EndpointId) -> Option<ConnectionId> { +238 self.0 +239 .clients +240 .get(&endpoint_id) +241 .map(|s| s.active.connection_id()) +242 } +243} +244 +245#[cfg(test)] +246mod tests { +247 use std::time::Duration; +248 +249 use iroh_base::SecretKey; +250 use n0_error::{Result, StdResultExt}; +251 use n0_future::{Stream, StreamExt}; +252 use n0_tracing_test::traced_test; +253 use rand::{RngExt, SeedableRng}; +254 +255 use super::*; +256 use crate::{ +257 client::conn::Conn, +258 http::ProtocolVersion, +259 protos::{common::FrameType, relay::RelayToClientMsg, streams::WsBytesFramed}, +260 server::streams::{MaybeTlsStream, RateLimited, ServerRelayedStream}, +261 }; +262 +263 async fn recv_frame< +264 E: std::error::Error + Sync + Send + 'static, +265 S: Stream<Item = Result<RelayToClientMsg, E>> + Unpin, +266 >( +267 frame_type: FrameType, +268 mut stream: S, +269 ) -> Result<RelayToClientMsg> { +270 match stream.next().await { +271 Some(Ok(frame)) => { +272 if frame_type != frame.typ() { +273 n0_error::bail_any!( +274 "Unexpected frame, got {:?}, but expected {:?}", +275 frame.typ(), +276 frame_type +277 ); +278 } +279 Ok(frame) +280 } +281 Some(Err(err)) => Err(err).anyerr(), +282 None => n0_error::bail_any!("Unexpected EOF, expected frame {frame_type:?}"), +283 } +284 } +285 +286 fn test_client_builder( +287 key: EndpointId, +288 ) -> (Config<WsBytesFramed<RateLimited<MaybeTlsStream>>>, Conn) { +289 let (server, client) = tokio::io::duplex(1024); +290 let guard = OnDisconnectGuard::empty(key); +291 let protocol_version = ProtocolVersion::default(); +292 let mut config = Config::new(guard, ServerRelayedStream::test(server), protocol_version); +293 config.write_timeout = Duration::from_secs(1); +294 config.channel_capacity = 10; +295 (config, Conn::test(client, protocol_version)) +296 } +297 +298 #[tokio::test] +299 #[traced_test] +300 async fn test_clients() -> Result { +301 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +302 let a_key = SecretKey::from_bytes(&rng.random()).public(); +303 let b_key = SecretKey::from_bytes(&rng.random()).public(); +304 +305 let (builder_a, mut a_rw) = test_client_builder(a_key); +306 +307 let clients = Clients::default(); +308 let metrics = Arc::new(Metrics::default()); +309 clients.register(builder_a, metrics.clone()); +310 +311 // send packet +312 let data = b"hello world!"; +313 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; +314 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a_rw).await?; +315 assert_eq!( +316 frame, +317 RelayToClientMsg::Datagrams { +318 remote_endpoint_id: b_key, +319 datagrams: data.to_vec().into(), +320 } +321 ); +322 +323 { +324 let client = clients.0.clients.get(&a_key).unwrap(); +325 // shutdown client a, this should trigger the removal from the clients list +326 client.active.start_shutdown(); +327 } +328 +329 // need to wait a moment for the removal to be processed +330 let c = clients.clone(); +331 tokio::time::timeout(Duration::from_secs(1), async move { +332 loop { +333 if !c.0.clients.contains_key(&a_key) { +334 break; +335 } +336 tokio::time::sleep(Duration::from_millis(100)).await; +337 } +338 }) +339 .await +340 .std_context("timeout")?; +341 clients.shutdown().await; +342 +343 Ok(()) +344 } +345 +346 #[tokio::test] +347 #[traced_test] +348 async fn test_clients_same_endpoint_id() -> Result { +349 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +350 let a_key = SecretKey::from_bytes(&rng.random()).public(); +351 let b_key = SecretKey::from_bytes(&rng.random()).public(); +352 +353 let (a1_builder, mut a1_rw) = test_client_builder(a_key); +354 +355 let clients = Clients::default(); +356 let metrics = Arc::new(Metrics::default()); +357 +358 // register client a +359 clients.register(a1_builder, metrics.clone()); +360 let a1_conn_id = clients.active_connection_id(a_key).unwrap(); +361 +362 // send packet and verify it is send to a1 +363 let data = b"hello world!"; +364 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; +365 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a1_rw).await?; +366 assert_eq!( +367 frame, +368 RelayToClientMsg::Datagrams { +369 remote_endpoint_id: b_key, +370 datagrams: data.to_vec().into(), +371 } +372 ); +373 +374 // register new client with same endpoint id +375 let (a2_builder, mut a2_rw) = test_client_builder(a_key); +376 clients.register(a2_builder, metrics.clone()); +377 let a2_conn_id = clients.active_connection_id(a_key).unwrap(); +378 assert!(a2_conn_id != a1_conn_id); +379 +380 // a1 is marked inactive and should receive a health frame +381 let frame = recv_frame(FrameType::Status, &mut a1_rw).await?; +382 assert_eq!( +383 frame, +384 RelayToClientMsg::Status(Status::SameEndpointIdConnected) +385 ); +386 +387 // send packet and verify it is send to a2 +388 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; +389 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a2_rw).await?; +390 assert_eq!( +391 frame, +392 RelayToClientMsg::Datagrams { +393 remote_endpoint_id: b_key, +394 datagrams: data.to_vec().into(), +395 } +396 ); +397 +398 // disconnect a2 +399 clients +400 .0 +401 .clients +402 .get(&a_key) +403 .unwrap() +404 .active +405 .start_shutdown(); +406 +407 // need to wait a moment for the removal to be processed +408 tokio::time::timeout(Duration::from_secs(1), { +409 let clients = clients.clone(); +410 async move { +411 // wait until the active connection is no longer a2 (which we unregistered) +412 while clients.active_connection_id(a_key) == Some(a2_conn_id) { +413 tokio::time::sleep(Duration::from_millis(100)).await; +414 } +415 } +416 }) +417 .await +418 .std_context("timeout")?; +419 +420 // a1 should be marked active again now +421 assert_eq!(clients.active_connection_id(a_key), Some(a1_conn_id)); +422 +423 // a1 is marked active again and should receive a health frame +424 let frame = recv_frame(FrameType::Status, &mut a1_rw).await?; +425 assert_eq!(frame, RelayToClientMsg::Status(Status::Healthy)); +426 +427 // a1 should receive packets +428 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; +429 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a1_rw).await?; +430 assert_eq!( +431 frame, +432 RelayToClientMsg::Datagrams { +433 remote_endpoint_id: b_key, +434 datagrams: data.to_vec().into(), +435 } +436 ); +437 +438 // after shutting down the now-active client, there should no longer be an entry for that endpoint id +439 clients +440 .0 +441 .clients +442 .get(&a_key) +443 .unwrap() +444 .active +445 .start_shutdown(); +446 +447 // need to wait a moment for the removal to be processed +448 tokio::time::timeout(Duration::from_secs(1), { +449 let clients = clients.clone(); +450 async move { +451 // wait until the active connection is no longer a2 (which we unregistered) +452 while clients.0.clients.contains_key(&a_key) { +453 tokio::time::sleep(Duration::from_millis(100)).await; +454 } +455 } +456 }) +457 .await +458 .std_context("timeout")?; +459 +460 clients.shutdown().await; +461 +462 Ok(()) +463 } +464 +465 #[tokio::test] +466 #[traced_test] +467 async fn test_peer_gone_notification() -> Result { +468 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +469 let a_key = SecretKey::from_bytes(&rng.random()).public(); +470 let b_key = SecretKey::from_bytes(&rng.random()).public(); +471 +472 let clients = Clients::default(); +473 let metrics = Arc::new(Metrics::default()); +474 +475 // Register both clients +476 let (builder_a, _a_rw) = test_client_builder(a_key); +477 let (builder_b, mut b_rw) = test_client_builder(b_key); +478 clients.register(builder_a, metrics.clone()); +479 clients.register(builder_b, metrics.clone()); +480 +481 // A sends a packet to B (records sent_to[A] = {B}) +482 let data = b"hello b!"; +483 clients.send_packet(b_key, Datagrams::from(&data[..]), a_key, &metrics)?; +484 +485 // B receives the packet +486 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut b_rw).await?; +487 assert_eq!( +488 frame, +489 RelayToClientMsg::Datagrams { +490 remote_endpoint_id: a_key, +491 datagrams: data.to_vec().into(), +492 } +493 ); +494 +495 // Disconnect A +496 { +497 let client = clients.0.clients.get(&a_key).unwrap(); +498 client.active.start_shutdown(); +499 } +500 +501 // Wait for A to unregister +502 tokio::time::timeout(Duration::from_secs(1), { +503 let clients = clients.clone(); +504 async move { +505 while clients.0.clients.contains_key(&a_key) { +506 tokio::time::sleep(Duration::from_millis(100)).await; +507 } +508 } +509 }) +510 .await +511 .std_context("timeout waiting for A to unregister")?; +512 +513 // B should receive EndpointGone(a_key): notifying B that A is gone +514 let frame = recv_frame(FrameType::EndpointGone, &mut b_rw).await?; +515 assert_eq!(frame, RelayToClientMsg::EndpointGone(a_key)); +516 +517 clients.shutdown().await; +518 Ok(()) +519 } +520} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh_relay/server/metrics.rs.html b/pr/4036/docs/src/iroh_relay/server/metrics.rs.html index c74fed1e70..b999dca56b 100644 --- a/pr/4036/docs/src/iroh_relay/server/metrics.rs.html +++ b/pr/4036/docs/src/iroh_relay/server/metrics.rs.html @@ -10,123 +10,145 @@ 10 /* 11 * Metrics about packets 12 */ -13 /// Bytes sent from a `FrameType::SendPacket` -14 #[metrics(help = "Number of bytes sent.")] -15 pub bytes_sent: Counter, -16 /// Bytes received from a `FrameType::SendPacket` -17 #[metrics(help = "Number of bytes received.")] -18 pub bytes_recv: Counter, -19 -20 /// `FrameType::SendPacket` sent -21 #[metrics(help = "Number of 'send' packets relayed.")] -22 pub send_packets_sent: Counter, -23 /// `FrameType::SendPacket` received -24 #[metrics(help = "Number of 'send' packets received.")] -25 pub send_packets_recv: Counter, -26 /// `FrameType::SendPacket` dropped -27 #[metrics(help = "Number of 'send' packets dropped.")] -28 pub send_packets_dropped: Counter, -29 -30 /// Packets of other `FrameType`s sent -31 #[metrics(help = "Number of packets sent that were not 'send' packets")] -32 pub other_packets_sent: Counter, -33 /// Packets of other `FrameType`s received -34 #[metrics(help = "Number of packets received that were not 'send' packets")] -35 pub other_packets_recv: Counter, -36 /// Packets of other `FrameType`s dropped -37 #[metrics(help = "Number of times, non-send packet was dropped.")] -38 pub other_packets_dropped: Counter, -39 -40 /// Number of `FrameType::Ping`s received -41 #[metrics(help = "Number of times the server has received a Ping from a client.")] -42 pub got_ping: Counter, -43 /// Number of `FrameType::Pong`s sent -44 #[metrics(help = "Number of times the server has sent a Pong to a client.")] -45 pub sent_pong: Counter, -46 /// Number of `FrameType::Unknown` received -47 #[metrics(help = "Number of unknown frames sent to this server.")] -48 pub unknown_frames: Counter, -49 -50 /// Number of bytes received from client connection which have been rate-limited. -51 pub bytes_rx_ratelimited_total: Counter, -52 /// Number of client connections which have had any frames rate-limited. -53 pub conns_rx_ratelimited_total: Counter, -54 -55 /* -56 * Metrics about peers -57 */ -58 /// Number of times this server has accepted a connection. -59 pub accepts: Counter, -60 /// Number of connections we have removed because of an error -61 #[metrics(help = "Number of clients that have then disconnected.")] -62 pub disconnects: Counter, -63 -64 /// Number of unique client keys per day -65 pub unique_client_keys: Counter, -66 -67 /// Number of times a client was moved into the inactive state. -68 /// -69 /// A client becomes inactive when a new client connects with the same endpoint id. An inactive -70 /// client can still send messages, but won't receive anything. If the currently-active client -71 /// disconnects, and if there are inactive clients, the most-recent inactive client becomes -72 /// active again. -73 /// -74 /// The number of inactive clients at any time is `clients_inactive_added` - `clients_inactive_removed`. -75 pub clients_inactive_added: Counter, -76 -77 /// Number of times a client was removed from the inactive state. -78 /// -79 /// This is increased whenever a client disconnects while being inactive, or if a client is upgraded to be -80 /// active again (happens only when the currently-active client for that endpoint id disconnects). +13 /// Bytes sent to a client in [`RelayToClientDatagram`] or [`RelayToClientDatagramBatch`] frames. +14 /// +15 /// [`RelayToClientDatagram`]: crate::protos::common::FrameType::RelayToClientDatagram +16 /// [`RelayToClientDatagramBatch`]: crate::protos::common::FrameType::RelayToClientDatagramBatch +17 #[metrics(help = "Number of bytes sent.")] +18 pub bytes_sent: Counter, +19 /// Bytes received from a client in [`ClientToRelayDatagram`] or [`ClientToRelayDatagramBatch`] frames. +20 /// +21 /// [`ClientToRelayDatagram`]: crate::protos::common::FrameType::ClientToRelayDatagram +22 /// [`ClientToRelayDatagramBatch`]: crate::protos::common::FrameType::ClientToRelayDatagramBatch +23 #[metrics(help = "Number of bytes received.")] +24 pub bytes_recv: Counter, +25 +26 /// [`RelayToClientDatagram`] or [`RelayToClientDatagramBatch`] frames sent to a client. +27 /// +28 /// [`RelayToClientDatagram`]: crate::protos::common::FrameType::RelayToClientDatagram +29 /// [`RelayToClientDatagramBatch`]: crate::protos::common::FrameType::RelayToClientDatagramBatch +30 #[metrics(help = "Number of 'send' packets relayed.")] +31 pub send_packets_sent: Counter, +32 /// [`ClientToRelayDatagram`] or [`ClientToRelayDatagramBatch`] frames received from a client. +33 /// +34 /// [`ClientToRelayDatagram`]: crate::protos::common::FrameType::ClientToRelayDatagram +35 /// [`ClientToRelayDatagramBatch`]: crate::protos::common::FrameType::ClientToRelayDatagramBatch +36 #[metrics(help = "Number of 'send' packets received.")] +37 pub send_packets_recv: Counter, +38 /// [`RelayToClientDatagram`] or [`RelayToClientDatagramBatch`] frames dropped instead of being +39 /// delivered to a client, because the recipient is not connected or writing to its stream failed. +40 /// +41 /// Note that frames dropped because the recipient's send queue is full or closed are not counted +42 /// here. +43 /// +44 /// [`RelayToClientDatagram`]: crate::protos::common::FrameType::RelayToClientDatagram +45 /// [`RelayToClientDatagramBatch`]: crate::protos::common::FrameType::RelayToClientDatagramBatch +46 #[metrics(help = "Number of 'send' packets dropped.")] +47 pub send_packets_dropped: Counter, +48 +49 /// Intended to count sent frames other than datagrams, but currently unused (never incremented). +50 #[metrics(help = "Number of packets sent that were not 'send' packets")] +51 pub other_packets_sent: Counter, +52 /// Intended to count received frames other than datagrams, but currently unused (never incremented). +53 #[metrics(help = "Number of packets received that were not 'send' packets")] +54 pub other_packets_recv: Counter, +55 /// Intended to count dropped frames other than datagrams, but currently unused (never incremented). +56 #[metrics(help = "Number of times, non-send packet was dropped.")] +57 pub other_packets_dropped: Counter, +58 +59 /// Number of [`FrameType::Ping`](crate::protos::common::FrameType::Ping) frames received from a client. +60 #[metrics(help = "Number of times the server has received a Ping from a client.")] +61 pub got_ping: Counter, +62 /// Number of [`FrameType::Pong`](crate::protos::common::FrameType::Pong) frames sent to a client. +63 #[metrics(help = "Number of times the server has sent a Pong to a client.")] +64 pub sent_pong: Counter, +65 /// Intended to count received frames with an unrecognized [`FrameType`](crate::protos::common::FrameType), +66 /// but currently unused (never incremented). +67 #[metrics(help = "Number of unknown frames sent to this server.")] +68 pub unknown_frames: Counter, +69 +70 /// Number of bytes received from client connection which have been rate-limited. +71 pub bytes_rx_ratelimited_total: Counter, +72 /// Number of client connections which have had any frames rate-limited. +73 pub conns_rx_ratelimited_total: Counter, +74 +75 /* +76 * Metrics about peers +77 */ +78 /// Number of times this server has accepted a connection. +79 pub accepts: Counter, +80 /// Number of times a client connection was disconnected. 81 /// -82 /// See [`Self::clients_inactive_added`] for details on when a client becomes inactive. -83 pub clients_inactive_removed: Counter, -84 -85 // TODO: only important stat that we cannot track right now -86 // pub average_queue_duration: -87 // -88 /// Number of incoming QAD connections. -89 /// -90 /// After completion, each is counted in either `qad_incoming_error` or `qad_connections`. -91 /// -92 /// Thus the number of inflight incomings is `qad_incoming` - `qad_incoming_error` - `qad_connections`. -93 pub qad_incoming: Counter, -94 -95 /// Number of QAD QUIC connections that aborted before completing the handshake. -96 pub qad_incoming_error: Counter, -97 -98 /// Number of accepted QAD QUIC connections. -99 /// -100 /// The number of active connections is `qad_connections` - `qad_connections_closed`. -101 pub qad_connections: Counter, -102 -103 /// Number of QAD QUIC connections that disconnected after being accepted. -104 pub qad_connections_closed: Counter, -105 -106 /// Number of QAD QUIC connections that disconnected after being accepted, with an error. -107 /// -108 /// The number is *included* in `qad_connections_closed` (not in addition to). -109 pub qad_connections_errored: Counter, -110 -111 /// Number of accepted HTTP(S) connections. -112 /// -113 /// The number of active connections at any time is `http_connections` - `http_connections_closed` -114 pub http_connections: Counter, -115 -116 /// Number of terminated HTTP(S) connections. -117 pub http_connections_closed: Counter, -118 -119 /// Number of HTTP(S) connections that terminated with an error. -120 /// -121 /// The number is *included* in `http_connections_closed` (not in addition to). -122 pub http_connections_errored: Counter, -123} +82 /// Incremented once per connection, paired with [`Self::accepts`]. +83 #[metrics(help = "Number of clients that have then disconnected.")] +84 pub disconnects: Counter, +85 +86 /// Number of unique client keys per day +87 pub unique_client_keys: Counter, +88 +89 /// Number of times a client was moved into the inactive state. +90 /// +91 /// A client becomes inactive when a new client connects with the same endpoint id. An inactive +92 /// client can still send messages, but won't receive anything. If the currently-active client +93 /// disconnects, and if there are inactive clients, the most-recent inactive client becomes +94 /// active again. +95 /// +96 /// The number of inactive clients at any time is `clients_inactive_added` - `clients_inactive_removed`. +97 pub clients_inactive_added: Counter, +98 +99 /// Number of times a client was removed from the inactive state. +100 /// +101 /// This is increased whenever a client disconnects while being inactive, or if a client is upgraded to be +102 /// active again (happens only when the currently-active client for that endpoint id disconnects). +103 /// +104 /// See [`Self::clients_inactive_added`] for details on when a client becomes inactive. +105 pub clients_inactive_removed: Counter, +106 +107 // TODO: only important stat that we cannot track right now +108 // pub average_queue_duration: +109 // +110 /// Number of incoming QAD connections. +111 /// +112 /// After completion, each is counted in either `qad_incoming_error` or `qad_connections`. +113 /// +114 /// Thus the number of inflight incomings is `qad_incoming` - `qad_incoming_error` - `qad_connections`. +115 pub qad_incoming: Counter, +116 +117 /// Number of QAD QUIC connections that aborted before completing the handshake. +118 pub qad_incoming_error: Counter, +119 +120 /// Number of accepted QAD QUIC connections. +121 /// +122 /// The number of active connections is `qad_connections` - `qad_connections_closed`. +123 pub qad_connections: Counter, 124 -125/// All metrics tracked in the relay server. -126#[derive(Debug, Default, Clone, MetricsGroupSet)] -127#[metrics(name = "relay")] -128#[non_exhaustive] -129pub struct RelayMetrics { -130 /// Metrics tracked for the relay server. -131 pub server: Arc<Metrics>, -132} \ No newline at end of file +125 /// Number of QAD QUIC connections that disconnected after being accepted. +126 pub qad_connections_closed: Counter, +127 +128 /// Number of QAD QUIC connections that disconnected after being accepted, with an error. +129 /// +130 /// The number is *included* in `qad_connections_closed` (not in addition to). +131 pub qad_connections_errored: Counter, +132 +133 /// Number of accepted HTTP(S) connections. +134 /// +135 /// The number of active connections at any time is `http_connections` - `http_connections_closed` +136 pub http_connections: Counter, +137 +138 /// Number of terminated HTTP(S) connections. +139 pub http_connections_closed: Counter, +140 +141 /// Number of HTTP(S) connections that terminated with an error. +142 /// +143 /// The number is *included* in `http_connections_closed` (not in addition to). +144 pub http_connections_errored: Counter, +145} +146 +147/// All metrics tracked in the relay server. +148#[derive(Debug, Default, Clone, MetricsGroupSet)] +149#[metrics(name = "relay")] +150#[non_exhaustive] +151pub struct RelayMetrics { +152 /// Metrics tracked for the relay server. +153 pub server: Arc<Metrics>, +154} \ No newline at end of file diff --git a/pr/4036/docs/src/iroh_relay/server/streams.rs.html b/pr/4036/docs/src/iroh_relay/server/streams.rs.html index 7288184725..f1742cdc22 100644 --- a/pr/4036/docs/src/iroh_relay/server/streams.rs.html +++ b/pr/4036/docs/src/iroh_relay/server/streams.rs.html @@ -324,8 +324,8 @@ 324/// 325/// The writes to the sink are not rate limited. 326/// -327/// This potentially buffers one frame if the rate limiter does not allows this frame. -328/// While the frame is buffered the undernlying stream is no longer polled. +327/// This potentially buffers one frame if the rate limiter does not allow this frame. +328/// While the frame is buffered the underlying stream is no longer polled. 329#[derive(Debug)] 330pub(crate) struct RateLimited<S> { 331 inner: S, diff --git a/pr/4036/docs/src/iroh_relay/tls.rs.html b/pr/4036/docs/src/iroh_relay/tls.rs.html index 0c68331df1..397477ee30 100644 --- a/pr/4036/docs/src/iroh_relay/tls.rs.html +++ b/pr/4036/docs/src/iroh_relay/tls.rs.html @@ -217,7 +217,7 @@ 217 218/// Function to build a [`ServerCertVerifier`] from a [`CryptoProvider`]. 219/// -220/// See [`CaTlsConfig::custom_server_cert_verifier]. +220/// See [`CaTlsConfig::custom_server_cert_verifier`]. 221pub type ServerCertVerifierBuilder = Arc< 222 dyn Fn(Arc<CryptoProvider>) -> io::Result<Arc<dyn ServerCertVerifier>> + Send + Sync + 'static, 223>; diff --git a/pr/4036/docs/type.impl/iroh/endpoint/struct.Connection.js b/pr/4036/docs/type.impl/iroh/endpoint/struct.Connection.js index 6f59d00306..933051ec23 100644 --- a/pr/4036/docs/type.impl/iroh/endpoint/struct.Connection.js +++ b/pr/4036/docs/type.impl/iroh/endpoint/struct.Connection.js @@ -1,9 +1,9 @@ (function() { - var type_impls = Object.fromEntries([["iroh",[["
    Source§

    impl<State: Clone + ConnectionState> Clone for Connection<State>
    where\n State::Data: Clone,

    Source§

    fn clone(&self) -> Connection<State>

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    ","Clone","iroh::endpoint::connection::OutgoingZeroRttConnection","iroh::endpoint::connection::IncomingZeroRttConnection"],["
    Source§

    impl Connection<IncomingZeroRtt>

    Source

    pub fn alpn(&self) -> Option<Vec<u8>>

    Extracts the ALPN protocol from the peer’s handshake data.

    \n
    Source

    pub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>

    Waits until the full handshake occurs and then returns a Connection.

    \n

    This may fail with ConnectingError::ConnectionError, if there was\nsome general failure with the connection, such as a network timeout since\nwe accepted the connection.

    \n

    This may fail with ConnectingError::HandshakeFailure, if the other side\ndoesn’t use the right TLS authentication, which usually every iroh endpoint\nuses and requires.

    \n

    Thus, those errors should only occur if someone connects to you with a\nmodified iroh endpoint or with a plain QUIC client.

    \n
    Source

    pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>

    Returns the EndpointId from the peer’s TLS certificate.

    \n

    The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is\nincluded in the TLS certificate presented during the handshake when connecting.\nThis function allows you to get the EndpointId of the remote endpoint of this\nconnection.

    \n
    ",0,"iroh::endpoint::connection::IncomingZeroRttConnection"],["
    Source§

    impl Connection<OutgoingZeroRtt>

    Source

    pub fn alpn(&self) -> Option<Vec<u8>>

    Extracts the ALPN protocol from the peer’s handshake data.

    \n
    Source

    pub async fn handshake_completed(\n &self,\n) -> Result<ZeroRttStatus, ConnectingError>

    Waits until the full handshake occurs and returns a ZeroRttStatus.

    \n

    If ZeroRttStatus::Accepted is returned, than any streams created before\nthe handshake has completed can still be used.

    \n

    If ZeroRttStatus::Rejected is returned, than any streams created before\nthe handshake will error and any data sent should be re-sent on a\nnew stream.

    \n

    This may fail with ConnectingError::ConnectionError, if there was\nsome general failure with the connection, such as a network timeout since\nwe initiated the connection.

    \n

    This may fail with ConnectingError::HandshakeFailure, if the other side\ndoesn’t use the right TLS authentication, which usually every iroh endpoint\nuses and requires.

    \n

    Thus, those errors should only occur if someone connects to you with a\nmodified iroh endpoint or with a plain QUIC client.

    \n
    Source

    pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>

    Returns the EndpointId from the peer’s TLS certificate.

    \n

    The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is\nincluded in the TLS certificate presented during the handshake when connecting.\nThis function allows you to get the EndpointId of the remote endpoint of this\nconnection.

    \n
    ",0,"iroh::endpoint::connection::OutgoingZeroRttConnection"],["
    Source§

    impl<T: ConnectionState> Connection<T>

    Source

    pub fn open_uni(&self) -> OpenUni<'_> ⓘ

    Initiates a new outgoing unidirectional stream.

    \n

    Streams are cheap and instantaneous to open unless blocked by flow control. As a\nconsequence, the peer won’t be notified that a stream has been opened until the\nstream is actually used.

    \n
    Source

    pub fn open_bi(&self) -> OpenBi<'_> ⓘ

    Initiates a new outgoing bidirectional stream.

    \n

    Streams are cheap and instantaneous to open unless blocked by flow control. As a\nconsequence, the peer won’t be notified that a stream has been opened until the\nstream is actually used. Calling open_bi then waiting on the RecvStream\nwithout writing anything to SendStream will never succeed.

    \n
    Source

    pub fn accept_uni(&self) -> AcceptUni<'_> ⓘ

    Accepts the next incoming uni-directional stream.

    \n
    Source

    pub fn accept_bi(&self) -> AcceptBi<'_> ⓘ

    Accept the next incoming bidirectional stream.

    \n

    Important Note: The peer that calls open_bi must write to its SendStream\nbefore the peer Connection is able to accept the stream using\naccept_bi(). Calling open_bi then waiting on the RecvStream without\nwriting anything to the connected SendStream will never succeed.

    \n
    Source

    pub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ

    Receives an application datagram.

    \n
    Source

    pub async fn closed(&self) -> ConnectionError

    Wait for the connection to be closed for any reason.

    \n

    Despite the return type’s name, closed connections are often not an error condition\nat the application layer. Cases that might be routine include\nConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.

    \n
    Source

    pub fn close_reason(&self) -> Option<ConnectionError>

    If the connection is closed, the reason why.

    \n

    Returns None if the connection is still open.

    \n
    Source

    pub fn close(&self, error_code: VarInt, reason: &[u8])

    Closes the connection immediately.

    \n

    Pending operations will fail immediately with ConnectionError::LocallyClosed. No\nmore data is sent to the peer and the peer may drop buffered data upon receiving the\nCONNECTION_CLOSE frame.

    \n

    error_code and reason are not interpreted, and are provided directly to the\npeer.

    \n

    reason will be truncated to fit in a single packet with overhead; to improve odds\nthat it is preserved in full, it should be kept under 1KiB.

    \n
    §Gracefully closing a connection
    \n

    Only the peer last receiving application data can be certain that all data is\ndelivered. The only reliable action it can then take is to close the connection,\npotentially with a custom error code. The delivery of the final CONNECTION_CLOSE\nframe is very likely if both endpoints stay online long enough, calling\nEndpoint::close will wait to provide sufficient time. Otherwise, the remote peer\nwill time out the connection, provided that the idle timeout is not disabled.

    \n

    The sending side can not guarantee all stream data is delivered to the remote\napplication. It only knows the data is delivered to the QUIC stack of the remote\nendpoint. Once the local side sends a CONNECTION_CLOSE frame in response to calling\nclose the remote endpoint may drop any data it received but is as yet\nundelivered to the application, including data that was acknowledged as received to\nthe local endpoint.

    \n
    Source

    pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>

    Transmits data as an unreliable, unordered application datagram.

    \n

    Application datagrams are a low-level primitive. They may be lost or delivered out\nof order, and data must both fit inside a single QUIC packet and be smaller than\nthe maximum dictated by the peer.

    \n
    Source

    pub fn send_datagram_wait(&self, data: Bytes) -> SendDatagram<'_> ⓘ

    Transmits data as an unreliable, unordered application datagram

    \n

    Unlike send_datagram(), this method will wait for buffer space during congestion\nconditions, which effectively prioritizes old datagrams over new datagrams.

    \n

    See send_datagram() for details.

    \n
    Source

    pub fn max_datagram_size(&self) -> Option<usize>

    Computes the maximum size of datagrams that may be passed to send_datagram.

    \n

    Returns None if datagrams are unsupported by the peer or disabled locally.

    \n

    This may change over the lifetime of a connection according to variation in the path\nMTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the\npeer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.

    \n

    Not necessarily the maximum size of received datagrams.

    \n
    Source

    pub fn datagram_send_buffer_space(&self) -> usize

    Bytes available in the outgoing datagram buffer.

    \n

    When greater than zero, calling send_datagram with a\ndatagram of at most this size is guaranteed not to cause older datagrams to be\ndropped.

    \n
    Source

    pub fn rtt(&self, path_id: PathId) -> Option<Duration>

    Current best estimate of this connection’s latency (round-trip-time).

    \n
    Source

    pub fn stats(&self) -> ConnectionStats

    Returns connection statistics.

    \n
    Source

    pub fn congestion_state(&self, path_id: PathId) -> Option<Box<dyn Controller>>

    Current state of the congestion control algorithm, for debugging purposes.

    \n
    Source

    pub fn handshake_data(&self) -> Option<Box<dyn Any>>

    Parameters negotiated during the handshake.

    \n

    Guaranteed to return Some on fully established connections or after\nConnecting::handshake_data() succeeds. See that method’s documentations for\ndetails on the returned value.

    \n
    Source

    pub fn peer_identity(&self) -> Option<Box<dyn Any>>

    Cryptographic identity of the peer.

    \n

    The dynamic type returned is determined by the configured Session. For the\ndefault rustls session, the return value can be downcast to a\nVec<[rustls::pki_types::CertificateDer]>

    \n
    Source

    pub fn stable_id(&self) -> usize

    A stable identifier for this connection.

    \n

    Peer addresses and connection IDs can change, but this value will remain fixed for\nthe lifetime of the connection.

    \n
    Source

    pub fn export_keying_material(\n &self,\n output: &mut [u8],\n label: &[u8],\n context: &[u8],\n) -> Result<(), ExportKeyingMaterialError>

    Derives keying material from this connection’s TLS session secrets.

    \n

    When both peers call this method with the same label and context\narguments and output buffers of equal length, they will get the\nsame sequence of bytes in output. These bytes are cryptographically\nstrong and pseudorandom, and are suitable for use as keying material.

    \n

    See RFC5705 for more information.

    \n
    Source

    pub fn set_max_concurrent_uni_streams(&self, count: VarInt)

    Modifies the number of unidirectional streams that may be concurrently opened.

    \n

    No streams may be opened by the peer unless fewer than count are already\nopen. Large counts increase both minimum and worst-case memory consumption.

    \n
    Source

    pub fn set_receive_window(&self, receive_window: VarInt)

    See [noq_proto::TransportConfig::receive_window].

    \n
    Source

    pub fn set_max_concurrent_bi_streams(&self, count: VarInt)

    Modifies the number of bidirectional streams that may be concurrently opened.

    \n

    No streams may be opened by the peer unless fewer than count are already\nopen. Large counts increase both minimum and worst-case memory consumption.

    \n
    ",0,"iroh::endpoint::connection::OutgoingZeroRttConnection","iroh::endpoint::connection::IncomingZeroRttConnection"],["
    Source§

    impl<State: Debug + ConnectionState> Debug for Connection<State>
    where\n State::Data: Debug,

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Debug","iroh::endpoint::connection::OutgoingZeroRttConnection","iroh::endpoint::connection::IncomingZeroRttConnection"]]]]); + var type_impls = Object.fromEntries([["iroh",[["
    Source§

    impl<State: Clone + ConnectionState> Clone for Connection<State>
    where\n State::Data: Clone,

    Source§

    fn clone(&self) -> Connection<State>

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    ","Clone","iroh::endpoint::connection::OutgoingZeroRttConnection","iroh::endpoint::connection::IncomingZeroRttConnection"],["
    Source§

    impl Connection<IncomingZeroRtt>

    Source

    pub fn alpn(&self) -> Option<Vec<u8>>

    Extracts the ALPN protocol from the peer’s handshake data.

    \n
    Source

    pub async fn handshake_completed(&self) -> Result<Connection, ConnectingError>

    Waits until the full handshake occurs and then returns a Connection.

    \n

    This may fail with ConnectingError::ConnectionError, if there was\nsome general failure with the connection, such as a network timeout since\nwe accepted the connection.

    \n

    This may fail with ConnectingError::HandshakeFailure, if the other side\ndoesn’t use the right TLS authentication, which usually every iroh endpoint\nuses and requires.

    \n

    Thus, those errors should only occur if someone connects to you with a\nmodified iroh endpoint or with a plain QUIC client.

    \n
    Source

    pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>

    Returns the EndpointId from the peer’s TLS certificate.

    \n

    The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is\nincluded in the TLS certificate presented during the handshake when connecting.\nThis function allows you to get the EndpointId of the remote endpoint of this\nconnection.

    \n
    ",0,"iroh::endpoint::connection::IncomingZeroRttConnection"],["
    Source§

    impl Connection<OutgoingZeroRtt>

    Source

    pub fn alpn(&self) -> Option<Vec<u8>>

    Extracts the ALPN protocol from the peer’s handshake data.

    \n
    Source

    pub async fn handshake_completed(\n &self,\n) -> Result<ZeroRttStatus, ConnectingError>

    Waits until the full handshake occurs and returns a ZeroRttStatus.

    \n

    If ZeroRttStatus::Accepted is returned, then any streams created before\nthe handshake has completed can still be used.

    \n

    If ZeroRttStatus::Rejected is returned, then any streams created before\nthe handshake will error and any data sent should be re-sent on a\nnew stream.

    \n

    This may fail with ConnectingError::ConnectionError, if there was\nsome general failure with the connection, such as a network timeout since\nwe initiated the connection.

    \n

    This may fail with ConnectingError::HandshakeFailure, if the other side\ndoesn’t use the right TLS authentication, which usually every iroh endpoint\nuses and requires.

    \n

    Thus, those errors should only occur if someone connects to you with a\nmodified iroh endpoint or with a plain QUIC client.

    \n
    Source

    pub fn remote_id(&self) -> Result<EndpointId, RemoteEndpointIdError>

    Returns the EndpointId from the peer’s TLS certificate.

    \n

    The PublicKey of an endpoint is also known as an EndpointId. This PublicKey is\nincluded in the TLS certificate presented during the handshake when connecting.\nThis function allows you to get the EndpointId of the remote endpoint of this\nconnection.

    \n
    ",0,"iroh::endpoint::connection::OutgoingZeroRttConnection"],["
    Source§

    impl<T: ConnectionState> Connection<T>

    Source

    pub fn open_uni(&self) -> OpenUni<'_> ⓘ

    Initiates a new outgoing unidirectional stream.

    \n

    Streams are cheap and instantaneous to open unless blocked by flow control. As a\nconsequence, the peer won’t be notified that a stream has been opened until the\nstream is actually used.

    \n
    Source

    pub fn open_bi(&self) -> OpenBi<'_> ⓘ

    Initiates a new outgoing bidirectional stream.

    \n

    Streams are cheap and instantaneous to open unless blocked by flow control. As a\nconsequence, the peer won’t be notified that a stream has been opened until the\nstream is actually used. Calling open_bi then waiting on the RecvStream\nwithout writing anything to SendStream will never succeed.

    \n
    Source

    pub fn accept_uni(&self) -> AcceptUni<'_> ⓘ

    Accepts the next incoming uni-directional stream.

    \n
    Source

    pub fn accept_bi(&self) -> AcceptBi<'_> ⓘ

    Accepts the next incoming bidirectional stream.

    \n

    Important Note: The peer that calls open_bi must write to its SendStream\nbefore the peer Connection is able to accept the stream using\naccept_bi(). Calling open_bi then waiting on the RecvStream without\nwriting anything to the connected SendStream will never succeed.

    \n
    Source

    pub fn read_datagram(&self) -> ReadDatagram<'_> ⓘ

    Receives an application datagram.

    \n
    Source

    pub async fn closed(&self) -> ConnectionError

    Waits for the connection to be closed for any reason.

    \n

    Despite the return type’s name, closed connections are often not an error condition\nat the application layer. Cases that might be routine include\nConnectionError::LocallyClosed and ConnectionError::ApplicationClosed.

    \n
    Source

    pub fn close_reason(&self) -> Option<ConnectionError>

    If the connection is closed, the reason why.

    \n

    Returns None if the connection is still open.

    \n
    Source

    pub fn close(&self, error_code: VarInt, reason: &[u8])

    Closes the connection immediately.

    \n

    Pending operations will fail immediately with ConnectionError::LocallyClosed. No\nmore data is sent to the peer and the peer may drop buffered data upon receiving the\nCONNECTION_CLOSE frame.

    \n

    error_code and reason are not interpreted, and are provided directly to the\npeer.

    \n

    reason will be truncated to fit in a single packet with overhead; to improve odds\nthat it is preserved in full, it should be kept under 1KiB.

    \n
    §Gracefully closing a connection
    \n

    Only the peer last receiving application data can be certain that all data is\ndelivered. The only reliable action it can then take is to close the connection,\npotentially with a custom error code. The delivery of the final CONNECTION_CLOSE\nframe is very likely if both endpoints stay online long enough, calling\nEndpoint::close will wait to provide sufficient time. Otherwise, the remote peer\nwill time out the connection, provided that the idle timeout is not disabled.

    \n

    The sending side can not guarantee all stream data is delivered to the remote\napplication. It only knows the data is delivered to the QUIC stack of the remote\nendpoint. Once the local side sends a CONNECTION_CLOSE frame in response to calling\nclose the remote endpoint may drop any data it received but is as yet\nundelivered to the application, including data that was acknowledged as received to\nthe local endpoint.

    \n
    Source

    pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>

    Transmits data as an unreliable, unordered application datagram.

    \n

    Application datagrams are a low-level primitive. They may be lost or delivered out\nof order, and data must both fit inside a single QUIC packet and be smaller than\nthe maximum dictated by the peer.

    \n
    Source

    pub fn send_datagram_wait(&self, data: Bytes) -> SendDatagram<'_> ⓘ

    Transmits data as an unreliable, unordered application datagram

    \n

    Unlike send_datagram(), this method will wait for buffer space during congestion\nconditions, which effectively prioritizes old datagrams over new datagrams.

    \n

    See send_datagram() for details.

    \n
    Source

    pub fn max_datagram_size(&self) -> Option<usize>

    Computes the maximum size of datagrams that may be passed to send_datagram.

    \n

    Returns None if datagrams are unsupported by the peer or disabled locally.

    \n

    This may change over the lifetime of a connection according to variation in the path\nMTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the\npeer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.

    \n

    Not necessarily the maximum size of received datagrams.

    \n
    Source

    pub fn datagram_send_buffer_space(&self) -> usize

    Bytes available in the outgoing datagram buffer.

    \n

    When greater than zero, calling send_datagram with a\ndatagram of at most this size is guaranteed not to cause older datagrams to be\ndropped.

    \n
    Source

    pub fn rtt(&self, path_id: PathId) -> Option<Duration>

    Current best estimate of this connection’s latency (round-trip-time).

    \n
    Source

    pub fn stats(&self) -> ConnectionStats

    Returns connection statistics.

    \n
    Source

    pub fn congestion_state(&self, path_id: PathId) -> Option<Box<dyn Controller>>

    Current state of the congestion control algorithm, for debugging purposes.

    \n
    Source

    pub fn handshake_data(&self) -> Option<Box<dyn Any>>

    Parameters negotiated during the handshake.

    \n

    Guaranteed to return Some on fully established connections or after\nConnecting::handshake_data() succeeds. See that method’s documentations for\ndetails on the returned value.

    \n
    Source

    pub fn peer_identity(&self) -> Option<Box<dyn Any>>

    Cryptographic identity of the peer.

    \n

    The dynamic type returned is determined by the configured Session. For the\ndefault rustls session, the return value can be downcast to a\nVec<[rustls::pki_types::CertificateDer]>

    \n
    Source

    pub fn stable_id(&self) -> usize

    A stable identifier for this connection.

    \n

    Peer addresses and connection IDs can change, but this value will remain fixed for\nthe lifetime of the connection.

    \n
    Source

    pub fn export_keying_material(\n &self,\n output: &mut [u8],\n label: &[u8],\n context: &[u8],\n) -> Result<(), ExportKeyingMaterialError>

    Derives keying material from this connection’s TLS session secrets.

    \n

    When both peers call this method with the same label and context\narguments and output buffers of equal length, they will get the\nsame sequence of bytes in output. These bytes are cryptographically\nstrong and pseudorandom, and are suitable for use as keying material.

    \n

    See RFC5705 for more information.

    \n
    Source

    pub fn set_max_concurrent_uni_streams(&self, count: VarInt)

    Modifies the number of unidirectional streams that may be concurrently opened.

    \n

    No streams may be opened by the peer unless fewer than count are already\nopen. Large counts increase both minimum and worst-case memory consumption.

    \n
    Source

    pub fn set_receive_window(&self, receive_window: VarInt)

    Sets the connection-level flow control receive window.

    \n

    See [noq_proto::TransportConfig::receive_window].

    \n
    Source

    pub fn set_max_concurrent_bi_streams(&self, count: VarInt)

    Modifies the number of bidirectional streams that may be concurrently opened.

    \n

    No streams may be opened by the peer unless fewer than count are already\nopen. Large counts increase both minimum and worst-case memory consumption.

    \n
    ",0,"iroh::endpoint::connection::OutgoingZeroRttConnection","iroh::endpoint::connection::IncomingZeroRttConnection"],["
    Source§

    impl<State: Debug + ConnectionState> Debug for Connection<State>
    where\n State::Data: Debug,

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Debug","iroh::endpoint::connection::OutgoingZeroRttConnection","iroh::endpoint::connection::IncomingZeroRttConnection"]]]]); if (window.register_type_impls) { window.register_type_impls(type_impls); } else { window.pending_type_impls = type_impls; } })() -//{"start":55,"fragment_lengths":[40401]} \ No newline at end of file +//{"start":55,"fragment_lengths":[40466]} \ No newline at end of file diff --git a/pr/4036/docs/type.impl/iroh/struct.PublicKey.js b/pr/4036/docs/type.impl/iroh/struct.PublicKey.js index ca1454d092..dcb22d67df 100644 --- a/pr/4036/docs/type.impl/iroh/struct.PublicKey.js +++ b/pr/4036/docs/type.impl/iroh/struct.PublicKey.js @@ -1,9 +1,9 @@ (function() { - var type_impls = Object.fromEntries([["iroh",[["
    Source§

    impl AsRef<[u8]> for PublicKey

    Source§

    fn as_ref(&self) -> &[u8] ⓘ

    Converts this type into a shared reference of the (usually inferred) input type.
    ","AsRef<[u8]>","iroh::EndpointId"],["
    Source§

    impl Borrow<[u8; 32]> for PublicKey

    Source§

    fn borrow(&self) -> &[u8; 32]

    Immutably borrows from an owned value. Read more
    ","Borrow<[u8; 32]>","iroh::EndpointId"],["
    Source§

    impl Clone for PublicKey

    Source§

    fn clone(&self) -> PublicKey

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    ","Clone","iroh::EndpointId"],["
    Source§

    impl Debug for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Debug","iroh::EndpointId"],["
    Source§

    impl Deref for PublicKey

    Source§

    type Target = [u8; 32]

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &<PublicKey as Deref>::Target

    Dereferences the value.
    ","Deref","iroh::EndpointId"],["
    Source§

    impl<'de> Deserialize<'de> for PublicKey

    Source§

    fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>
    where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","iroh::EndpointId"],["
    Source§

    impl Display for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Display","iroh::EndpointId"],["
    Source§

    impl FromStr for PublicKey

    Deserialises the PublicKey from it’s base32 encoding.

    \n

    Display is capable of serialising this format.

    \n
    Source§

    type Err = KeyParsingError

    The associated error which can be returned from parsing.
    Source§

    fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

    Parses a string s to return a value of this type. Read more
    ","FromStr","iroh::EndpointId"],["
    Source§

    impl Hash for PublicKey

    Source§

    fn hash<H>(&self, state: &mut H)
    where\n H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · Source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","iroh::EndpointId"],["
    Source§

    impl Ord for PublicKey

    Source§

    fn cmp(&self, other: &PublicKey) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · Source§

    fn max(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · Source§

    fn min(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · Source§

    fn clamp(self, min: Self, max: Self) -> Self
    where\n Self: Sized,

    Restrict a value to a certain interval. Read more
    ","Ord","iroh::EndpointId"],["
    Source§

    impl PartialEq for PublicKey

    Source§

    fn eq(&self, other: &PublicKey) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient,\nand should not be overridden without very good reason.
    ","PartialEq","iroh::EndpointId"],["
    Source§

    impl PartialOrd for PublicKey

    Source§

    fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · Source§

    fn lt(&self, other: &Rhs) -> bool

    Tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · Source§

    fn le(&self, other: &Rhs) -> bool

    Tests less than or equal to (for self and other) and is used by the\n<= operator. Read more
    1.0.0 · Source§

    fn gt(&self, other: &Rhs) -> bool

    Tests greater than (for self and other) and is used by the >\noperator. Read more
    1.0.0 · Source§

    fn ge(&self, other: &Rhs) -> bool

    Tests greater than or equal to (for self and other) and is used by\nthe >= operator. Read more
    ","PartialOrd","iroh::EndpointId"],["
    Source§

    impl PublicKey

    Source

    pub const LENGTH: usize = 32usize

    The length of an ed25519 PublicKey, in bytes.

    \n
    Source

    pub fn as_bytes(&self) -> &[u8; 32]

    Get this public key as a byte array.

    \n
    Source

    pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, KeyParsingError>

    Construct a PublicKey from a slice of bytes.

    \n
    §Warning
    \n

    This will return a SignatureError if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.

    \n
    Source

    pub fn verify(\n &self,\n message: &[u8],\n signature: &Signature,\n) -> Result<(), SignatureError>

    Verify a signature on a message with this secret key’s public key.

    \n
    §Return
    \n

    Returns Ok(()) if the signature is valid, and Err otherwise.

    \n
    Source

    pub fn fmt_short(&self) -> impl Display + Copy + 'static

    Convert to a hex string limited to the first 5 bytes for a friendly string\nrepresentation of the key.

    \n
    Source

    pub fn to_z32(&self) -> String

    Encodes this key in z-base-32,\nthe encoding used by pkarr domain names.

    \n
    Source

    pub fn from_z32(s: &str) -> Result<PublicKey, KeyParsingError>

    Parses a key from its z-base-32 encoding.

    \n
    ",0,"iroh::EndpointId"],["
    Source§

    impl Serialize for PublicKey

    Source§

    fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
    where\n S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    ","Serialize","iroh::EndpointId"],["
    Source§

    impl TryFrom<&[u8]> for PublicKey

    Source§

    type Error = KeyParsingError

    The type returned in the event of a conversion error.
    Source§

    fn try_from(\n bytes: &[u8],\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

    Performs the conversion.
    ","TryFrom<&[u8]>","iroh::EndpointId"],["
    Source§

    impl TryFrom<&[u8; 32]> for PublicKey

    Source§

    type Error = KeyParsingError

    The type returned in the event of a conversion error.
    Source§

    fn try_from(\n bytes: &[u8; 32],\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

    Performs the conversion.
    ","TryFrom<&[u8; 32]>","iroh::EndpointId"],["
    Source§

    impl Copy for PublicKey

    ","Copy","iroh::EndpointId"],["
    Source§

    impl Eq for PublicKey

    ","Eq","iroh::EndpointId"],["
    Source§

    impl StructuralPartialEq for PublicKey

    ","StructuralPartialEq","iroh::EndpointId"]]]]); + var type_impls = Object.fromEntries([["iroh",[["
    Source§

    impl AsRef<[u8]> for PublicKey

    Source§

    fn as_ref(&self) -> &[u8] ⓘ

    Converts this type into a shared reference of the (usually inferred) input type.
    ","AsRef<[u8]>","iroh::EndpointId"],["
    Source§

    impl Borrow<[u8; 32]> for PublicKey

    Source§

    fn borrow(&self) -> &[u8; 32]

    Immutably borrows from an owned value. Read more
    ","Borrow<[u8; 32]>","iroh::EndpointId"],["
    Source§

    impl Clone for PublicKey

    Source§

    fn clone(&self) -> PublicKey

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    ","Clone","iroh::EndpointId"],["
    Source§

    impl Debug for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Debug","iroh::EndpointId"],["
    Source§

    impl Deref for PublicKey

    Source§

    type Target = [u8; 32]

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &<PublicKey as Deref>::Target

    Dereferences the value.
    ","Deref","iroh::EndpointId"],["
    Source§

    impl<'de> Deserialize<'de> for PublicKey

    Source§

    fn deserialize<D>(\n deserializer: D,\n) -> Result<PublicKey, <D as Deserializer<'de>>::Error>
    where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","iroh::EndpointId"],["
    Source§

    impl Display for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Display","iroh::EndpointId"],["
    Source§

    impl FromStr for PublicKey

    Parses a PublicKey from its hex or base32 encoding.

    \n

    Display produces the hex encoding.

    \n
    Source§

    type Err = KeyParsingError

    The associated error which can be returned from parsing.
    Source§

    fn from_str(s: &str) -> Result<PublicKey, <PublicKey as FromStr>::Err>

    Parses a string s to return a value of this type. Read more
    ","FromStr","iroh::EndpointId"],["
    Source§

    impl Hash for PublicKey

    Source§

    fn hash<H>(&self, state: &mut H)
    where\n H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · Source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","iroh::EndpointId"],["
    Source§

    impl Ord for PublicKey

    Source§

    fn cmp(&self, other: &PublicKey) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · Source§

    fn max(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · Source§

    fn min(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · Source§

    fn clamp(self, min: Self, max: Self) -> Self
    where\n Self: Sized,

    Restrict a value to a certain interval. Read more
    ","Ord","iroh::EndpointId"],["
    Source§

    impl PartialEq for PublicKey

    Source§

    fn eq(&self, other: &PublicKey) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient,\nand should not be overridden without very good reason.
    ","PartialEq","iroh::EndpointId"],["
    Source§

    impl PartialOrd for PublicKey

    Source§

    fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · Source§

    fn lt(&self, other: &Rhs) -> bool

    Tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · Source§

    fn le(&self, other: &Rhs) -> bool

    Tests less than or equal to (for self and other) and is used by the\n<= operator. Read more
    1.0.0 · Source§

    fn gt(&self, other: &Rhs) -> bool

    Tests greater than (for self and other) and is used by the >\noperator. Read more
    1.0.0 · Source§

    fn ge(&self, other: &Rhs) -> bool

    Tests greater than or equal to (for self and other) and is used by\nthe >= operator. Read more
    ","PartialOrd","iroh::EndpointId"],["
    Source§

    impl PublicKey

    Source

    pub const LENGTH: usize = 32usize

    The length of an ed25519 PublicKey, in bytes.

    \n
    Source

    pub fn as_bytes(&self) -> &[u8; 32]

    Get this public key as a byte array.

    \n
    Source

    pub fn from_bytes(bytes: &[u8; 32]) -> Result<PublicKey, KeyParsingError>

    Construct a PublicKey from a slice of bytes.

    \n
    §Warning
    \n

    This will return a SignatureError if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.

    \n
    Source

    pub fn verify(\n &self,\n message: &[u8],\n signature: &Signature,\n) -> Result<(), SignatureError>

    Verify a signature on a message with this public key.

    \n
    §Return
    \n

    Returns Ok(()) if the signature is valid, and Err otherwise.

    \n
    Source

    pub fn fmt_short(&self) -> impl Display + Copy + 'static

    Convert to a hex string limited to the first 5 bytes for a friendly string\nrepresentation of the key.

    \n
    Source

    pub fn to_z32(&self) -> String

    Encodes this key in z-base-32,\nthe encoding used by pkarr domain names.

    \n
    Source

    pub fn from_z32(s: &str) -> Result<PublicKey, KeyParsingError>

    Parses a key from its z-base-32 encoding.

    \n
    ",0,"iroh::EndpointId"],["
    Source§

    impl Serialize for PublicKey

    Source§

    fn serialize<S>(\n &self,\n serializer: S,\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
    where\n S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    ","Serialize","iroh::EndpointId"],["
    Source§

    impl TryFrom<&[u8]> for PublicKey

    Source§

    type Error = KeyParsingError

    The type returned in the event of a conversion error.
    Source§

    fn try_from(\n bytes: &[u8],\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8]>>::Error>

    Performs the conversion.
    ","TryFrom<&[u8]>","iroh::EndpointId"],["
    Source§

    impl TryFrom<&[u8; 32]> for PublicKey

    Source§

    type Error = KeyParsingError

    The type returned in the event of a conversion error.
    Source§

    fn try_from(\n bytes: &[u8; 32],\n) -> Result<PublicKey, <PublicKey as TryFrom<&[u8; 32]>>::Error>

    Performs the conversion.
    ","TryFrom<&[u8; 32]>","iroh::EndpointId"],["
    Source§

    impl Copy for PublicKey

    ","Copy","iroh::EndpointId"],["
    Source§

    impl Eq for PublicKey

    ","Eq","iroh::EndpointId"],["
    Source§

    impl StructuralPartialEq for PublicKey

    ","StructuralPartialEq","iroh::EndpointId"]]]]); if (window.register_type_impls) { window.register_type_impls(type_impls); } else { window.pending_type_impls = type_impls; } })() -//{"start":55,"fragment_lengths":[48783]} \ No newline at end of file +//{"start":55,"fragment_lengths":[48752]} \ No newline at end of file diff --git a/pr/4036/docs/type.impl/iroh_base/struct.PublicKey.js b/pr/4036/docs/type.impl/iroh_base/struct.PublicKey.js index 48311ceeed..f859f2da26 100644 --- a/pr/4036/docs/type.impl/iroh_base/struct.PublicKey.js +++ b/pr/4036/docs/type.impl/iroh_base/struct.PublicKey.js @@ -1,9 +1,9 @@ (function() { - var type_impls = Object.fromEntries([["iroh_base",[["
    Source§

    impl AsRef<[u8]> for PublicKey

    Source§

    fn as_ref(&self) -> &[u8] ⓘ

    Converts this type into a shared reference of the (usually inferred) input type.
    ","AsRef<[u8]>","iroh_base::key::EndpointId"],["
    Source§

    impl Borrow<[u8; 32]> for PublicKey

    Source§

    fn borrow(&self) -> &[u8; 32]

    Immutably borrows from an owned value. Read more
    ","Borrow<[u8; 32]>","iroh_base::key::EndpointId"],["
    Source§

    impl Clone for PublicKey

    Source§

    fn clone(&self) -> PublicKey

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    ","Clone","iroh_base::key::EndpointId"],["
    Source§

    impl Debug for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Debug","iroh_base::key::EndpointId"],["
    Source§

    impl Deref for PublicKey

    Source§

    type Target = [u8; 32]

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    ","Deref","iroh_base::key::EndpointId"],["
    Source§

    impl<'de> Deserialize<'de> for PublicKey

    Source§

    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","iroh_base::key::EndpointId"],["
    Source§

    impl Display for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Display","iroh_base::key::EndpointId"],["
    Source§

    impl FromStr for PublicKey

    Deserialises the PublicKey from it’s base32 encoding.

    \n

    Display is capable of serialising this format.

    \n
    Source§

    type Err = KeyParsingError

    The associated error which can be returned from parsing.
    Source§

    fn from_str(s: &str) -> Result<Self, Self::Err>

    Parses a string s to return a value of this type. Read more
    ","FromStr","iroh_base::key::EndpointId"],["
    Source§

    impl Hash for PublicKey

    Source§

    fn hash<H: Hasher>(&self, state: &mut H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · Source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","iroh_base::key::EndpointId"],["
    Source§

    impl Ord for PublicKey

    Source§

    fn cmp(&self, other: &Self) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · Source§

    fn max(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · Source§

    fn min(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · Source§

    fn clamp(self, min: Self, max: Self) -> Self
    where\n Self: Sized,

    Restrict a value to a certain interval. Read more
    ","Ord","iroh_base::key::EndpointId"],["
    Source§

    impl PartialEq for PublicKey

    Source§

    fn eq(&self, other: &PublicKey) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient,\nand should not be overridden without very good reason.
    ","PartialEq","iroh_base::key::EndpointId"],["
    Source§

    impl PartialOrd for PublicKey

    Source§

    fn partial_cmp(&self, other: &Self) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · Source§

    fn lt(&self, other: &Rhs) -> bool

    Tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · Source§

    fn le(&self, other: &Rhs) -> bool

    Tests less than or equal to (for self and other) and is used by the\n<= operator. Read more
    1.0.0 · Source§

    fn gt(&self, other: &Rhs) -> bool

    Tests greater than (for self and other) and is used by the >\noperator. Read more
    1.0.0 · Source§

    fn ge(&self, other: &Rhs) -> bool

    Tests greater than or equal to (for self and other) and is used by\nthe >= operator. Read more
    ","PartialOrd","iroh_base::key::EndpointId"],["
    Source§

    impl PublicKey

    Source

    pub const LENGTH: usize = 32usize

    The length of an ed25519 PublicKey, in bytes.

    \n
    Source

    pub fn as_bytes(&self) -> &[u8; 32]

    Get this public key as a byte array.

    \n
    Source

    pub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, KeyParsingError>

    Construct a PublicKey from a slice of bytes.

    \n
    §Warning
    \n

    This will return a SignatureError if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.

    \n
    Source

    pub fn verify(\n &self,\n message: &[u8],\n signature: &Signature,\n) -> Result<(), SignatureError>

    Verify a signature on a message with this secret key’s public key.

    \n
    §Return
    \n

    Returns Ok(()) if the signature is valid, and Err otherwise.

    \n
    Source

    pub fn fmt_short(&self) -> impl Display + Copy + 'static

    Convert to a hex string limited to the first 5 bytes for a friendly string\nrepresentation of the key.

    \n
    Source

    pub fn to_z32(&self) -> String

    Encodes this key in z-base-32,\nthe encoding used by pkarr domain names.

    \n
    Source

    pub fn from_z32(s: &str) -> Result<Self, KeyParsingError>

    Parses a key from its z-base-32 encoding.

    \n
    ",0,"iroh_base::key::EndpointId"],["
    Source§

    impl Serialize for PublicKey

    Source§

    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where\n S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    ","Serialize","iroh_base::key::EndpointId"],["
    Source§

    impl TryFrom<&[u8]> for PublicKey

    Source§

    type Error = KeyParsingError

    The type returned in the event of a conversion error.
    Source§

    fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>

    Performs the conversion.
    ","TryFrom<&[u8]>","iroh_base::key::EndpointId"],["
    Source§

    impl TryFrom<&[u8; 32]> for PublicKey

    Source§

    type Error = KeyParsingError

    The type returned in the event of a conversion error.
    Source§

    fn try_from(bytes: &[u8; 32]) -> Result<Self, Self::Error>

    Performs the conversion.
    ","TryFrom<&[u8; 32]>","iroh_base::key::EndpointId"],["
    Source§

    impl Copy for PublicKey

    ","Copy","iroh_base::key::EndpointId"],["
    Source§

    impl Eq for PublicKey

    ","Eq","iroh_base::key::EndpointId"],["
    Source§

    impl StructuralPartialEq for PublicKey

    ","StructuralPartialEq","iroh_base::key::EndpointId"]]]]); + var type_impls = Object.fromEntries([["iroh_base",[["
    Source§

    impl AsRef<[u8]> for PublicKey

    Source§

    fn as_ref(&self) -> &[u8] ⓘ

    Converts this type into a shared reference of the (usually inferred) input type.
    ","AsRef<[u8]>","iroh_base::key::EndpointId"],["
    Source§

    impl Borrow<[u8; 32]> for PublicKey

    Source§

    fn borrow(&self) -> &[u8; 32]

    Immutably borrows from an owned value. Read more
    ","Borrow<[u8; 32]>","iroh_base::key::EndpointId"],["
    Source§

    impl Clone for PublicKey

    Source§

    fn clone(&self) -> PublicKey

    Returns a duplicate of the value. Read more
    1.0.0 · Source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    ","Clone","iroh_base::key::EndpointId"],["
    Source§

    impl Debug for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Debug","iroh_base::key::EndpointId"],["
    Source§

    impl Deref for PublicKey

    Source§

    type Target = [u8; 32]

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    ","Deref","iroh_base::key::EndpointId"],["
    Source§

    impl<'de> Deserialize<'de> for PublicKey

    Source§

    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","iroh_base::key::EndpointId"],["
    Source§

    impl Display for PublicKey

    Source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Display","iroh_base::key::EndpointId"],["
    Source§

    impl FromStr for PublicKey

    Parses a PublicKey from its hex or base32 encoding.

    \n

    Display produces the hex encoding.

    \n
    Source§

    type Err = KeyParsingError

    The associated error which can be returned from parsing.
    Source§

    fn from_str(s: &str) -> Result<Self, Self::Err>

    Parses a string s to return a value of this type. Read more
    ","FromStr","iroh_base::key::EndpointId"],["
    Source§

    impl Hash for PublicKey

    Source§

    fn hash<H: Hasher>(&self, state: &mut H)

    Feeds this value into the given Hasher. Read more
    1.3.0 · Source§

    fn hash_slice<H>(data: &[Self], state: &mut H)
    where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","iroh_base::key::EndpointId"],["
    Source§

    impl Ord for PublicKey

    Source§

    fn cmp(&self, other: &Self) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · Source§

    fn max(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · Source§

    fn min(self, other: Self) -> Self
    where\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · Source§

    fn clamp(self, min: Self, max: Self) -> Self
    where\n Self: Sized,

    Restrict a value to a certain interval. Read more
    ","Ord","iroh_base::key::EndpointId"],["
    Source§

    impl PartialEq for PublicKey

    Source§

    fn eq(&self, other: &PublicKey) -> bool

    Tests for self and other values to be equal, and is used by ==.
    1.0.0 · Source§

    fn ne(&self, other: &Rhs) -> bool

    Tests for !=. The default implementation is almost always sufficient,\nand should not be overridden without very good reason.
    ","PartialEq","iroh_base::key::EndpointId"],["
    Source§

    impl PartialOrd for PublicKey

    Source§

    fn partial_cmp(&self, other: &Self) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · Source§

    fn lt(&self, other: &Rhs) -> bool

    Tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · Source§

    fn le(&self, other: &Rhs) -> bool

    Tests less than or equal to (for self and other) and is used by the\n<= operator. Read more
    1.0.0 · Source§

    fn gt(&self, other: &Rhs) -> bool

    Tests greater than (for self and other) and is used by the >\noperator. Read more
    1.0.0 · Source§

    fn ge(&self, other: &Rhs) -> bool

    Tests greater than or equal to (for self and other) and is used by\nthe >= operator. Read more
    ","PartialOrd","iroh_base::key::EndpointId"],["
    Source§

    impl PublicKey

    Source

    pub const LENGTH: usize = 32usize

    The length of an ed25519 PublicKey, in bytes.

    \n
    Source

    pub fn as_bytes(&self) -> &[u8; 32]

    Get this public key as a byte array.

    \n
    Source

    pub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, KeyParsingError>

    Construct a PublicKey from a slice of bytes.

    \n
    §Warning
    \n

    This will return a SignatureError if the bytes passed into this method do not represent\na valid ed25519_dalek curve point. Will never fail for bytes return from Self::as_bytes.\nSee [VerifyingKey::from_bytes] for details.

    \n
    Source

    pub fn verify(\n &self,\n message: &[u8],\n signature: &Signature,\n) -> Result<(), SignatureError>

    Verify a signature on a message with this public key.

    \n
    §Return
    \n

    Returns Ok(()) if the signature is valid, and Err otherwise.

    \n
    Source

    pub fn fmt_short(&self) -> impl Display + Copy + 'static

    Convert to a hex string limited to the first 5 bytes for a friendly string\nrepresentation of the key.

    \n
    Source

    pub fn to_z32(&self) -> String

    Encodes this key in z-base-32,\nthe encoding used by pkarr domain names.

    \n
    Source

    pub fn from_z32(s: &str) -> Result<Self, KeyParsingError>

    Parses a key from its z-base-32 encoding.

    \n
    ",0,"iroh_base::key::EndpointId"],["
    Source§

    impl Serialize for PublicKey

    Source§

    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where\n S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    ","Serialize","iroh_base::key::EndpointId"],["
    Source§

    impl TryFrom<&[u8]> for PublicKey

    Source§

    type Error = KeyParsingError

    The type returned in the event of a conversion error.
    Source§

    fn try_from(bytes: &[u8]) -> Result<Self, Self::Error>

    Performs the conversion.
    ","TryFrom<&[u8]>","iroh_base::key::EndpointId"],["
    Source§

    impl TryFrom<&[u8; 32]> for PublicKey

    Source§

    type Error = KeyParsingError

    The type returned in the event of a conversion error.
    Source§

    fn try_from(bytes: &[u8; 32]) -> Result<Self, Self::Error>

    Performs the conversion.
    ","TryFrom<&[u8; 32]>","iroh_base::key::EndpointId"],["
    Source§

    impl Copy for PublicKey

    ","Copy","iroh_base::key::EndpointId"],["
    Source§

    impl Eq for PublicKey

    ","Eq","iroh_base::key::EndpointId"],["
    Source§

    impl StructuralPartialEq for PublicKey

    ","StructuralPartialEq","iroh_base::key::EndpointId"]]]]); if (window.register_type_impls) { window.register_type_impls(type_impls); } else { window.pending_type_impls = type_impls; } })() -//{"start":55,"fragment_lengths":[46218]} \ No newline at end of file +//{"start":55,"fragment_lengths":[46187]} \ No newline at end of file diff --git a/pr/4036/docs/type.impl/n0_error/any/struct.AnyError.js b/pr/4036/docs/type.impl/n0_error/any/struct.AnyError.js index 0233612e25..65a05a66ed 100644 --- a/pr/4036/docs/type.impl/n0_error/any/struct.AnyError.js +++ b/pr/4036/docs/type.impl/n0_error/any/struct.AnyError.js @@ -1,5 +1,5 @@ (function() { - var type_impls = Object.fromEntries([["iroh_relay",[["
    §

    impl AnyError

    pub fn from_std(err: impl Error + Send + Sync + 'static) -> AnyError

    Creates an [AnyError] from a std error.

    \n

    This captures call-site metadata.

    \n

    pub fn from_std_box(err: Box<dyn Error + Send + Sync>) -> AnyError

    Creates an [AnyError] from a bosed std error.

    \n

    This captures call-site metadata.

    \n

    pub fn from_display(s: impl Display) -> AnyError

    Creates an [AnyError] from any Display value by formatting it into a message.

    \n

    pub fn from_string(message: String) -> AnyError

    Creates an [AnyError] from a message string.

    \n

    pub fn from_stack(err: impl StackError + 'static) -> AnyError

    Creates an [AnyError] from a [StackError].

    \n

    This preserves the error’s call-site metadata.

    \n

    Equivalent to AnyError::from(err).

    \n

    pub fn from_stack_box(err: Box<dyn StackError>) -> AnyError

    Creates an [AnyError] from a boxed [StackError].

    \n

    pub fn context(self, context: impl Display) -> AnyError

    Adds additional context on top of this error.

    \n

    pub fn into_boxed_dyn_error(self) -> Box<dyn Error + Send + Sync>

    Converts into boxed std error.

    \n

    pub fn downcast_ref<T>(&self) -> Option<&T>
    where\n T: Error + 'static,

    Downcast this error object by reference.

    \n

    pub fn downcast<T>(self) -> Option<T>
    where\n T: Error + 'static,

    Downcast this error object by reference.

    \n
    ",0,"iroh_relay::protos::streams::StreamError"],["
    §

    impl Debug for AnyError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Debug","iroh_relay::protos::streams::StreamError"],["
    §

    impl Display for AnyError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Display","iroh_relay::protos::streams::StreamError"],["
    §

    impl Error for AnyError

    §

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    ","Error","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<&str> for AnyError

    §

    fn from(value: &str) -> AnyError

    Converts to this type from the input type.
    ","From<&str>","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<AcceptError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: AcceptError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<Box<dyn Error + Send + Sync>> for AnyError

    §

    fn from(value: Box<dyn Error + Send + Sync>) -> AnyError

    Converts to this type from the input type.
    ","From>","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ConnectError> for AnyError

    Source§

    fn from(value: ConnectError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ConnectionHandlerError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: ConnectionHandlerError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<CustomAddrParseError> for AnyError

    Source§

    fn from(value: CustomAddrParseError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<DialError> for AnyError

    Source§

    fn from(value: DialError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<DnsError> for AnyError

    Source§

    fn from(value: DnsError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<EncodingError> for AnyError

    Source§

    fn from(value: EncodingError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<Error> for AnyError

    §

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<Error> for AnyError

    §

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ForwardPacketError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: ForwardPacketError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<FrameTypeError> for AnyError

    Source§

    fn from(value: FrameTypeError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<FromString> for AnyError

    §

    fn from(value: FromString) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<HandleFrameError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: HandleFrameError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<InvalidBucketConfig> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: InvalidBucketConfig) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<KeyParsingError> for AnyError

    Source§

    fn from(value: KeyParsingError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<LookupError> for AnyError

    Source§

    fn from(value: LookupError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<MaxLengthExceededError> for AnyError

    Source§

    fn from(value: MaxLengthExceededError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<NoneError> for AnyError

    §

    fn from(value: NoneError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ParseError> for AnyError

    Source§

    fn from(value: ParseError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<RecvError> for AnyError

    Source§

    fn from(value: RecvError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<RecvError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: RecvError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<RelayUrlParseError> for AnyError

    Source§

    fn from(value: RelayUrlParseError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<RunError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: RunError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SendError> for AnyError

    Source§

    fn from(value: SendError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SendError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: SendError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ServeConnectionError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: ServeConnectionError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SignatureError> for AnyError

    Source§

    fn from(value: SignatureError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SignatureParsingError> for AnyError

    Source§

    fn from(value: SignatureParsingError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SignedPacketBuildError> for AnyError

    Source§

    fn from(value: SignedPacketBuildError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SignedPacketVerifyError> for AnyError

    Source§

    fn from(value: SignedPacketVerifyError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SpawnError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: SpawnError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl<E> From<StaggeredError<E>> for AnyError
    where\n E: StackError + 'static,

    Source§

    fn from(value: StaggeredError<E>) -> AnyError

    Converts to this type from the input type.
    ","From>","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<String> for AnyError

    §

    fn from(value: String) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SupervisorError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: SupervisorError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<UnsupportedRelayProtocolVersion> for AnyError

    Source§

    fn from(value: UnsupportedRelayProtocolVersion) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<WriteFrameError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: WriteFrameError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl FromStr for AnyError

    §

    type Err = Infallible

    The associated error which can be returned from parsing.
    §

    fn from_str(s: &str) -> Result<AnyError, <AnyError as FromStr>::Err>

    Parses a string s to return a value of this type. Read more
    ","FromStr","iroh_relay::protos::streams::StreamError"],["
    §

    impl StackError for AnyError

    §

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    §

    fn into_std(self: Box<AnyError>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    §

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    §

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    §

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    §

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref<'a>(&'a self) -> ErrorRef<'a>

    Returns this error as an [ErrorRef]. Read more
    §

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Returns the next source in the chain, if any.
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.
    ","StackError","iroh_relay::protos::streams::StreamError"]]]]); + var type_impls = Object.fromEntries([["iroh_relay",[["
    §

    impl AnyError

    pub fn from_std(err: impl Error + Send + Sync + 'static) -> AnyError

    Creates an [AnyError] from a std error.

    \n

    This captures call-site metadata.

    \n

    pub fn from_std_box(err: Box<dyn Error + Send + Sync>) -> AnyError

    Creates an [AnyError] from a bosed std error.

    \n

    This captures call-site metadata.

    \n

    pub fn from_display(s: impl Display) -> AnyError

    Creates an [AnyError] from any Display value by formatting it into a message.

    \n

    pub fn from_string(message: String) -> AnyError

    Creates an [AnyError] from a message string.

    \n

    pub fn from_stack(err: impl StackError + 'static) -> AnyError

    Creates an [AnyError] from a [StackError].

    \n

    This preserves the error’s call-site metadata.

    \n

    Equivalent to AnyError::from(err).

    \n

    pub fn from_stack_box(err: Box<dyn StackError>) -> AnyError

    Creates an [AnyError] from a boxed [StackError].

    \n

    pub fn context(self, context: impl Display) -> AnyError

    Adds additional context on top of this error.

    \n

    pub fn into_boxed_dyn_error(self) -> Box<dyn Error + Send + Sync>

    Converts into boxed std error.

    \n

    pub fn downcast_ref<T>(&self) -> Option<&T>
    where\n T: Error + 'static,

    Downcast this error object by reference.

    \n

    pub fn downcast<T>(self) -> Option<T>
    where\n T: Error + 'static,

    Downcast this error object by reference.

    \n
    ",0,"iroh_relay::protos::streams::StreamError"],["
    §

    impl Debug for AnyError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Debug","iroh_relay::protos::streams::StreamError"],["
    §

    impl Display for AnyError

    §

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Display","iroh_relay::protos::streams::StreamError"],["
    §

    impl Error for AnyError

    §

    fn source(&self) -> Option<&(dyn Error + 'static)>

    Returns the lower-level source of this error, if any. Read more
    1.0.0 · Source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    1.0.0 · Source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    Source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type-based access to context intended for error reports. Read more
    ","Error","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<&str> for AnyError

    §

    fn from(value: &str) -> AnyError

    Converts to this type from the input type.
    ","From<&str>","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<AcceptError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: AcceptError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<Box<dyn Error + Send + Sync>> for AnyError

    §

    fn from(value: Box<dyn Error + Send + Sync>) -> AnyError

    Converts to this type from the input type.
    ","From>","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ConnectError> for AnyError

    Source§

    fn from(value: ConnectError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ConnectionHandlerError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: ConnectionHandlerError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<CustomAddrParseError> for AnyError

    Source§

    fn from(value: CustomAddrParseError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<DialError> for AnyError

    Source§

    fn from(value: DialError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<DnsError> for AnyError

    Source§

    fn from(value: DnsError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<EncodingError> for AnyError

    Source§

    fn from(value: EncodingError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<Error> for AnyError

    §

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<Error> for AnyError

    §

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ForwardPacketError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: ForwardPacketError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<FrameTypeError> for AnyError

    Source§

    fn from(value: FrameTypeError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<FromString> for AnyError

    §

    fn from(value: FromString) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<HandleFrameError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: HandleFrameError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<InvalidBucketConfig> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: InvalidBucketConfig) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<KeyParsingError> for AnyError

    Source§

    fn from(value: KeyParsingError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<LookupError> for AnyError

    Source§

    fn from(value: LookupError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<MaxLengthExceededError> for AnyError

    Source§

    fn from(value: MaxLengthExceededError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<NoneError> for AnyError

    §

    fn from(value: NoneError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ParseError> for AnyError

    Source§

    fn from(value: ParseError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<RecvError> for AnyError

    Source§

    fn from(value: RecvError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<RecvError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: RecvError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<RelayUrlParseError> for AnyError

    Source§

    fn from(value: RelayUrlParseError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<RunError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: RunError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SendError> for AnyError

    Source§

    fn from(value: SendError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SendError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: SendError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<ServeConnectionError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: ServeConnectionError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SignatureError> for AnyError

    Source§

    fn from(value: SignatureError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SignatureParsingError> for AnyError

    Source§

    fn from(value: SignatureParsingError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SignedPacketBuildError> for AnyError

    Source§

    fn from(value: SignedPacketBuildError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SignedPacketVerifyError> for AnyError

    Source§

    fn from(value: SignedPacketVerifyError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SpawnError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: SpawnError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl<E> From<StaggeredError<E>> for AnyError
    where\n E: StackError + 'static,

    Source§

    fn from(value: StaggeredError<E>) -> AnyError

    Converts to this type from the input type.
    ","From>","iroh_relay::protos::streams::StreamError"],["
    §

    impl From<String> for AnyError

    §

    fn from(value: String) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<SupervisorError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: SupervisorError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<UnsupportedRelayProtocolVersion> for AnyError

    Source§

    fn from(value: UnsupportedRelayProtocolVersion) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    Source§

    impl From<WriteFrameError> for AnyError

    Available on crate feature server only.
    Source§

    fn from(value: WriteFrameError) -> AnyError

    Converts to this type from the input type.
    ","From","iroh_relay::protos::streams::StreamError"],["
    §

    impl FromStr for AnyError

    §

    type Err = Infallible

    The associated error which can be returned from parsing.
    §

    fn from_str(s: &str) -> Result<AnyError, <AnyError as FromStr>::Err>

    Parses a string s to return a value of this type. Read more
    ","FromStr","iroh_relay::protos::streams::StreamError"],["
    §

    impl StackError for AnyError

    §

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    §

    fn into_std(self: Box<AnyError>) -> Box<dyn Error + Send + Sync>

    Returns this error as a std error.
    §

    fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)

    Returns this error as a std error reference.
    §

    fn meta(&self) -> Option<&Meta>

    Returns metadata captured at creation time, if available.
    §

    fn source(&self) -> Option<ErrorRef<'_>>

    Returns the next source in the chain, if any.
    §

    fn is_transparent(&self) -> bool

    Returns whether this error is transparent and should be skipped in reports.
    §

    fn as_ref<'a>(&'a self) -> ErrorRef<'a>

    Returns this error as an [ErrorRef]. Read more
    §

    fn fmt_message(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Returns the next source in the chain, if any.
    §

    fn stack(&self) -> Chain<'_>

    Returns an iterator over this error followed by its sources.
    §

    fn sources(&self) -> Chain<'_>

    Returns an iterator over sources of this error (skipping self).
    §

    fn report(&self) -> Report<'_>

    Returns a [Report] to output the error with configurable formatting.
    ","StackError","iroh_relay::protos::streams::StreamError"]]]]); if (window.register_type_impls) { window.register_type_impls(type_impls); } else {