From e11cfe1dbffcf1bb2d93e05f2aa87605e1d4d5e0 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Mon, 29 Sep 2025 19:16:27 +0000 Subject: [PATCH] deploy: 0f389a8d81308bae9c652c7cfb2df7e668a9835b --- .../discovery/enum.IntoDiscoveryError.html | 2 +- pr/3465/docs/iroh/discovery/index.html | 2 +- pr/3465/docs/iroh/discovery/mdns/index.html | 2 +- .../constant.ENV_FORCE_STAGING_RELAYS.html | 2 +- .../iroh/endpoint/enum.AddNodeAddrError.html | 2 +- .../docs/iroh/endpoint/enum.AlpnError.html | 8 +- .../docs/iroh/endpoint/enum.BindError.html | 8 +- .../docs/iroh/endpoint/enum.ConnectError.html | 8 +- .../endpoint/enum.ConnectWithOptsError.html | 8 +- .../iroh/endpoint/enum.ConnectionError.html | 2 +- .../endpoint/enum.GetMappingAddressError.html | 6 +- .../docs/iroh/endpoint/enum.RelayMode.html | 8 +- .../iroh/endpoint/fn.default_relay_mode.html | 2 +- .../iroh/endpoint/fn.force_staging_infra.html | 2 +- pr/3465/docs/iroh/endpoint/index.html | 2 +- pr/3465/docs/iroh/endpoint/struct.Accept.html | 6 +- .../docs/iroh/endpoint/struct.Builder.html | 44 +- .../iroh/endpoint/struct.ConnectOptions.html | 10 +- .../docs/iroh/endpoint/struct.Connecting.html | 12 +- .../docs/iroh/endpoint/struct.Connection.html | 50 +- .../docs/iroh/endpoint/struct.Endpoint.html | 52 +- .../docs/iroh/endpoint/struct.Incoming.html | 20 +- .../iroh/endpoint/struct.IncomingFuture.html | 6 +- .../endpoint/struct.RemoteNodeIdError.html | 4 +- .../iroh/endpoint/struct.ZeroRttAccepted.html | 4 +- pr/3465/docs/iroh/struct.SecretKey.html | 8 +- pr/3465/docs/iroh_base/struct.SecretKey.html | 6 +- pr/3465/docs/iroh_dns_server/index.html | 2 +- .../iroh_relay/protos/handshake/index.html | 2 +- pr/3465/docs/iroh_relay/server/index.html | 2 +- pr/3465/docs/search-index.js | 4 +- pr/3465/docs/src/iroh/disco.rs.html | 226 +- pr/3465/docs/src/iroh/discovery.rs.html | 752 +- pr/3465/docs/src/iroh/discovery/mdns.rs.html | 379 +- pr/3465/docs/src/iroh/endpoint.rs.html | 6202 +++++++++-------- pr/3465/docs/src/iroh/key.rs.html | 145 +- pr/3465/docs/src/iroh/magicsock.rs.html | 1750 ++--- .../docs/src/iroh/magicsock/node_map.rs.html | 388 +- .../magicsock/node_map/node_state.rs.html | 590 +- pr/3465/docs/src/iroh/tls/name.rs.html | 38 +- pr/3465/docs/src/iroh_base/key.rs.html | 116 +- .../docs/src/iroh_base/ticket/node.rs.html | 148 +- pr/3465/docs/src/iroh_dns_server/lib.rs.html | 479 +- .../src/iroh_relay/protos/handshake.rs.html | 565 +- pr/3465/docs/src/iroh_relay/server.rs.html | 614 +- .../docs/src/iroh_relay/server/client.rs.html | 413 +- .../src/iroh_relay/server/clients.rs.html | 202 +- .../src/iroh_relay/server/http_server.rs.html | 955 +-- 48 files changed, 7176 insertions(+), 7082 deletions(-) diff --git a/pr/3465/docs/iroh/discovery/enum.IntoDiscoveryError.html b/pr/3465/docs/iroh/discovery/enum.IntoDiscoveryError.html index bc5b8a677f..b4466d892b 100644 --- a/pr/3465/docs/iroh/discovery/enum.IntoDiscoveryError.html +++ b/pr/3465/docs/iroh/discovery/enum.IntoDiscoveryError.html @@ -18,7 +18,7 @@ Self: Debug + Display,
Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for IntoDiscoveryError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
Source§

impl From<IntoDiscoveryError> for BindError

Source§

fn from(error: IntoDiscoveryError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for IntoDiscoveryError

§

impl !RefUnwindSafe for IntoDiscoveryError

§

impl Send for IntoDiscoveryError

§

impl Sync for IntoDiscoveryError

§

impl Unpin for IntoDiscoveryError

§

impl !UnwindSafe for IntoDiscoveryError

Blanket Implementations§

Source§

impl<T> Any for T
where +and continuing with recursive calls to Error::source. Read more

Source§

impl From<IntoDiscoveryError> for BindError

Source§

fn from(error: IntoDiscoveryError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for IntoDiscoveryError

§

impl !RefUnwindSafe for IntoDiscoveryError

§

impl Send for IntoDiscoveryError

§

impl Sync for IntoDiscoveryError

§

impl Unpin for IntoDiscoveryError

§

impl !UnwindSafe for IntoDiscoveryError

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<T> AsErrorSource for T
where T: Error + 'static,

§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method diff --git a/pr/3465/docs/iroh/discovery/index.html b/pr/3465/docs/iroh/discovery/index.html index 4eb5e05ae7..e5daecd0f1 100644 --- a/pr/3465/docs/iroh/discovery/index.html +++ b/pr/3465/docs/iroh/discovery/index.html @@ -1,4 +1,4 @@ -iroh::discovery - Rust

Module discovery

Source
Expand description

Node address discovery.

+iroh::discovery - Rust

Module discovery

Source
Expand description

Node address discovery.

To connect to an iroh node a NodeAddr is needed, which may contain a RelayUrl or one or more direct addresses in addition to the NodeId.

Since there is a conversion from NodeId to NodeAddr, you can also use diff --git a/pr/3465/docs/iroh/discovery/mdns/index.html b/pr/3465/docs/iroh/discovery/mdns/index.html index 66124f2c55..c9775d58af 100644 --- a/pr/3465/docs/iroh/discovery/mdns/index.html +++ b/pr/3465/docs/iroh/discovery/mdns/index.html @@ -1,4 +1,4 @@ -iroh::discovery::mdns - Rust

Module mdns

Source
Available on crate feature discovery-local-network only.
Expand description

A discovery service that uses an mdns-like service to discover local nodes.

+iroh::discovery::mdns - Rust

Module mdns

Source
Available on crate feature discovery-local-network only.
Expand description

A discovery service that uses an mdns-like service to discover local nodes.

This allows you to use an mdns-like swarm discovery service to find address information about nodes that are on your local network, no relay or outside internet needed. See the swarm-discovery crate for more details.

When MdnsDiscovery is enabled, it’s possible to get a list of the locally discovered nodes by filtering a list of RemoteInfos.

diff --git a/pr/3465/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html b/pr/3465/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html index dbcde2736d..8c7b3df336 100644 --- a/pr/3465/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html +++ b/pr/3465/docs/iroh/endpoint/constant.ENV_FORCE_STAGING_RELAYS.html @@ -1,2 +1,2 @@ -ENV_FORCE_STAGING_RELAYS in iroh::endpoint - Rust

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

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/3465/docs/iroh/endpoint/enum.AddNodeAddrError.html b/pr/3465/docs/iroh/endpoint/enum.AddNodeAddrError.html index 5e5f81014a..7cc8f56f74 100644 --- a/pr/3465/docs/iroh/endpoint/enum.AddNodeAddrError.html +++ b/pr/3465/docs/iroh/endpoint/enum.AddNodeAddrError.html @@ -16,7 +16,7 @@ Self: Debug + Display,
Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for AddNodeAddrError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
Source§

impl From<AddNodeAddrError> for ConnectWithOptsError

Source§

fn from(error: AddNodeAddrError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +and continuing with recursive calls to Error::source. Read more

Source§

impl From<AddNodeAddrError> for ConnectWithOptsError

Source§

fn from(error: AddNodeAddrError) -> Self

Converts to this type from the input type.

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<T> AsErrorSource for T
where T: Error + 'static,

§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method diff --git a/pr/3465/docs/iroh/endpoint/enum.AlpnError.html b/pr/3465/docs/iroh/endpoint/enum.AlpnError.html index 49a8f9d552..9d4cb31305 100644 --- a/pr/3465/docs/iroh/endpoint/enum.AlpnError.html +++ b/pr/3465/docs/iroh/endpoint/enum.AlpnError.html @@ -1,4 +1,4 @@ -AlpnError in iroh::endpoint - Rust

Enum AlpnError

Source
#[non_exhaustive]
pub enum AlpnError { +AlpnError in iroh::endpoint - Rust

Enum AlpnError

Source
#[non_exhaustive]
pub enum AlpnError { ConnectionError { source: ConnectionError, backtrace: Option<Backtrace>, @@ -12,11 +12,11 @@ backtrace: Option<Backtrace>, span_trace: SpanTrace, }, -}

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.
§

ConnectionError

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Unavailable

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

UnknownHandshake

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for AlpnError

Source§

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

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

impl Display for AlpnError

Source§

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

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

impl Error for AlpnError
where - Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for AlpnError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where +}

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.
§

ConnectionError

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Unavailable

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

UnknownHandshake

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for AlpnError

Source§

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

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

impl Display for AlpnError

Source§

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

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

impl Error for AlpnError
where + Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for AlpnError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
Source§

impl From<ConnectionError> for AlpnError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +and continuing with recursive calls to Error::source. Read more

Source§

impl From<ConnectionError> for AlpnError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.

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<T> AsErrorSource for T
where T: Error + 'static,

§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method diff --git a/pr/3465/docs/iroh/endpoint/enum.BindError.html b/pr/3465/docs/iroh/endpoint/enum.BindError.html index c75ef462ce..4d9e528045 100644 --- a/pr/3465/docs/iroh/endpoint/enum.BindError.html +++ b/pr/3465/docs/iroh/endpoint/enum.BindError.html @@ -1,4 +1,4 @@ -BindError in iroh::endpoint - Rust

Enum BindError

Source
#[non_exhaustive]
pub enum BindError { +BindError in iroh::endpoint - Rust

Enum BindError

Source
#[non_exhaustive]
pub enum BindError { MagicSpawn { source: CreateHandleError, backtrace: Option<Backtrace>, @@ -9,11 +9,11 @@ backtrace: Option<Backtrace>, span_trace: SpanTrace, }, -}

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.
§

MagicSpawn

Fields

§source: CreateHandleError
§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Discovery

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for BindError

Source§

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

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

impl Display for BindError

Source§

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

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

impl Error for BindError
where - Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for BindError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where +}

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.
§

MagicSpawn

Fields

§source: CreateHandleError
§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Discovery

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for BindError

Source§

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

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

impl Display for BindError

Source§

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

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

impl Error for BindError
where + Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for BindError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
Source§

impl From<IntoDiscoveryError> for BindError

Source§

fn from(error: IntoDiscoveryError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +and continuing with recursive calls to Error::source. Read more

Source§

impl From<IntoDiscoveryError> for BindError

Source§

fn from(error: IntoDiscoveryError) -> Self

Converts to this type from the input type.

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<T> AsErrorSource for T
where T: Error + 'static,

§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method diff --git a/pr/3465/docs/iroh/endpoint/enum.ConnectError.html b/pr/3465/docs/iroh/endpoint/enum.ConnectError.html index ca31bc0427..0a767269a3 100644 --- a/pr/3465/docs/iroh/endpoint/enum.ConnectError.html +++ b/pr/3465/docs/iroh/endpoint/enum.ConnectError.html @@ -1,4 +1,4 @@ -ConnectError in iroh::endpoint - Rust

Enum ConnectError

Source
#[non_exhaustive]
pub enum ConnectError { +ConnectError in iroh::endpoint - Rust

Enum ConnectError

Source
#[non_exhaustive]
pub enum ConnectError { Connect { source: Box<ConnectWithOptsError>, backtrace: Option<Backtrace>, @@ -9,11 +9,11 @@ backtrace: Option<Backtrace>, span_trace: SpanTrace, }, -}

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.
§

Connect

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Connection

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for ConnectError

Source§

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

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

impl Display for ConnectError

Source§

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

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

impl Error for ConnectError
where - Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for ConnectError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where +}

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.
§

Connect

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Connection

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for ConnectError

Source§

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

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

impl Display for ConnectError

Source§

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

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

impl Error for ConnectError
where + Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for ConnectError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
Source§

impl From<ConnectWithOptsError> for ConnectError

Source§

fn from(error: ConnectWithOptsError) -> Self

Converts to this type from the input type.
Source§

impl From<ConnectionError> for ConnectError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +and continuing with recursive calls to Error::source. Read more

Source§

impl From<ConnectWithOptsError> for ConnectError

Source§

fn from(error: ConnectWithOptsError) -> Self

Converts to this type from the input type.
Source§

impl From<ConnectionError> for ConnectError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.

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<T> AsErrorSource for T
where T: Error + 'static,

§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method diff --git a/pr/3465/docs/iroh/endpoint/enum.ConnectWithOptsError.html b/pr/3465/docs/iroh/endpoint/enum.ConnectWithOptsError.html index bcfdae5696..9d66c059be 100644 --- a/pr/3465/docs/iroh/endpoint/enum.ConnectWithOptsError.html +++ b/pr/3465/docs/iroh/endpoint/enum.ConnectWithOptsError.html @@ -1,4 +1,4 @@ -ConnectWithOptsError in iroh::endpoint - Rust

Enum ConnectWithOptsError

Source
#[non_exhaustive]
pub enum ConnectWithOptsError { +ConnectWithOptsError in iroh::endpoint - Rust

Enum ConnectWithOptsError

Source
#[non_exhaustive]
pub enum ConnectWithOptsError { AddNodeAddr { source: AddNodeAddrError, backtrace: Option<Backtrace>, @@ -18,11 +18,11 @@ backtrace: Option<Backtrace>, span_trace: SpanTrace, }, -}

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.
§

AddNodeAddr

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

SelfConnect

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

NoAddress

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Quinn

Fields

§source: ConnectError
§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for ConnectWithOptsError

Source§

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

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

impl Display for ConnectWithOptsError

Source§

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

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

impl Error for ConnectWithOptsError
where - Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for ConnectWithOptsError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where +}

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.
§

AddNodeAddr

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

SelfConnect

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

NoAddress

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Quinn

Fields

§source: ConnectError
§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for ConnectWithOptsError

Source§

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

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

impl Display for ConnectWithOptsError

Source§

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

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

impl Error for ConnectWithOptsError
where + Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for ConnectWithOptsError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
Source§

impl From<AddNodeAddrError> for ConnectWithOptsError

Source§

fn from(error: AddNodeAddrError) -> Self

Converts to this type from the input type.
Source§

impl From<ConnectWithOptsError> for ConnectError

Source§

fn from(error: ConnectWithOptsError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +and continuing with recursive calls to Error::source. Read more

Source§

impl From<AddNodeAddrError> for ConnectWithOptsError

Source§

fn from(error: AddNodeAddrError) -> Self

Converts to this type from the input type.
Source§

impl From<ConnectWithOptsError> for ConnectError

Source§

fn from(error: ConnectWithOptsError) -> Self

Converts to this type from the input type.

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<T> AsErrorSource for T
where T: Error + 'static,

§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method to benefit from Rust’s automatic dereferencing of method diff --git a/pr/3465/docs/iroh/endpoint/enum.ConnectionError.html b/pr/3465/docs/iroh/endpoint/enum.ConnectionError.html index 27b03d2901..64e44b562d 100644 --- a/pr/3465/docs/iroh/endpoint/enum.ConnectionError.html +++ b/pr/3465/docs/iroh/endpoint/enum.ConnectionError.html @@ -20,7 +20,7 @@ and §

LocallyClosed

The local application closed the connection

§

CidsExhausted

The connection could not be created because not enough of the CID space is available

Try using longer connection IDs.

-

Trait Implementations§

§

impl Clone for ConnectionError

§

fn clone(&self) -> ConnectionError

Returns a copy 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 ConnectionError

§

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

Formats the value using the given formatter. Read more
§

impl Display for ConnectionError

§

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

Formats the value using the given formatter. Read more
§

impl Error for ConnectionError

§

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
§

impl From<Close> for ConnectionError

§

fn from(x: Close) -> ConnectionError

Converts to this type from the input type.
Source§

impl From<ConnectionError> for AcceptError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.
Source§

impl From<ConnectionError> for AlpnError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.
Source§

impl From<ConnectionError> for ConnectError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.
§

impl From<ConnectionError> for ReadError

§

fn from(source: ConnectionError) -> ReadError

Converts to this type from the input type.
§

impl From<ConnectionError> for ResetError

§

fn from(source: ConnectionError) -> ResetError

Converts to this type from the input type.
§

impl From<ConnectionError> for SendDatagramError

§

fn from(source: ConnectionError) -> SendDatagramError

Converts to this type from the input type.
§

impl From<ConnectionError> for StoppedError

§

fn from(source: ConnectionError) -> StoppedError

Converts to this type from the input type.
§

impl From<ConnectionError> for WriteError

§

fn from(source: ConnectionError) -> WriteError

Converts to this type from the input type.
§

impl From<Error> for ConnectionError

§

fn from(source: Error) -> ConnectionError

Converts to this type from the input type.
§

impl PartialEq for ConnectionError

§

fn eq(&self, other: &ConnectionError) -> 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§

§

impl Clone for ConnectionError

§

fn clone(&self) -> ConnectionError

Returns a copy 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 ConnectionError

§

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

Formats the value using the given formatter. Read more
§

impl Display for ConnectionError

§

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

Formats the value using the given formatter. Read more
§

impl Error for ConnectionError

§

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
§

impl From<Close> for ConnectionError

§

fn from(x: Close) -> ConnectionError

Converts to this type from the input type.
Source§

impl From<ConnectionError> for AcceptError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.
Source§

impl From<ConnectionError> for AlpnError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.
Source§

impl From<ConnectionError> for ConnectError

Source§

fn from(error: ConnectionError) -> Self

Converts to this type from the input type.
§

impl From<ConnectionError> for ReadError

§

fn from(source: ConnectionError) -> ReadError

Converts to this type from the input type.
§

impl From<ConnectionError> for ResetError

§

fn from(source: ConnectionError) -> ResetError

Converts to this type from the input type.
§

impl From<ConnectionError> for SendDatagramError

§

fn from(source: ConnectionError) -> SendDatagramError

Converts to this type from the input type.
§

impl From<ConnectionError> for StoppedError

§

fn from(source: ConnectionError) -> StoppedError

Converts to this type from the input type.
§

impl From<ConnectionError> for WriteError

§

fn from(source: ConnectionError) -> WriteError

Converts to this type from the input type.
§

impl From<Error> for ConnectionError

§

fn from(source: Error) -> ConnectionError

Converts to this type from the input type.
§

impl PartialEq for ConnectionError

§

fn eq(&self, other: &ConnectionError) -> 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.
§

impl Eq for ConnectionError

§

impl StructuralPartialEq for ConnectionError

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<T> AsErrorSource for T
where T: Error + 'static,

§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method diff --git a/pr/3465/docs/iroh/endpoint/enum.GetMappingAddressError.html b/pr/3465/docs/iroh/endpoint/enum.GetMappingAddressError.html index eb8b1c81dd..df73c3cb4f 100644 --- a/pr/3465/docs/iroh/endpoint/enum.GetMappingAddressError.html +++ b/pr/3465/docs/iroh/endpoint/enum.GetMappingAddressError.html @@ -1,4 +1,4 @@ -GetMappingAddressError in iroh::endpoint - Rust

Enum GetMappingAddressError

Source
#[non_exhaustive]
pub enum GetMappingAddressError { +GetMappingAddressError in iroh::endpoint - Rust

Enum GetMappingAddressError

Source
#[non_exhaustive]
pub enum GetMappingAddressError { DiscoveryStart { source: DiscoveryError, backtrace: Option<Backtrace>, @@ -13,8 +13,8 @@ backtrace: Option<Backtrace>, span_trace: SpanTrace, }, -}

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.
§

DiscoveryStart

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Discover

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

NoAddress

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for GetMappingAddressError

Source§

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

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

impl Display for GetMappingAddressError

Source§

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

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

impl Error for GetMappingAddressError
where - Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for GetMappingAddressError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where +}

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.
§

DiscoveryStart

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

Discover

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace
§

NoAddress

Fields

§backtrace: Option<Backtrace>
§span_trace: SpanTrace

Trait Implementations§

Source§

impl Debug for GetMappingAddressError

Source§

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

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

impl Display for GetMappingAddressError

Source§

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

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

impl Error for GetMappingAddressError
where + Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for GetMappingAddressError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error and continuing with recursive calls to Error::source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where diff --git a/pr/3465/docs/iroh/endpoint/enum.RelayMode.html b/pr/3465/docs/iroh/endpoint/enum.RelayMode.html index 591cba1ac9..91315fc147 100644 --- a/pr/3465/docs/iroh/endpoint/enum.RelayMode.html +++ b/pr/3465/docs/iroh/endpoint/enum.RelayMode.html @@ -1,4 +1,4 @@ -RelayMode in iroh::endpoint - Rust

Enum RelayMode

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

Enum RelayMode

Source
pub enum RelayMode {
     Disabled,
     Default,
     Staging,
@@ -9,9 +9,9 @@
 

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.

-

Trait Implementations§

Source§

impl Clone for RelayMode

Source§

fn clone(&self) -> RelayMode

Returns a copy 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 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 +

Implementations§

Source§

impl RelayMode

Source

pub fn relay_map(&self) -> RelayMap

Returns the relay map for this mode.

+

Trait Implementations§

Source§

impl Clone for RelayMode

Source§

fn clone(&self) -> RelayMode

Returns a copy 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 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 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/3465/docs/iroh/endpoint/fn.default_relay_mode.html b/pr/3465/docs/iroh/endpoint/fn.default_relay_mode.html index 9815457bfd..8e9a5032e4 100644 --- a/pr/3465/docs/iroh/endpoint/fn.default_relay_mode.html +++ b/pr/3465/docs/iroh/endpoint/fn.default_relay_mode.html @@ -1,4 +1,4 @@ -default_relay_mode in iroh::endpoint - Rust

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

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/3465/docs/iroh/endpoint/fn.force_staging_infra.html b/pr/3465/docs/iroh/endpoint/fn.force_staging_infra.html index 5f33281821..621c650fa5 100644 --- a/pr/3465/docs/iroh/endpoint/fn.force_staging_infra.html +++ b/pr/3465/docs/iroh/endpoint/fn.force_staging_infra.html @@ -1,2 +1,2 @@ -force_staging_infra in iroh::endpoint - Rust

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

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/3465/docs/iroh/endpoint/index.html b/pr/3465/docs/iroh/endpoint/index.html index 1b37a3724c..af5a3b79ed 100644 --- a/pr/3465/docs/iroh/endpoint/index.html +++ b/pr/3465/docs/iroh/endpoint/index.html @@ -1,4 +1,4 @@ -iroh::endpoint - Rust

Module endpoint

Source
Expand description

The Endpoint allows establishing connections to other iroh nodes.

+iroh::endpoint - Rust

Module endpoint

Source
Expand description

The Endpoint allows establishing connections to other iroh nodes.

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

diff --git a/pr/3465/docs/iroh/endpoint/struct.Accept.html b/pr/3465/docs/iroh/endpoint/struct.Accept.html index d9dba49f27..f587ef971a 100644 --- a/pr/3465/docs/iroh/endpoint/struct.Accept.html +++ b/pr/3465/docs/iroh/endpoint/struct.Accept.html @@ -1,6 +1,6 @@ -Accept in iroh::endpoint - Rust

Struct Accept

Source
pub struct Accept<'a> { /* private fields */ }
Expand description

Future produced by Endpoint::accept.

-

Trait Implementations§

Source§

impl<'a> Debug for Accept<'a>

Source§

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

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

impl Future for Accept<'_>

Source§

type Output = Option<Incoming>

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, 'a> Unpin for Accept<'a>
where +Accept in iroh::endpoint - Rust

Struct Accept

Source
pub struct Accept<'a> { /* private fields */ }
Expand description

Future produced by Endpoint::accept.

+

Trait Implementations§

Source§

impl<'a> Debug for Accept<'a>

Source§

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

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

impl Future for Accept<'_>

Source§

type Output = Option<Incoming>

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, 'a> Unpin for Accept<'a>
where PinnedFieldsOf<__Accept<'pin, 'a>>: Unpin,

Auto Trait Implementations§

§

impl<'a> !Freeze for Accept<'a>

§

impl<'a> !RefUnwindSafe for Accept<'a>

§

impl<'a> Send for Accept<'a>

§

impl<'a> Sync for Accept<'a>

§

impl<'a> !UnwindSafe for Accept<'a>

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/3465/docs/iroh/endpoint/struct.Builder.html b/pr/3465/docs/iroh/endpoint/struct.Builder.html index 47efcd5668..215b069921 100644 --- a/pr/3465/docs/iroh/endpoint/struct.Builder.html +++ b/pr/3465/docs/iroh/endpoint/struct.Builder.html @@ -2,23 +2,23 @@

By default the endpoint will generate a new random SecretKey, which will result in a new NodeId.

To create the Endpoint call Builder::bind.

-

Implementations§

Source§

impl Builder

Source

pub async fn bind(self) -> Result<Endpoint, BindError>

Binds the magic endpoint.

-
Source

pub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self

Sets the IPv4 bind address.

+

Implementations§

Source§

impl Builder

Source

pub async fn bind(self) -> Result<Endpoint, BindError>

Binds the magic endpoint.

+
Source

pub fn bind_addr_v4(self, addr: SocketAddrV4) -> Self

Sets the IPv4 bind address.

Setting the port to 0 will use a random port. If the port specified is already in use, it will fallback to choosing a random port.

By default will use 0.0.0.0:0 to bind to.

-
Source

pub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self

Sets the IPv6 bind address.

+
Source

pub fn bind_addr_v6(self, addr: SocketAddrV6) -> Self

Sets the IPv6 bind address.

Setting the port to 0 will use a random port. If the port specified is already in use, it will fallback to choosing a random port.

By default will use [::]:0 to bind to.

-
Source

pub fn secret_key(self, secret_key: SecretKey) -> Self

Sets a secret key to authenticate with other peers.

+
Source

pub fn secret_key(self, secret_key: SecretKey) -> Self

Sets a secret key to authenticate with other peers.

This secret key’s public key will be the PublicKey of this endpoint and thus also its NodeId

If not set, a new secret key will be generated.

-
Source

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

Sets the ALPN protocols that this endpoint will accept on incoming connections.

+
Source

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

Sets the ALPN protocols that this endpoint will accept on incoming connections.

Not setting this will still allow creating connections, but to accept incoming connections at least one ALPN must be set.

-
Source

pub fn relay_mode(self, relay_mode: RelayMode) -> Self

Sets the relay servers to assist in establishing connectivity.

+
Source

pub fn relay_mode(self, relay_mode: RelayMode) -> Self

Sets the relay servers to assist in establishing connectivity.

Relay servers are used to establish initial connection with another iroh node. They also perform various functions related to hole punching, see the crate docs for more details.

@@ -26,15 +26,15 @@ for more details.

When using RelayMode::Custom, the provided relay_map must contain at least one configured relay node. If an invalid RelayMap is provided bind will result in an error.

-
Source

pub fn clear_discovery(self) -> Self

Removes all discovery services from the builder.

-
Source

pub fn discovery(self, discovery: impl IntoDiscovery) -> Self

Optionally sets a discovery mechanism for this endpoint.

+
Source

pub fn clear_discovery(self) -> Self

Removes all discovery services from the builder.

+
Source

pub fn discovery(self, discovery: impl IntoDiscovery) -> Self

Optionally sets a discovery mechanism for this endpoint.

If you want to combine multiple discovery services, you can use Builder::add_discovery instead. This will internally create a crate::discovery::ConcurrentDiscovery.

If no discovery service is set, connecting to a node without providing its direct addresses or relay URLs will fail.

See the documentation of the Discovery trait for details.

-
Source

pub fn add_discovery(self, discovery: impl IntoDiscovery) -> Self

Adds a discovery mechanism for this endpoint.

+
Source

pub fn add_discovery(self, discovery: impl IntoDiscovery) -> Self

Adds a discovery mechanism for this endpoint.

The function discovery will be called on endpoint creation with the configured secret key of the endpoint. Discovery services that need to publish information need @@ -45,7 +45,7 @@ to use this secret key to sign the information.

direct addresses or relay URLs will fail.

To clear all discovery services, use Builder::clear_discovery.

See the documentation of the Discovery trait for details.

-
Source

pub fn discovery_n0(self) -> Self

Configures the endpoint to use the default n0 DNS discovery service.

+
Source

pub fn discovery_n0(self) -> Self

Configures the endpoint to use the default n0 DNS discovery service.

The default discovery service publishes to and resolves from the n0.computer dns server iroh.link.

This is equivalent to adding both a crate::discovery::pkarr::PkarrPublisher @@ -54,24 +54,24 @@ n0.computer dns server.

This will by default use N0_DNS_PKARR_RELAY_PROD. When in tests, or when the test-utils feature is enabled, this will use the N0_DNS_PKARR_RELAY_STAGING.

-
Source

pub fn discovery_dht(self) -> Self

Available on crate feature discovery-pkarr-dht only.

Configures the endpoint to also use the mainline DHT with default settings.

+
Source

pub fn discovery_dht(self) -> Self

Available on crate feature discovery-pkarr-dht only.

Configures the endpoint to also use the mainline DHT with default settings.

This is equivalent to adding a crate::discovery::pkarr::dht::DhtDiscovery with default settings. Note that DhtDiscovery has various more advanced configuration options. If you need any of those, you should manually create a DhtDiscovery and add it with Builder::add_discovery.

-
Source

pub fn discovery_local_network(self) -> Self

Available on crate feature discovery-local-network only.

Configures the endpoint to also use local network discovery.

+
Source

pub fn discovery_local_network(self) -> Self

Available on crate feature discovery-local-network only.

Configures the endpoint to also use local network discovery.

This is equivalent to adding a crate::discovery::mdns::MdnsDiscovery with default settings. Note that MdnsDiscovery has various more advanced configuration options. If you need any of those, you should manually create a MdnsDiscovery and add it with Builder::add_discovery.

-
Source

pub fn user_data_for_discovery(self, user_data: UserData) -> Self

Sets the initial user-defined data to be published in discovery services for this node.

+
Source

pub fn user_data_for_discovery(self, user_data: UserData) -> Self

Sets the initial user-defined data to be published in discovery services for this node.

When using discovery services, this string of UserData will be published together with the node’s addresses and relay URL. When other nodes discover this node, they retrieve the UserData in addition to the addressing info.

Iroh itself does not interpret the user-defined data in any way, it is purely left for applications to parse and use.

-
Source

pub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self

Optionally set a list of known nodes.

-
Source

pub fn transport_config(self, transport_config: TransportConfig) -> Self

Sets a custom quinn::TransportConfig for this endpoint.

+
Source

pub fn known_nodes(self, nodes: Vec<NodeAddr>) -> Self

Optionally set a list of known nodes.

+
Source

pub fn transport_config(self, transport_config: TransportConfig) -> Self

Sets a custom quinn::TransportConfig for this endpoint.

The transport config contains parameters governing the QUIC state machine.

If unset, the default config is used. Default values should be suitable for most internet applications. Applications protocols which forbid remotely-initiated @@ -79,31 +79,31 @@ streams should set max_concurrent_bidi_streams and max_concur zero.

Please be aware that changing some settings may have adverse effects on establishing and maintaining direct connections.

-
Source

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

Available on non-wasm_browser only.

Optionally sets a custom DNS resolver to use for this endpoint.

+
Source

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

Available on non-wasm_browser only.

Optionally sets a custom DNS resolver to use for this endpoint.

The DNS resolver is used to resolve relay hostnames, and node addresses if crate::discovery::dns::DnsDiscovery is configured.

By default, a new DNS resolver is created which is configured to use the host system’s DNS configuration. You can pass a custom instance of DnsResolver here to use a differently configured DNS resolver for this endpoint, or to share a DnsResolver between multiple endpoints.

-
Source

pub fn proxy_url(self, url: Url) -> Self

Sets an explicit proxy url to proxy all HTTP(S) traffic through.

-
Source

pub fn proxy_from_env(self) -> Self

Sets the proxy url from the environment, in this order:

+
Source

pub fn proxy_url(self, url: Url) -> Self

Sets an explicit proxy url to proxy all HTTP(S) traffic through.

+
Source

pub fn proxy_from_env(self) -> Self

Sets the proxy url from the environment, in this order:

  • HTTP_PROXY
  • http_proxy
  • HTTPS_PROXY
  • https_proxy
-
Source

pub fn keylog(self, keylog: bool) -> Self

Enables saving the TLS pre-master key for connections.

+
Source

pub fn keylog(self, keylog: bool) -> Self

Enables saving the TLS pre-master key for connections.

This key should normally remain secret but can be useful to debug networking issues by decrypting captured traffic.

If keylog is true then setting the SSLKEYLOGFILE environment variable to a filename will result in this file being used to log the TLS pre-master keys.

-
Source

pub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self

Available on crate feature test-utils only.

Skip verification of SSL certificates from relay servers

+
Source

pub fn insecure_skip_relay_cert_verify(self, skip_verify: bool) -> Self

Available on crate feature test-utils only.

Skip verification of SSL certificates from relay servers

May only be used in tests.

-
Source

pub fn path_selection(self, path_selection: PathSelection) -> Self

Available on crate feature test-utils only.

This implies we only use the relay to communicate +

Source

pub fn path_selection(self, path_selection: PathSelection) -> Self

Available on crate feature test-utils only.

This implies we only use the relay to communicate and do not attempt to do any hole punching.

-
Source

pub fn max_tls_tickets(self, n: usize) -> Self

Set the maximum number of TLS tickets to cache.

+
Source

pub fn max_tls_tickets(self, n: usize) -> Self

Set the maximum number of TLS tickets to cache.

Set this to a larger value if you want to do 0rtt connections to a large number of clients.

The default is 256, taking about 150 KiB in memory.

diff --git a/pr/3465/docs/iroh/endpoint/struct.ConnectOptions.html b/pr/3465/docs/iroh/endpoint/struct.ConnectOptions.html index 5ff916657a..f457b2b4fa 100644 --- a/pr/3465/docs/iroh/endpoint/struct.ConnectOptions.html +++ b/pr/3465/docs/iroh/endpoint/struct.ConnectOptions.html @@ -1,12 +1,12 @@ -ConnectOptions in iroh::endpoint - Rust

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

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 TransportConfig.

-
Source

pub fn with_transport_config( +

Source

pub fn with_transport_config( self, transport_config: Arc<TransportConfig>, ) -> 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 copy 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 copy 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/3465/docs/iroh/endpoint/struct.Connecting.html b/pr/3465/docs/iroh/endpoint/struct.Connecting.html index 6f589fcda8..0f18f2f47e 100644 --- a/pr/3465/docs/iroh/endpoint/struct.Connecting.html +++ b/pr/3465/docs/iroh/endpoint/struct.Connecting.html @@ -1,5 +1,5 @@ -Connecting in iroh::endpoint - Rust

Struct Connecting

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

In-progress connection attempt future

-

Implementations§

Source§

impl Connecting

Source

pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>

Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened +Connecting in iroh::endpoint - Rust

Struct Connecting

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

In-progress connection attempt future

+

Implementations§

Source§

impl Connecting

Source

pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self>

Converts this Connecting into a 0-RTT or 0.5-RTT connection at the cost of weakened security.

Returns Ok immediately if the local endpoint is able to attempt sending 0/0.5-RTT data. If so, the returned Connection can be used to send application data without waiting for @@ -33,10 +33,10 @@ before TLS client authentication has occurred, and should therefore not be used data for which client authentication is being used.

You can use RecvStream::is_0rtt to check whether a stream has been opened in 0-RTT and thus whether parts of the stream are operating under this reduced security level.

-
Source

pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>

Parameters negotiated during the handshake

-
Source

pub async fn alpn(&mut self) -> Result<Vec<u8>, AlpnError>

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

-

Trait Implementations§

Source§

impl Debug for Connecting

Source§

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

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

impl Future for Connecting

Source§

type Output = Result<Connection, ConnectionError>

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 Connecting
where +

Source

pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError>

Parameters negotiated during the handshake

+
Source

pub async fn alpn(&mut self) -> Result<Vec<u8>, AlpnError>

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

+

Trait Implementations§

Source§

impl Debug for Connecting

Source§

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

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

impl Future for Connecting

Source§

type Output = Result<Connection, ConnectionError>

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 Connecting
where PinnedFieldsOf<__Connecting<'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/3465/docs/iroh/endpoint/struct.Connection.html b/pr/3465/docs/iroh/endpoint/struct.Connection.html index b7e8c126fc..784c4c3966 100644 --- a/pr/3465/docs/iroh/endpoint/struct.Connection.html +++ b/pr/3465/docs/iroh/endpoint/struct.Connection.html @@ -1,4 +1,4 @@ -Connection in iroh::endpoint - Rust

Struct Connection

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

A QUIC connection.

+Connection in iroh::endpoint - Rust

Struct Connection

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

A QUIC connection.

If all references to a connection (including every clone of the Connection handle, streams of incoming streams, and the various stream types) have been dropped, then the connection will be automatically closed with an error_code of 0 and an empty reason. You @@ -8,29 +8,29 @@ 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 Connection

Source

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

Initiates a new outgoing unidirectional stream.

+

Implementations§

Source§

impl Connection

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.

-
Source

pub fn open_bi(&self) -> OpenBi<'_> ⓘ

Initiates a new outgoing bidirectional stream.

+
Source

pub fn open_bi(&self) -> OpenBi<'_> ⓘ

Initiates a new outgoing bidirectional 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. 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_uni(&self) -> AcceptUni<'_> ⓘ

Accepts the next incoming uni-directional stream.

+
Source

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

Accept 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 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.

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.

-
Source

pub fn close_reason(&self) -> Option<ConnectionError>

If the connection is closed, the reason why.

+
Source

pub fn close_reason(&self) -> Option<ConnectionError>

If the connection is closed, the reason why.

Returns None if the connection is still open.

-
Source

pub fn close(&self, error_code: VarInt, reason: &[u8])

Closes the connection immediately.

+
Source

pub fn close(&self, error_code: VarInt, reason: &[u8])

Closes the connection immediately.

Pending operations will fail immediately with ConnectionError::LocallyClosed. No more data is sent to the peer and the peer may drop buffered data upon receiving the CONNECTION_CLOSE frame.

@@ -51,41 +51,41 @@ endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to call close the remote endpoint may drop any data it received but is as yet undelivered to the application, including data that was acknowledged as received to the local endpoint.

-
Source

pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>

Transmits data as an unreliable, unordered application datagram.

+
Source

pub fn send_datagram(&self, data: Bytes) -> Result<(), SendDatagramError>

Transmits data as an unreliable, unordered application datagram.

Application datagrams are a low-level primitive. They may be lost or delivered out of order, and data must both fit inside a single QUIC packet and be smaller than the maximum dictated by the peer.

-
Source

pub fn max_datagram_size(&self) -> Option<usize>

Computes the maximum size of datagrams that may be passed to send_datagram.

+
Source

pub fn max_datagram_size(&self) -> Option<usize>

Computes the maximum size of datagrams that may be passed to send_datagram.

Returns None if datagrams are unsupported by the peer or disabled locally.

This may change over the lifetime of a connection according to variation in the path MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the peer’s limit is large this is guaranteed to be a little over a kilobyte at minimum.

Not necessarily the maximum size of received datagrams.

-
Source

pub fn datagram_send_buffer_space(&self) -> usize

Bytes available in the outgoing datagram buffer.

+
Source

pub fn datagram_send_buffer_space(&self) -> usize

Bytes available in the outgoing datagram buffer.

When greater than zero, calling send_datagram with a datagram of at most this size is guaranteed not to cause older datagrams to be dropped.

-
Source

pub fn rtt(&self) -> Duration

Current best estimate of this connection’s latency (round-trip-time).

-
Source

pub fn stats(&self) -> ConnectionStats

Returns connection statistics.

-
Source

pub fn congestion_state(&self) -> Box<dyn Controller>

Current state of the congestion control algorithm, for debugging purposes.

-
Source

pub fn handshake_data(&self) -> Option<Box<dyn Any>>

Parameters negotiated during the handshake.

+
Source

pub fn rtt(&self) -> Duration

Current best estimate of this connection’s latency (round-trip-time).

+
Source

pub fn stats(&self) -> ConnectionStats

Returns connection statistics.

+
Source

pub fn congestion_state(&self) -> Box<dyn Controller>

Current state of the congestion control algorithm, for debugging purposes.

+
Source

pub fn handshake_data(&self) -> Option<Box<dyn Any>>

Parameters negotiated during the handshake.

Guaranteed to return Some on fully established connections or after Connecting::handshake_data() succeeds. See that method’s documentations for details on the returned value.

-
Source

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

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

-
Source

pub fn peer_identity(&self) -> Option<Box<dyn Any>>

Cryptographic identity of the peer.

+
Source

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

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

+
Source

pub fn peer_identity(&self) -> Option<Box<dyn Any>>

Cryptographic identity of the peer.

The dynamic type returned is determined by the configured Session. For the default rustls session, the return value can be downcast to a Vec<[rustls::pki_types::CertificateDer]>

-
Source

pub fn remote_node_id(&self) -> Result<NodeId, RemoteNodeIdError>

Returns the NodeId from the peer’s TLS certificate.

+
Source

pub fn remote_node_id(&self) -> Result<NodeId, RemoteNodeIdError>

Returns the NodeId from the peer’s TLS certificate.

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

-
Source

pub fn stable_id(&self) -> usize

A stable identifier for this connection.

+
Source

pub fn stable_id(&self) -> usize

A stable identifier for this connection.

Peer addresses and connection IDs can change, but this value will remain fixed for the lifetime of the connection.

-
Source

pub fn export_keying_material( +

Source

pub fn export_keying_material( &self, output: &mut [u8], label: &[u8], @@ -96,14 +96,14 @@ arguments and output buffers of equal length, they will get the same sequence of bytes in output. These bytes are cryptographically strong and pseudorandom, and are suitable for use as keying material.

See RFC5705 for more information.

-

Source

pub fn set_max_concurrent_uni_streams(&self, count: VarInt)

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

+
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)

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)

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.

-

Trait Implementations§

Source§

impl Clone for Connection

Source§

fn clone(&self) -> Connection

Returns a copy 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 Connection

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 Connection

Source§

fn clone(&self) -> Connection

Returns a copy 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 Connection

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/3465/docs/iroh/endpoint/struct.Endpoint.html b/pr/3465/docs/iroh/endpoint/struct.Endpoint.html index 9e2355273b..30c3a15e78 100644 --- a/pr/3465/docs/iroh/endpoint/struct.Endpoint.html +++ b/pr/3465/docs/iroh/endpoint/struct.Endpoint.html @@ -1,4 +1,4 @@ -Endpoint in iroh::endpoint - Rust

Struct Endpoint

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

Controls an iroh node, establishing connections with other nodes.

+Endpoint in iroh::endpoint - Rust

Struct Endpoint

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

Controls an iroh node, establishing connections with other nodes.

This is the main API interface to create connections to, and accept connections from other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is used to make the connections reliable. See the [crate docs] for a more detailed @@ -16,11 +16,11 @@ the peer are created using the Connection::open_uni and Connection::open_bi 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.

-

Implementations§

Source§

impl Endpoint

Source

pub fn builder() -> Builder

Returns the builder for an Endpoint, with a production configuration.

-
Source

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

Sets the list of accepted ALPN protocols.

+

Implementations§

Source§

impl Endpoint

Source

pub fn builder() -> Builder

Returns the builder for an Endpoint, with a production configuration.

+
Source

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

Sets the list of accepted ALPN protocols.

This will only affect new incoming connections. Note that this overrides the current list of ALPNs.

-
Source

pub async fn connect( +

Source

pub async fn connect( &self, node_addr: impl Into<NodeAddr>, alpn: &[u8], @@ -41,7 +41,7 @@ connection attempt will fail with an error.

The alpn, or application-level protocol identifier, is also required. The remote endpoint must support this alpn, otherwise the connection attempt will fail with an error.

-

Source

pub async fn connect_with_opts( +

Source

pub async fn connect_with_opts( &self, node_addr: impl Into<NodeAddr>, alpn: &[u8], @@ -61,13 +61,13 @@ security concerns. establishing and maintaining direct connections. Carefully test settings you use and consider this currently as still rather experimental. -

Source

pub fn accept(&self) -> Accept<'_> ⓘ

Accepts an incoming connection on the endpoint.

+
Source

pub fn accept(&self) -> Accept<'_> ⓘ

Accepts an incoming connection on the endpoint.

Only connections with the ALPNs configured in Builder::alpns will be accepted. If multiple ALPNs have been configured the ALPN can be inspected before accepting the connection using Connecting::alpn.

The returned future will yield None if the endpoint is closed by calling Endpoint::close.

-
Source

pub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), AddNodeAddrError>

Informs this Endpoint about addresses of the iroh node.

+
Source

pub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), AddNodeAddrError>

Informs this Endpoint about addresses of the iroh node.

This updates the local state for the remote node. If the provided NodeAddr contains a RelayUrl this will be used as the new relay server for this node. If it contains any new IP endpoints they will also be stored and tried when next @@ -80,7 +80,7 @@ This provides more flexibility and future proofing.

§Errors

Will return an error if we attempt to add our own NodeId to the node map or if the direct addresses are a subset of ours.

-
Source

pub fn add_node_addr_with_source( +

Source

pub fn add_node_addr_with_source( &self, node_addr: NodeAddr, source: &'static str, @@ -96,11 +96,11 @@ This provides more flexibility and future proofing.

§Errors

Will return an error if we attempt to add our own NodeId to the node map or if the direct addresses are a subset of ours.

-
Source

pub fn secret_key(&self) -> &SecretKey

Returns the secret_key of this endpoint.

-
Source

pub fn node_id(&self) -> NodeId

Returns the node id of this endpoint.

+
Source

pub fn secret_key(&self) -> &SecretKey

Returns the secret_key of this endpoint.

+
Source

pub fn node_id(&self) -> NodeId

Returns the node id of this endpoint.

This ID is the unique addressing information of this node and other peers must know it to be able to connect to this node.

-
Source

pub fn node_addr(&self) -> impl Watcher<Value = Option<NodeAddr>> + use<>

Available on non-wasm_browser only.

Returns a Watcher for the current NodeAddr for this endpoint.

+
Source

pub fn node_addr(&self) -> impl Watcher<Value = Option<NodeAddr>> + use<>

Available on non-wasm_browser only.

Returns a Watcher for the current NodeAddr for this endpoint.

The observed NodeAddr will have the current RelayUrl and direct addresses as they would be returned by Endpoint::home_relay and Endpoint::direct_addresses.

Use Watcher::initialized to wait for a NodeAddr that is ready to be connected to:

@@ -112,7 +112,7 @@ as they would be returned by await?; let node_addr = endpoint.node_addr().initialized().await;
-
Source

pub fn home_relay(&self) -> impl Watcher<Value = Vec<RelayUrl>> + use<>

Returns a Watcher for the RelayUrl of the Relay server used as home relay.

+
Source

pub fn home_relay(&self) -> impl Watcher<Value = Vec<RelayUrl>> + use<>

Returns a Watcher for the RelayUrl of the Relay server used as home relay.

Every endpoint has a home Relay server which it chooses as the server with the lowest latency out of the configured servers provided by Builder::relay_mode. This is the server other iroh nodes can use to reliably establish a connection @@ -127,7 +127,7 @@ some time to connect to find and connect to the home relay server.

let mep = Endpoint::builder().bind().await.unwrap(); let _relay_url = mep.home_relay().initialized().await;
-
Source

pub fn direct_addresses(&self) -> Direct<Option<BTreeSet<DirectAddr>>>

Returns a Watcher for the direct addresses of this Endpoint.

+
Source

pub fn direct_addresses(&self) -> Direct<Option<BTreeSet<DirectAddr>>>

Returns a Watcher for the direct addresses of this Endpoint.

The direct addresses of the Endpoint are those that could be used by other iroh nodes to establish direct connectivity, depending on the network situation. The yielded lists of direct addresses contain both the locally-bound @@ -149,10 +149,10 @@ recently discovered direct addresses.

let ep = Endpoint::builder().bind().await.unwrap(); let _addrs = ep.direct_addresses().initialized().await;
-

Source

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

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

+
Source

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

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 remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>

Returns information about the remote node identified by a NodeId.

+
Source

pub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo>

Returns information about the remote node identified by a NodeId.

The Endpoint keeps some information about remote iroh nodes, which it uses to find the best path to a node. Having information on a remote node, however, does not mean we have ever connected to it to or even whether a connection is even possible. The information about a @@ -161,14 +161,14 @@ calls may return different information. Furthermore, node information may even b completely evicted as it becomes stale.

See also Endpoint::remote_info_iter which returns information on all nodes known by this Endpoint.

-
Source

pub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo> + use<>

Returns information about all the remote nodes this Endpoint knows about.

+
Source

pub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo> + use<>

Returns information about all the remote nodes this Endpoint knows about.

This returns the same information as Endpoint::remote_info for each node known to this Endpoint.

The Endpoint keeps some information about remote iroh nodes, which it uses to find the best path to a node. This returns all the nodes it knows about, regardless of whether a connection was ever made or is even possible.

See also Endpoint::remote_info to only retrieve information about a single node.

-
Source

pub fn discovery_stream( +

Source

pub fn discovery_stream( &self, ) -> impl Stream<Item = Result<DiscoveryEvent, Lagged>> + use<>

Returns a stream of all remote nodes discovered through the endpoint’s discovery services.

Whenever a node is discovered via the endpoint’s discovery service, the corresponding @@ -187,7 +187,7 @@ at the time of adding it to the static provider.

Lagged may be yielded, indicating that items were missed.

See also Endpoint::remote_info_iter, which returns an iterator over all remotes the endpoint knows about at a specific point in time.

-
Source

pub fn conn_type(&self, node_id: NodeId) -> Option<Direct<ConnectionType>>

Returns a Watcher that reports the current connection type and any changes for +

Source

pub fn conn_type(&self, node_id: NodeId) -> Option<Direct<ConnectionType>>

Returns a Watcher that reports the current connection type and any changes for given remote node.

This watcher allows observing a stream of ConnectionType items by calling Watcher::stream(). If the underlying connection to a remote node changes, it will @@ -205,11 +205,11 @@ or

Source

pub fn dns_resolver(&self) -> &DnsResolver

Available on non-wasm_browser only.

Returns the DNS resolver used in this Endpoint.

+
Source

pub fn dns_resolver(&self) -> &DnsResolver

Available on non-wasm_browser only.

Returns the DNS resolver used in this Endpoint.

See Builder::dns_resolver.

-
Source

pub fn discovery(&self) -> Option<&dyn Discovery>

Returns the discovery mechanism, if configured.

+
Source

pub fn discovery(&self) -> Option<&dyn Discovery>

Returns the discovery mechanism, if configured.

See Builder::discovery.

-
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:

@@ -280,7 +280,7 @@ registry.write().unwrap().register_all(endpoint.metrics()); assert!(res.contains(r#"TYPE magicsock_recv_datagrams counter"#)); assert!(res.contains(r#"magicsock_recv_datagrams_total 0"#));
-
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 @@ -288,12 +288,12 @@ function allows for notifying iroh of any potential network changes like 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.

-
Source

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

Sets the initial user-defined data to be published in discovery services for this node.

+
Source

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

Sets the initial user-defined data to be published in discovery services for this node.

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

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

-
Source

pub async fn close(&self)

Closes the QUIC endpoint and the magic socket.

+
Source

pub async fn close(&self)

Closes the QUIC endpoint and the magic 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.

@@ -319,8 +319,8 @@ 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.

-

Trait Implementations§

Source§

impl Clone for Endpoint

Source§

fn clone(&self) -> Endpoint

Returns a copy 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 Endpoint

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 +

Source

pub fn is_closed(&self) -> bool

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

+

Trait Implementations§

Source§

impl Clone for Endpoint

Source§

fn clone(&self) -> Endpoint

Returns a copy 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 Endpoint

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/3465/docs/iroh/endpoint/struct.Incoming.html b/pr/3465/docs/iroh/endpoint/struct.Incoming.html index 32df855b24..40dcdcca28 100644 --- a/pr/3465/docs/iroh/endpoint/struct.Incoming.html +++ b/pr/3465/docs/iroh/endpoint/struct.Incoming.html @@ -1,29 +1,29 @@ -Incoming in iroh::endpoint - Rust

Struct Incoming

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

An incoming connection for which the server has not yet begun its parts of the +Incoming in iroh::endpoint - Rust

Struct Incoming

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

An incoming connection for which the server has not yet begun its parts of the handshake.

-

Implementations§

Source§

impl Incoming

Source

pub fn accept(self) -> Result<Connecting, ConnectionError>

Attempts to accept this incoming connection (an error may still occur).

+

Implementations§

Source§

impl Incoming

Source

pub fn accept(self) -> Result<Connecting, ConnectionError>

Attempts to accept this incoming connection (an error may still occur).

Errors occurring here are likely not caused by the application or remote. The QUIC connection listens on a normal UDP socket and any reachable network endpoint can send datagrams to it, solicited or not. Even if the first few bytes look like a QUIC packet, it might not even be a QUIC packet that is being received.

Thus it is common to simply log the errors here and accept them as something which can happen.

-
Source

pub fn accept_with( +

Source

pub fn accept_with( self, server_config: Arc<ServerConfig>, ) -> Result<Connecting, ConnectionError>

Accepts this incoming connection using a custom configuration.

See accept() for more details.

-
Source

pub fn refuse(self)

Rejects this incoming connection attempt.

-
Source

pub fn retry(self) -> Result<(), RetryError>

Responds with a retry packet.

+
Source

pub fn refuse(self)

Rejects this incoming connection attempt.

+
Source

pub fn retry(self) -> Result<(), RetryError>

Responds with a retry packet.

This requires the client to retry with address validation.

Errors if remote_address_validated() is true.

-
Source

pub fn ignore(self)

Ignores this incoming connection attempt, not sending any packet in response.

-
Source

pub fn local_ip(&self) -> Option<IpAddr>

Returns the local IP address which was used when the peer established the +

Source

pub fn ignore(self)

Ignores this incoming connection attempt, not sending any packet in response.

+
Source

pub fn local_ip(&self) -> Option<IpAddr>

Returns the local IP address which was used when the peer established the connection.

-
Source

pub fn remote_address(&self) -> SocketAddr

Returns the peer’s UDP address.

-
Source

pub fn remote_address_validated(&self) -> bool

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

+
Source

pub fn remote_address(&self) -> SocketAddr

Returns the peer’s UDP address.

+
Source

pub fn remote_address_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_address().

-

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, ConnectionError>

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 +

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, ConnectionError>

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 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/3465/docs/iroh/endpoint/struct.IncomingFuture.html b/pr/3465/docs/iroh/endpoint/struct.IncomingFuture.html index eeb11859a6..5ad9c70a9e 100644 --- a/pr/3465/docs/iroh/endpoint/struct.IncomingFuture.html +++ b/pr/3465/docs/iroh/endpoint/struct.IncomingFuture.html @@ -1,6 +1,6 @@ -IncomingFuture in iroh::endpoint - Rust

Struct IncomingFuture

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

Adaptor to let Incoming be awaited like a Connecting.

-

Trait Implementations§

Source§

impl Debug for IncomingFuture

Source§

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

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

impl Future for IncomingFuture

Source§

type Output = Result<Connection, ConnectionError>

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 IncomingFuture
where +IncomingFuture in iroh::endpoint - Rust

Struct IncomingFuture

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

Adaptor to let Incoming be awaited like a Connecting.

+

Trait Implementations§

Source§

impl Debug for IncomingFuture

Source§

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

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

impl Future for IncomingFuture

Source§

type Output = Result<Connection, ConnectionError>

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 IncomingFuture
where PinnedFieldsOf<__IncomingFuture<'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/3465/docs/iroh/endpoint/struct.RemoteNodeIdError.html b/pr/3465/docs/iroh/endpoint/struct.RemoteNodeIdError.html index e45976cc7b..8f34776080 100644 --- a/pr/3465/docs/iroh/endpoint/struct.RemoteNodeIdError.html +++ b/pr/3465/docs/iroh/endpoint/struct.RemoteNodeIdError.html @@ -1,5 +1,5 @@ -RemoteNodeIdError in iroh::endpoint - Rust

Struct RemoteNodeIdError

Source
pub struct RemoteNodeIdError { /* private fields */ }

Trait Implementations§

Source§

impl Debug for RemoteNodeIdError

Source§

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

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

impl Display for RemoteNodeIdError

Source§

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

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

impl Error for RemoteNodeIdError
where - Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for RemoteNodeIdError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where +RemoteNodeIdError in iroh::endpoint - Rust

Struct RemoteNodeIdError

Source
pub struct RemoteNodeIdError { /* private fields */ }

Trait Implementations§

Source§

impl Debug for RemoteNodeIdError

Source§

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

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

impl Display for RemoteNodeIdError

Source§

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

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

impl Error for RemoteNodeIdError
where + Self: Debug + Display,

Source§

fn description(&self) -> &str

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

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

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

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

Returns the lower-level source of this error, if any. Read more
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 ErrorCompat for RemoteNodeIdError

Source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a [Backtrace][] that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_, '_>
where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error and continuing with recursive calls to Error::source. Read more
Source§

impl From<RemoteNodeIdError> for AcceptError

Source§

fn from(error: RemoteNodeIdError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where diff --git a/pr/3465/docs/iroh/endpoint/struct.ZeroRttAccepted.html b/pr/3465/docs/iroh/endpoint/struct.ZeroRttAccepted.html index 6266f14f20..25d67f4b03 100644 --- a/pr/3465/docs/iroh/endpoint/struct.ZeroRttAccepted.html +++ b/pr/3465/docs/iroh/endpoint/struct.ZeroRttAccepted.html @@ -1,7 +1,7 @@ -ZeroRttAccepted in iroh::endpoint - Rust

Struct ZeroRttAccepted

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

Future that completes when a connection is fully established.

+ZeroRttAccepted in iroh::endpoint - Rust

Struct ZeroRttAccepted

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

Future that completes when a connection is fully established.

For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting value is meaningless.

-

Trait Implementations§

Source§

impl Debug for ZeroRttAccepted

Source§

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

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

impl Future for ZeroRttAccepted

Source§

type Output = bool

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 +

Trait Implementations§

Source§

impl Debug for ZeroRttAccepted

Source§

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

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

impl Future for ZeroRttAccepted

Source§

type Output = bool

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

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/3465/docs/iroh/struct.SecretKey.html b/pr/3465/docs/iroh/struct.SecretKey.html index ec6a239858..2a1714c456 100644 --- a/pr/3465/docs/iroh/struct.SecretKey.html +++ b/pr/3465/docs/iroh/struct.SecretKey.html @@ -1,11 +1,11 @@ SecretKey in iroh - Rust

Struct SecretKey

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

A secret key.

Implementations§

Source§

impl SecretKey

Source

pub fn public(&self) -> PublicKey

The public key of this SecretKey.

-
Source

pub fn generate<R>(csprng: R) -> SecretKey
where - R: CryptoRng,

Generate a new SecretKey with a randomness generator.

+
Source

pub fn generate<R>(csprng: &mut R) -> SecretKey
where + R: CryptoRng + ?Sized,

Generate a new SecretKey with a randomness generator.

// use the OsRng option for OS depedndent most secure RNG.
-let mut rng = rand::rngs::OsRng;
-let _key = iroh_base::SecretKey::generate(&mut rng);
+use rand::{TryRngCore, rngs::OsRng}; +let _key = iroh_base::SecretKey::generate(&mut OsRng.unwrap_err());
Source

pub fn sign(&self, msg: &[u8]) -> Signature

Sign the given message and return a digital signature

Source

pub fn to_bytes(&self) -> [u8; 32]

Convert this to the bytes representing the secret part. The public part can always be recovered.

diff --git a/pr/3465/docs/iroh_base/struct.SecretKey.html b/pr/3465/docs/iroh_base/struct.SecretKey.html index 7ca94a66f4..243080a650 100644 --- a/pr/3465/docs/iroh_base/struct.SecretKey.html +++ b/pr/3465/docs/iroh_base/struct.SecretKey.html @@ -1,10 +1,10 @@ SecretKey in iroh_base - Rust

Struct SecretKey

Source
pub struct SecretKey { /* private fields */ }
Available on crate feature key only.
Expand description

A secret key.

Implementations§

Source§

impl SecretKey

Source

pub fn public(&self) -> PublicKey

The public key of this SecretKey.

-
Source

pub fn generate<R: CryptoRng>(csprng: R) -> Self

Generate a new SecretKey with a randomness generator.

+
Source

pub fn generate<R: CryptoRng + ?Sized>(csprng: &mut R) -> Self

Generate a new SecretKey with a randomness generator.

// use the OsRng option for OS depedndent most secure RNG.
-let mut rng = rand::rngs::OsRng;
-let _key = iroh_base::SecretKey::generate(&mut rng);
+use rand::{TryRngCore, rngs::OsRng}; +let _key = iroh_base::SecretKey::generate(&mut OsRng.unwrap_err());
Source

pub fn sign(&self, msg: &[u8]) -> Signature

Sign the given message and return a digital signature

Source

pub fn to_bytes(&self) -> [u8; 32]

Convert this to the bytes representing the secret part. The public part can always be recovered.

diff --git a/pr/3465/docs/iroh_dns_server/index.html b/pr/3465/docs/iroh_dns_server/index.html index e310b1906f..8bb1a74c3e 100644 --- a/pr/3465/docs/iroh_dns_server/index.html +++ b/pr/3465/docs/iroh_dns_server/index.html @@ -1,2 +1,2 @@ -iroh_dns_server - Rust

Crate iroh_dns_server

Source
Expand description

A DNS server and pkarr relay

+iroh_dns_server - Rust

Crate iroh_dns_server

Source
Expand description

A DNS server and pkarr relay

Modules§

config
Configuration for the server
dns
Implementation of a DNS name server for iroh node announces
http
HTTP server part of iroh-dns-server
metrics
Metrics support for the server
server
The main server which combines the DNS and HTTP(S) servers.
state
Shared state and store for the iroh-dns-server

Structs§

ZoneStore
A store for pkarr signed packets.
\ No newline at end of file diff --git a/pr/3465/docs/iroh_relay/protos/handshake/index.html b/pr/3465/docs/iroh_relay/protos/handshake/index.html index c31df2ad48..57ce886d3e 100644 --- a/pr/3465/docs/iroh_relay/protos/handshake/index.html +++ b/pr/3465/docs/iroh_relay/protos/handshake/index.html @@ -1,4 +1,4 @@ -iroh_relay::protos::handshake - Rust

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

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 NodeId
  2. diff --git a/pr/3465/docs/iroh_relay/server/index.html b/pr/3465/docs/iroh_relay/server/index.html index ce2540acfa..e4a967aeb0 100644 --- a/pr/3465/docs/iroh_relay/server/index.html +++ b/pr/3465/docs/iroh_relay/server/index.html @@ -1,4 +1,4 @@ -iroh_relay::server - Rust

    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

    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/3465/docs/search-index.js b/pr/3465/docs/search-index.js index 673566774d..c091d4b122 100644 --- a/pr/3465/docs/search-index.js +++ b/pr/3465/docs/search-index.js @@ -1,4 +1,4 @@ -var searchIndex = new Map(JSON.parse('[["bulk",{"t":"HHHHH","n":["collect_and_print","main","run_iroh","run_quinn","run_s2n"],"q":[[0,"bulk"],[5,"iroh_metrics::base"],[6,"iroh_bench"],[7,"n0_snafu::error"],[8,"iroh_bench::s2n"]],"i":"`````","f":"{{{d{b}}{d{f}}}h}{{}h}{j{{l{h}}}}0{n{{l{h}}}}","D":"`","p":[[1,"str"],[1,"reference",null,null,1],[10,"MetricsGroup",5],[1,"unit"],[5,"Opt",6],[8,"Result",7],[5,"Opt",8]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAAUAAQAAAAUA","P":[]}],["iroh",{"t":"PPEPGTFIFFEFFFFRKNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNOCCNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNNNNMNNNNCCNOCNNNNNNNNNNNNNNMCNNONONNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNOOOOOOOOSSSSCCSSSHHHHSSHHHPFPPKFGGFPKGFTPPFFPPGPPPFPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN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NONOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNPGPGPSPPPPPGPFFKFPPGPPFPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNNNONNNNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOGFPKPPKFFPNNMMNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNONHHNNNNNNNNN","n":["Decode","DecodeInvalidLength","Endpoint","Key","KeyParsingError","LENGTH","NodeAddr","NodeId","PublicKey","RelayMap","RelayMode","RelayNode","RelayUrl","RelayUrlParseError","SecretKey","Value","Watcher","__clone_box","","","","","","and","","","","","","","","as_bytes","as_error_source","","as_ref","backtrace","","borrow","","","","","","","","","borrow_mut","","","","","","","","cause","","clone","","","","","","clone_into","","","","","","clone_to_uninit","","","","","","cmp","","","","compare","","","","compat","","","","","","","","compat_mut","","","","","","","","compat_ref","","","","","","","","contains_node","defaults","deref","","","","","","","","","","deref_mut","","","","","","","","description","","deserialize","","","","","direct_addresses","","discovery","dns","drop","","","","","","","","empty","endpoint","eq","","","","","equivalent","","","","","","","","","","","","","","","","","","","","fmt","","","","","","","","","","","","","","fmt_short","from","","","","","","","","","","","","","","","","","","","","","","from_bytes","","from_iter","","from_parts","from_ref","","","","","","from_str","","","from_z32","generate","get","get_node","hash","","","in_current_span","","init","","","","","","","","initialized","into","","","","","","","","is_connected","is_empty","","len","map","metrics","net_report","new","node_id","node_info","nodes","or","","","","","","","","","partial_cmp","","","","poll_updated","protocol","public","","quic","relay_url","","secret","serialize","","","","","sign","source","","stream","stream_updates_only","test_utils","to_bytes","to_owned","","","","","","to_string","","","","","","to_z32","try_from","","","","","","","","","","","try_into","","","","","","","","try_to_string","","","","","","type_id","","","","","","","","updated","url","urls","verify","vzip","","","","","","","","with_direct_addresses","with_relay_url","backtrace","","","source","","span_trace","","","DEFAULT_HTTPS_PORT","DEFAULT_HTTP_PORT","DEFAULT_METRICS_PORT","DEFAULT_RELAY_QUIC_PORT","prod","staging","AP_RELAY_HOSTNAME","EU_RELAY_HOSTNAME","NA_RELAY_HOSTNAME","default_ap_relay_node","default_eu_relay_node","default_na_relay_node","default_relay_map","EU_RELAY_HOSTNAME","NA_RELAY_HOSTNAME","default_eu_relay_node","default_na_relay_node","default_relay_map","AttrFromString","ConcurrentDiscovery","DecodingError","Discovered","Discovery","DiscoveryContext","DiscoveryError","DiscoveryEvent","DiscoveryItem","Expired","IntoDiscovery","IntoDiscoveryError","Lagged","MAX_LENGTH","NoResults","NoServiceConfigured","NodeData","NodeInfo","NotAnIrohRecord","NumLabels","ParseError","UnexpectedFormat","User","","UserData","Utf8","__clone_box","","","","","add","add_direct_addresses","and","","","","","","","","","","","as_error_source","","","","as_ref","backtrace","","","","borrow","","","","","","","","","","","borrow_mut","","","","","","","","","","","cause","","","","clear_direct_addresses","clone","","","","","clone_into","","","","","clone_to_uninit","","","","","cmp","compare","compat","","","","","","","","","","","compat_mut","","","","","","","","","","","compat_ref","","","","","","","","","","","data","default","","deref","","","","","","","","","","","","","deref_mut","","","","","","","","","","","","description","","","","direct_addresses","dns","dns_resolver","drop","","","","","","","","","","","empty","eq","","","","","equivalent","","","","","","","","","","","","","","","","","","","","fmt","","","","","","","","","","","","","","","","from","","","","","","","","","","","","","","","","","","","from_err","","from_err_box","","from_parts","from_pkarr_signed_packet","from_ref","","","","","from_services","from_str","from_txt_lookup","hash","in_current_span","","","","init","","","","","","","","","","","into","","","","","","","","","","","into_discovery","","into_node_addr","","last_updated","mdns","new","","","node_id","","","node_info","or","","","","","","","","","","","partial_cmp","pkarr","provenance","publish","","relay_url","resolve","","secret_key","set_relay_url","set_user_data","source","","","","static_provider","subscribe","","to_node_addr","","to_owned","","","","","to_pkarr_signed_packet","to_string","","","","","to_txt_strings","try_from","","","","","","","","","","","","try_into","","","","","","","","","","","try_to_string","","","","","type_id","","","","","","","","","","","user_data","","val","vzip","","","","","","","","","","","with_direct_addresses","","with_relay_url","","with_user_data","","backtrace","","","node_id","provenance","source","span_trace","","","backtrace","provenance","source","span_trace","backtrace","","","","","","key","label","num_labels","s","source","","span_trace","","","","","","DnsDiscovery","DnsDiscoveryBuilder","N0_DNS_NODE_ORIGIN_PROD","N0_DNS_NODE_ORIGIN_STAGING","and","","borrow","","borrow_mut","","build","builder","compat","","compat_mut","","compat_ref","","deref","","deref_mut","","dns_resolver","drop","","fmt","","from","","init","","into","","into_discovery","","n0_dns","or","","resolve","try_from","","try_into","","type_id","","vzip","","MdnsDiscovery","MdnsDiscoveryBuilder","NAME","advertise","and","","borrow","","borrow_mut","","build","builder","compat","","compat_mut","","compat_ref","","default","deref","","deref_mut","","drop","","fmt","","from","","init","","into","","into_discovery","","new","","or","","publish","resolve","subscribe","try_from","","try_into","","type_id","","vzip","","DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","Encoding","HttpPayload","HttpRequest","HttpSend","InvalidRelayUrl","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING","PkarrError","PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder","PublicKey","Verify","__clone_box","","","and","","","","","","as_error_source","backtrace","borrow","","","","","","borrow_mut","","","","","","build","","builder","","cause","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","","","compat_mut","","","","","","compat_ref","","","","","","deref","","","","","","deref_mut","","","","","","description","dht","dns_resolver","","drop","","","","","","fmt","","","","","","","from","","","","","","from_ref","","","in_current_span","init","","","","","","into","","","","","","into_discovery","","","","n0_dns","","new","or","","","","","","publish","","republish_interval","resolve","","source","to_owned","","","to_string","try_from","","","","","","try_into","","","","","","try_to_string","ttl","type_id","","","","","","update_node_data","vzip","","","","","","with_dns_resolver","source","","","","","status","url","Builder","DhtDiscovery","__clone_box","and","","borrow","","borrow_mut","","build","builder","client","clone","clone_into","clone_to_uninit","compat","","compat_mut","","compat_ref","","default","","deref","","deref_mut","","dht","drop","","fmt","","from","","from_ref","include_direct_addresses","init","","into","","into_discovery","","n0_dns_pkarr_relay","no_publish","or","","pkarr_relay","publish","republish_delay","resolve","secret_key","to_owned","try_from","","try_into","","ttl","type_id","","vzip","","PROVENANCE","StaticProvider","__clone_box","add_node_info","and","borrow","borrow_mut","clone","clone_into","clone_to_uninit","compat","compat_mut","compat_ref","default","deref","deref_mut","drop","fmt","from","from_node_info","from_ref","get_node_info","init","into","into_discovery","new","or","publish","remove_node_info","resolve","set_node_info","to_owned","try_from","try_into","type_id","vzip","DnsResolver","N0_DNS_NODE_ORIGIN_PROD","N0_DNS_NODE_ORIGIN_STAGING","__clone_box","and","borrow","borrow_mut","clear_cache","clone","clone_into","clone_to_uninit","compat","compat_mut","compat_ref","default","deref","deref_mut","drop","fmt","from","","from_ref","init","into","lookup_ipv4","lookup_ipv4_ipv6","lookup_ipv4_ipv6_staggered","lookup_ipv4_staggered","lookup_ipv6","lookup_ipv6_staggered","lookup_node_by_domain_name","lookup_node_by_domain_name_staggered","lookup_node_by_id","lookup_node_by_id_staggered","lookup_txt","new","or","reset","resolve","resolve_host","to_owned","try_from","try_into","type_id","vzip","with_nameserver","AEAD_LIMIT_REACHED","APPLICATION_ERROR","Accept","AcceptBi","AcceptUni","AckFrequencyConfig","AddNodeAddr","AddNodeAddrError","AeadKey","All","AlpnError","App","ApplicationClose","ApplicationClosed","BindError","Builder","CONNECTION_ID_LIMIT_ERROR","CONNECTION_REFUSED","CRYPTO_BUFFER_EXCEEDED","CallMeMaybe","Chunk","CidsExhausted","ClosedStream","","","Connect","ConnectError","ConnectOptions","ConnectWithOptsError","Connecting","Connection","","ConnectionClose","ConnectionClosed","ConnectionError","","ConnectionLost","","","","","ConnectionStats","ConnectionType","ControlMsg","Controller","ControllerFactory","CryptoError","CryptoServerConfig","Custom","Default","Direct","DirectAddr","DirectAddrInfo","DirectAddrType","Disabled","","Discover","Discovery","","DiscoveryStart","ENV_FORCE_STAGING_RELAYS","Empty","EmptyPruned","Endpoint","ExportKeyingMaterialError","FINAL_SIZE_ERROR","FLOW_CONTROL_ERROR","FRAME_ENCODING_ERROR","FinishedEarly","FrameStats","GetMappingAddressError","HandshakeTokenKey","INTERNAL_ERROR","INVALID_TOKEN","IllegalOrderedRead","Incoming","IncomingFuture","KEY_UPDATE_ERROR","Local","LocallyClosed","MAX","MAX_SIZE","MagicSpawn","Mixed","MtuDiscoveryConfig","NO_ERROR","NO_VIABLE_PATH","NamedApp","NoAddress","","None","OpenBi","OpenUni","OwnAddress","PROTOCOL_VIOLATION","PathSelection","PathStats","Ping","Pong","Portmapped","Qad","Qad4LocalPort","Quinn","Read","ReadDatagram","ReadError","","ReadExactError","ReadToEndError","RecvStream","Relay","","RelayMode","RelayOnly","RemoteInfo","RemoteNodeIdError","Reset","","ResetError","RetryError","STREAM_LIMIT_ERROR","STREAM_STATE_ERROR","Saved","SelfConnect","SendDatagramError","SendStream","ServerConfig","Source","Staging","Stopped","StoppedError","StreamId","TRANSPORT_PARAMETER_ERROR","TimedOut","TooLarge","TooLong","TransportConfig","TransportError","","TransportErrorCode","Udp","UdpStats","Unavailable","Unknown","UnknownHandshake","UnsupportedByPeer","UnsupportedVersion","VarInt","VersionMismatch","WeakConnectionHandle","WriteError","Written","ZeroRttAccepted","ZeroRttRejected","","","","__clone_box","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","accept","","accept_bi","accept_uni","accept_with","ack_eliciting_threshold","ack_frequency","ack_frequency_config","acks","add_discovery","add_node_addr","add_node_addr_with_source","addr","","addrs","aead_from_hkdf","allow_spin","alpn","","alpns","and","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","as_error_source","","","","","","","","","","","","","","","","","","backtrace","","","","","","","bind","bind_addr_v4","bind_addr_v6","black_hole_cooldown","black_holes_detected","borrow","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","borrow_mut","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bound_sockets","build","builder","bytes","","","cause","","","","","","","chunks","clear_discovery","clone","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","clone_box","clone_into","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","clone_to_uninit","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","close","","close_reason","closed","cmp","","","","code","compare","","","","compat","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","compat_mut","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","compat_ref","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","congestion_controller_factory","congestion_events","congestion_state","conn_type","","connect","connect_with_opts","connection_close","crypto","","","crypto_buffer_size","current_mtu","cwnd","data_blocked","datagram","datagram_receive_buffer_size","datagram_send_buffer_size","datagram_send_buffer_space","datagrams","decode","","","default","","","","","","","","","","","","","","default_relay_mode","deref","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","deref_mut","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","description","","","","","","","deserialize","","","","","dir","direct_addresses","discovery","","discovery_dht","discovery_local_network","discovery_n0","discovery_stream","dns_resolver","","drop","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","enable_segmentation_offload","encode","","","eq","","","","","","","","","","","","","","","","","","","","","","","","","","","equivalent","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","error_code","","export_keying_material","finish","fmt","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","force_staging_infra","frame","frame_rx","frame_tx","frame_type","from","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","from_ref","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","from_u32","from_u64","from_u64_unchecked","handshake_data","","handshake_done","has_send_address","hash","","","","","home_relay","id","","ignore","immediate_ack","in_current_span","","","","","","","","","","","","","","","","","","incoming_buffer_size","incoming_buffer_size_total","index","init","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","initial_keys","initial_mtu","initial_rtt","initial_window","initiator","insecure_skip_relay_cert_verify","interval","into","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","into_0rtt","into_any","into_future","","","","","","","","","","into_incoming","into_inner","ios","is_0rtt","is_alive","is_closed","keep_alive_interval","keylog","known_nodes","last_alive","last_control","last_payload","last_received","last_used","latency","","local_ip","lost_bytes","lost_packets","lost_plpmtud_probes","max_ack_delay","max_concurrent_bidi_streams","max_concurrent_uni_streams","max_data","max_datagram_size","max_idle_timeout","max_incoming","max_stream_data","max_streams_bidi","max_streams_uni","max_tls_tickets","metrics","migration","min_mtu","minimum_change","mtu_discovery_config","network_change","network_path_changed","new","","","new_connection_id","new_token","node_addr","node_id","","observed_addr","offset","on_ack","on_congestion_event","on_end_acks","on_mtu_update","on_sent","open","open_bi","open_uni","or","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","packet_threshold","partial_cmp","","","","path","path_challenge","path_response","path_selection","peer_identity","persistent_congestion_threshold","ping","poll","","","","","","","","","poll_flush","poll_read","","poll_shutdown","poll_write","","preferred_address_v4","preferred_address_v6","priority","proxy_from_env","proxy_url","read","read_chunk","read_chunks","read_datagram","read_exact","read_to_end","reason","","","receive_observed_address_reports","receive_window","received_reset","refuse","relay_map","relay_mode","relay_url","remote_address","remote_address_validated","remote_info","remote_info_iter","remote_node_id","reordering_threshold","reset","reset_stream","retire_connection_id","retry","retry_tag","retry_token_lifetime","rtt","","saturating_add","seal","secret_key","","send_datagram","send_fairness","send_observed_address_reports","send_window","sent_packets","sent_plpmtud_probes","serialize","","","","","set_alpns","set_max_concurrent_bi_streams","set_max_concurrent_uni_streams","set_priority","set_receive_window","set_user_data_for_discovery","source","","","","","","","","","","","","","","","sources","","stable_id","start_session","stats","stop","stop_sending","stopped","stream","stream_data_blocked","stream_receive_window","streams_blocked_bidi","streams_blocked_uni","time_source","time_threshold","to_owned","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","to_string","","","","","","","","","","","","","","","","","","","","","","","","","","","token_key","transport","transport_config","","try_from","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","try_into","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","try_poll","","","","","","","try_to_string","","","","","","","","","","","","","","","","","","","","","","","","","","","typ","type_id","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","udp_rx","udp_tx","upper_bound","user_data_for_discovery","validation_token","validation_token_config","vzip","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","window","with_additional_alpns","with_crypto","with_single_cert","with_transport_config","write","write_all","write_all_chunks","write_chunk","write_chunks","backtrace","","","pruned","span_trace","","","backtrace","","","source","span_trace","","","backtrace","","source","","span_trace","","backtrace","","source","","span_trace","","backtrace","","","","source","","","span_trace","","","","backtrace","","","source","","span_trace","","","name","","EndpointMetrics","MagicsockMetrics","NetReportMetrics","PortmapMetrics","RelayMetrics","__clone_box","accepts","actor_link_change","actor_tick_direct_addr_heartbeat","actor_tick_main","actor_tick_msg","actor_tick_other","actor_tick_portmap_changed","actor_tick_re_stun","and","","","","as_iterable","","","borrow","","","","borrow_mut","","","","bytes_recv","bytes_rx_ratelimited_total","bytes_sent","clone","clone_into","clone_to_uninit","compat","","","","compat_mut","","","","compat_ref","","","","connection_became_direct","connection_handshake_success","conns_rx_ratelimited_total","default","","","","deref","","","","deref_mut","","","","deserialize","","","disco_packets_dropped","disco_packets_recv","disco_packets_sent","disconnects","drop","","","","external_address_updated","field_count","","","field_ref","","","fmt","","","","from","","","","from_ref","got_ping","groups","groups_cloned","init","","","","into","","","","local_port_updates","magicsock","mapping_attempts","mapping_failures","name","","","","net_report","nodes_contacted","nodes_contacted_directly","num_direct_conns_added","num_direct_conns_removed","num_relay_conns_added","num_relay_conns_removed","or","","","","other_packets_dropped","other_packets_recv","other_packets_sent","pcp_available","pcp_probes","portmapper","probes_started","recv_data_ipv4","recv_data_ipv6","recv_data_relay","recv_datagrams","recv_disco_bad_key","recv_disco_bad_parse","recv_disco_call_me_maybe","recv_disco_call_me_maybe_bad_disco","recv_disco_ping","recv_disco_pong","recv_disco_relay","recv_disco_udp","recv_gro_datagrams","relay_home_change","send_data","send_data_network_down","send_disco_relay","send_disco_udp","send_ipv4","send_ipv6","send_packets_dropped","send_packets_recv","send_packets_sent","send_relay","send_relay_error","sent_disco_call_me_maybe","sent_disco_ping","sent_disco_pong","sent_disco_relay","sent_disco_udp","sent_pong","serialize","","","to_owned","try_from","","","","try_into","","","","type_id","","","","unique_client_keys","unknown_frames","update_direct_addrs","upnp_available","upnp_gateway_updated","upnp_probes","upnp_probes_failed","vzip","","","","Https","Metrics","Options","Probe","QadIpv4","QadIpv6","QuicConfig","RelayLatencies","Report","__clone_box","","","","","and","","","","","","as_iterable","as_protocols","borrow","","","","","","borrow_mut","","","","","","captive_portal","client_config","clone","","","","","clone_into","","","","","clone_to_uninit","","","","","cmp","compare","compat","","","","","","compat_mut","","","","","","compat_ref","","","","","","default","","","","deref","","","","","","deref_mut","","","","","","deserialize","","","disabled","drop","","","","","","ep","eq","","","equivalent","","","","","","","","","","","","field_count","field_ref","fmt","","","","","","","","from","","","","","","from_ref","","","","","global_v4","global_v6","has_udp","https","init","","","","","","insecure_skip_relay_cert_verify","into","","","","","","ipv4","ipv6","iter","mapping_varies_by_dest","mapping_varies_by_dest_ipv4","mapping_varies_by_dest_ipv6","name","or","","","","","","partial_cmp","preferred_relay","quic_config","relay_latency","reports","reports_full","serialize","","","to_owned","","","","","to_string","","try_from","","","","","","try_into","","","","","","try_to_string","","type_id","","","","","","udp_v4","udp_v6","vzip","","","","","","AttrFromString","DecodingError","","EncodingError","FailedBuildingPacket","IROH_TXT_NAME","InvalidEncodingZ32","InvalidLabel","InvalidLength","InvalidSignature","InvalidTxtEntry","LookupError","LookupFailed","MaxLengthExceededError","NodeData","NodeIdExt","NodeInfo","NotAnIrohRecord","NumLabels","ParseError","","UnexpectedFormat","UserData","Utf8","and","","","","as_error_source","","","","backtrace","","","","borrow","","","","borrow_mut","","","","cause","","","","compat","","","","compat_mut","","","","compat_ref","","","","data","deref","","","","deref_mut","","","","description","","","","drop","","","","fmt","","","","","","","","from","","","","","from_z32","in_current_span","","","","init","","","","into","","","","node_id","or","","","","source","","","","to_string","","","","to_z32","try_from","","","","try_into","","","","try_to_string","","","","type_id","","","","vzip","","","","backtrace","","","len","source","","span_trace","","","backtrace","","source","","span_trace","","backtrace","","","source","","","span_trace","","","backtrace","","","","","","key","label","num_labels","s","source","","span_trace","","","","","","AcceptError","AccessLimit","Connection","DynProtocolHandler","MissingRemoteNodeId","NotAllowed","ProtocolHandler","Router","RouterBuilder","User","__clone_box","","accept","","","","","and","","","","as_error_source","backtrace","borrow","","","","borrow_mut","","","","builder","cause","clone","","clone_into","","clone_to_uninit","","compat","","","","compat_mut","","","","compat_ref","","","","deref","","","","deref_mut","","","","description","drop","","","","endpoint","","fmt","","","","","from","","","","","","","","","from_err","from_ref","","in_current_span","init","","","","into","","","","is_shutdown","new","","on_connecting","","","","or","","","","shutdown","","","","","source","spawn","to_owned","","to_string","try_from","","","","try_into","","","","try_to_string","type_id","","","","vzip","","","","backtrace","source","","","span_trace","CleanupDropGuard","DnsPkarrServer","and","","borrow","","borrow_mut","","compat","","compat_mut","","compat_ref","","deref","","deref_mut","","discovery","dns_resolver","drop","","fmt","","from","","init","","into","","nameserver","node_origin","on_node","or","","pkarr_url","run","run_relay_server","run_relay_server_with","run_with_origin","try_from","","try_into","","type_id","","vzip",""],"q":[[0,"iroh"],[353,"iroh::KeyParsingError"],[361,"iroh::defaults"],[367,"iroh::defaults::prod"],[374,"iroh::defaults::staging"],[379,"iroh::discovery"],[772,"iroh::discovery::DiscoveryError"],[781,"iroh::discovery::IntoDiscoveryError"],[785,"iroh::discovery::ParseError"],[803,"iroh::discovery::dns"],[850,"iroh::discovery::mdns"],[900,"iroh::discovery::pkarr"],[1074,"iroh::discovery::pkarr::PkarrError"],[1081,"iroh::discovery::pkarr::dht"],[1142,"iroh::discovery::static_provider"],[1178,"iroh::dns"],[1224,"iroh::endpoint"],[3358,"iroh::endpoint::AddNodeAddrError"],[3365,"iroh::endpoint::AlpnError"],[3372,"iroh::endpoint::BindError"],[3378,"iroh::endpoint::ConnectError"],[3384,"iroh::endpoint::ConnectWithOptsError"],[3395,"iroh::endpoint::GetMappingAddressError"],[3403,"iroh::endpoint::Source"],[3405,"iroh::metrics"],[3589,"iroh::net_report"],[3797,"iroh::discovery"],[3798,"iroh::node_info"],[3799,"iroh::discovery"],[3800,"iroh::node_info"],[3814,"iroh::discovery"],[3816,"iroh::node_info"],[3818,"iroh::discovery"],[3819,"iroh::node_info"],[3820,"iroh::discovery"],[3821,"iroh::node_info"],[3857,"iroh::discovery"],[3858,"iroh::node_info"],[3900,"iroh::discovery"],[3901,"iroh::node_info"],[3934,"iroh::node_info::DecodingError"],[3943,"iroh::node_info::EncodingError"],[3949,"iroh::node_info::LookupError"],[3958,"iroh::discovery::ParseError"],[3976,"iroh::protocol"],[4106,"iroh::protocol::AcceptError"],[4111,"iroh::test_utils"],[4159,"dyn_clone::sealed"],[4160,"tower_http::follow_redirect::policy::and"],[4161,"tower_http::follow_redirect::policy"],[4162,"iroh_base::key"],[4163,"core::error"],[4164,"backtrace::capture"],[4165,"core::option"],[4166,"iroh_base::relay_url"],[4167,"iroh_base::node_addr"],[4168,"iroh_relay::relay_map"],[4169,"core::cmp"],[4170,"async_compat"],[4171,"core::result"],[4172,"serde_core::de"],[4173,"core::net::socket_addr"],[4174,"core::iter::traits::iterator"],[4175,"alloc::collections::btree::set"],[4176,"core::fmt"],[4177,"ed25519_dalek::verifying"],[4178,"data_encoding"],[4179,"signature::error"],[4180,"ed25519_dalek::signing"],[4181,"iroh_relay::node_info"],[4182,"iroh_base::ticket::node"],[4183,"iroh::magicsock::node_map::node_state"],[4184,"url"],[4185,"core::iter::traits::collect"],[4186,"rand_core"],[4187,"n0_watcher"],[4188,"core::clone"],[4189,"alloc::sync"],[4190,"core::hash"],[4191,"core::ops::function"],[4192,"core::marker"],[4193,"tower_http::follow_redirect::policy::or"],[4194,"core::task::wake"],[4195,"core::task::poll"],[4196,"serde_core::ser"],[4197,"ed25519"],[4198,"alloc::string"],[4199,"alloc::collections"],[4200,"core::any"],[4201,"n0_snafu::spantrace"],[4202,"iroh_relay::dns"],[4203,"alloc::boxed"],[4204,"pkarr::signed_packet"],[4205,"alloc::vec"],[4206,"futures_lite::stream"],[4207,"core::str::error"],[4208,"core::time"],[4209,"pkarr::keys"],[4210,"reqwest::error"],[4211,"http::status"],[4212,"pkarr::client"],[4213,"core::convert"],[4214,"hickory_proto::runtime::tokio_runtime"],[4215,"hickory_resolver::name_server::connection_provider"],[4216,"hickory_resolver::resolver"],[4217,"core::net::ip_addr"],[4218,"reqwest::dns::resolve"],[4219,"core::future::future"],[4220,"core::pin"],[4221,"iroh_quinn_proto::connection"],[4222,"iroh_quinn::connection"],[4223,"iroh_quinn_proto::config"],[4224,"iroh_quinn_proto::config::transport"],[4225,"iroh_quinn_proto::varint"],[4226,"iroh_quinn_proto::connection::stats"],[4227,"iroh::magicsock"],[4228,"iroh_quinn_proto::crypto"],[4229,"iroh_quinn_proto::congestion"],[4230,"std::time"],[4231,"iroh_quinn_proto::connection::assembler"],[4232,"bytes::bytes"],[4233,"iroh_quinn_proto::connection::streams::send"],[4234,"iroh_quinn::recv_stream"],[4235,"iroh_quinn::send_stream"],[4236,"iroh_quinn_proto::connection::streams"],[4237,"iroh::magicsock::node_map"],[4238,"iroh_quinn_proto::frame"],[4239,"iroh_quinn_proto"],[4240,"iroh_quinn_proto::coding"],[4241,"bytes::buf::buf_impl"],[4242,"futures_core::stream"],[4243,"bytes::buf::buf_mut"],[4244,"iroh_quinn::incoming"],[4245,"iroh_quinn_proto::connection::streams::recv"],[4246,"iroh_relay::protos::common"],[4247,"ring::error::unspecified"],[4248,"iroh_quinn_proto::transport_parameters"],[4249,"iroh_quinn_proto::shared"],[4250,"iroh_quinn_proto::connection::paths"],[4251,"std::io::error"],[4252,"tokio::io::read_buf"],[4253,"std::collections::hash::map"],[4254,"rustls_pki_types"],[4255,"rustls::error"],[4256,"iroh_quinn_proto::endpoint"],[4257,"iroh_metrics::metrics"],[4258,"iroh_metrics::iterable"],[4259,"iroh_metrics::base"],[4260,"iroh::net_report::options::imp"],[4261,"iroh::net_report::probes"],[4262,"iroh::net_report::report"],[4263,"iroh::net_report::reportgen"],[4264,"rustls::client::client_conn"],[4265,"iroh::net_report::metrics"],[4266,"iroh_quinn::endpoint"],[4267,"z32"],[4268,"simple_dns::simple_dns_error"],[4269,"hickory_proto::error"],[4270,"tokio::runtime::task::error"],[4271,"iroh::test_utils::dns_and_pkarr_servers"],[4272,"iroh_relay::server"],[4273,"iroh_relay"],[4274,"iroh_relay::defaults"]],"i":"Af0`0`l`````````F``1B`BbBdBfBh67432Al217807807785430217854302180754321754321754321743174317854302178543021785430212`778543302178543021807543144``785430212`74321777744443333222211117788543300221177788855544444433022211752247543217537562743807854302167854302164226``44`267854302174316`7514457543158066`5754321783021777785543021785430217830217854302161277854302144HnI`Ib21210``````````````````J``0Jh`````0```InJd0``33`3Jb1`4Il3Dn5JjIh33628Jl56821Jf:6708:670584:1679320584:1679320:670558493584935849388584:1679320584:1679320584:16793204525844:167933205844:1679320:6705`1584:1679320258493555588884444999933335884::166779320055844444::167793220676744584932848:670584:1679320584:1679320L`3544`6542454695;278:4319`4Ij4704377<892`04657:6;56:<89267::6<389;5427:6<389;542:<8927:6<389;5427527:6<389;542767676LlLnM`100210Mb000MdMfMhMjMlMn413520543210````NdNb10100110101010100101010101010110110101010```NfNh101011001010110101010101010101010100001010101``Kf0000````````00NnObOd3Nl3O`3255514032514032104354324324325140325140325140325140325140325`1051403255140325140324325514032514032140343251403242132543255140325140325151403245140322OfOjOnA@bA@dA@fA@j``A@n0A@l10100101111010101010100101010101010100010010101101001010AAb`0000000000000000000000000000000000```Jn000000000000000000000000000000000000000000AIb0````AEd``AIh`AHj`ACd``444AHd`1`AGhAGnAEf`````0`4`AEbAGd4AGj4AH````````AIl0AHf```41AEj40;AG`ADbAFdAHbAGb=ADjEdAHfAHhAHjACdACnAFbAClAHlAHnAI`AIbAIdADlAIfAIhABlAIjACfAIl3AC`220?ADbADd1ADf77ADj;EdADn4ACb94AMnAMlACjAChAN`AK`AGdAKbAJhAGfAGhAGjAGlAJjAGnAH`ADdAD`AFlAG`ADbAFdAHbAGbAHdADjEdAHfAHhAHjACdACnAFbAClAJnAKdAKfAHlAHnADhAI`AIbAIdADlAIfAIhADfABlAEdAEfAEhAEjAIjABn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AFbAClAJnAKdAKfAHlAHnADhAI`AIbAIdADlAIfAIhADfABlAEdAEfAEhAEjAIjABnAC`AKhACbAEbAKjACfAElAIlAMnAMlACjAChAN`AK`AGdAKbAJhAGfAGhAGjAGlAJjAGnAH`ADdAD`AFlAG`ADbAFdAHbAGbAHdADjEdAHfAHhAHjACdACnAFbAClAJnAKdAKfAHlAHnADhAI`AIbAIdADlAIfAIhADfABlAEdAEfAEhAEjAIjABnAC`AKhACbAEbAKjACfAElAIlADdAFd4ABlEd11ADbAIb1ACl65522669AG`AD`3AId91258AHbAGbAHfAHhACnAFbAIhADfAIj`AMnAMlACjAChAN`AK`AGdAKbAJhAGfAGhAGjAGlAJjAGnAH`ADdAD`AFlAG`ADbAFdAHbAGbAHdADjEdAHfAHhAHjACdACnAFbAClAJnAKdAKfAHlAHnADhAI`AIbAIdADlAIfAIhADfABlAEdAEfAEhAEjAIjABnAC`AKhACbAEbAKjACfAElAIlAMnAMlACjAChAN`AK`AGdAKbAJhAGfAGhAGjAGlAJjAGnAH`ADdAD`AFlAG`ADbAFdAHbAGbAHdADjEdAHfAHhAHjACdACnAFbAClAJnAKdAKfAHlAHnADhAI`AIbAIdADlAIfAIhADfABlAEdAEfAEhAEjAIjABnAC`AKhACbAEbAKjACfAElAIlADh>=<;52AHdADjEdAHfAHjAIdABlADf1000101AMnAMlACjAChAN`AK`AGdAKbAJh0AGfAGhAGjAGlAJj0AGnAH`ADdAD`AFlAG`ADbAFdAHbAGbAHdADjEdAHfAHhAHjACdACnAFbAClAJnAKdAKfAHlAHnADhAI`AIbAIdADlAIfAIhADfABlAEdAEfAEhAEjAIjABnAC`AKhACbAEbAKjACfAElAIlADdAD`AIbAIdAGdAGfAGhAGjAGlAGnAH`9AFlAGbAHdADjEdAHfAHhAHjACdAJnAHlAHnAI`AIbAIdADlAIfAIhAIlAGd000AGf000AGh000AGj000AGl000AGn000AH`000AD`000AFl000AGb000AHd000ADj000Ed000AHf000AHh000AHj000ACd000AJn000AHl000AHn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b{Ed}}}Ed}{{{b{AHf}}}AHf}{{{b{AHh}}}AHh}{{{b{AHj}}}AHj}{{{b{ACd}}}ACd}{{{b{ACn}}}ACn}{{{b{AFb}}}AFb}{{{b{ACl}}}ACl}{{{b{AHl}}}AHl}{{{b{AHn}}}AHn}{{{b{AI`}}}AI`}{{{b{AIb}}}AIb}{{{b{AId}}}AId}{{{b{ADl}}}ADl}{{{b{AIf}}}AIf}{{{b{AIh}}}AIh}{{{b{ABl}}}ABl}{{{b{AIj}}}AIj}{{{b{ACf}}}ACf}{{{b{AIl}}}AIl}{{{b{AFj}}}{{Kh{AFj}}}}{{b{b{Anc}}}f{}}0000000000000000000000000000000000{{bn}f}0000000000000000000000000000000000{{{b{ABl}}}f}{{{b{ACf}}AD`{b{{Ad{n}}}}}f}{{{b{ACf}}}{{Aj{ACd}}}}{{{b{ACf}}}ACd}{{{b{AD`}}{b{AD`}}}Bj}{{{b{AId}}{b{AId}}}Bj}{{{b{ADl}}{b{ADl}}}Bj}{{{b{AIf}}{b{AIf}}}Bj}{AI`AIb}{{b{b{c}}}Bj{}}000{{}{{Bl{c}}}{}}0000000000000000000000000000000000000000000000000000000000000{{{b{An}}}{{Bl{{b{Anc}}}}}{}}0000000000000000000000000000000000000000000000000000000000000{b{{Bl{{b{c}}}}}{}}0000000000000000000000000000000000000000000000000000000000000{{{b{AnADd}}{Ff{AFf}}}{{b{AnADd}}}}{AFdLb}{{{b{ACf}}}{{Kh{AFj}}}}{{{b{ABl}}Ld}{{Aj{{AIn{AHf}}}}}}{EdAHf}{{{b{ABl}}c{b{{Ad{n}}}}}{{Cd{ACfAEf}}}{{AAd{Bb}}}}{{{b{ABl}}c{b{{Ad{n}}}}AIj}{{Cd{ACbAEd}}}{{AAd{Bb}}}}{ADbLb}{nAIb}1{AClFf}{{{b{AnADd}}C`}{{b{AnADd}}}}{AFdIf}:44{{{b{AnADd}}{Aj{C`}}}{{b{AnADd}}}}2{{{b{ACf}}}C`}{AG`Lb}{{{b{Anc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l}}}Gn{}}000000{b{{Cd{HfHh}}}}00000000000000000000000000{ADlAIf}{bHj}0000000000000000000000000000000000000000000000000000000000000{AHbAG`}0{{{b{AnAFb}}If}{{b{AnAFb}}}}{{ADfIn}ADf}{AClAOd}{{{b{AnACl}}AOd}{{b{AnACl}}}}{{}c{}}0000000000000000000000000000000000000000000000000000000000000{{{b{AFj}}}Lb}{{AIj{Kl{{Kl{n}}}}}AIj}{{{Ff{ALl}}}ACl}{{{Kl{AOf}}AOh}{{Cd{AClAOj}}}}{{AIj{Ff{ADd}}}AIj}{{{b{AnAJj}}{b{{Ad{n}}}}}{{Cd{C`AGn}}}}{{{b{AnAJj}}{b{{Ad{n}}}}}{{Cd{fAGn}}}}{{{b{AnAJj}}{b{An{Ad{AFn}}}}}{{Cd{fAGn}}}}{{{b{AnAJj}}AFn}{{Cd{fAGn}}}}{{{b{AnAJj}}{b{An{Ad{AFn}}}}}{{Cd{AGbAGn}}}}{AOlAj}{AOnAj}{B@`Aj}{AOnC`}{AOlId}{AOnId}{B@`Id}{B@bAj}{B@dAj}{B@fAj}{B@bACd}{B@bId}{B@dId}{B@fId}{B@hAj}{B@jAj}`{B@jJb}{B@hId}{B@jId}{B@lAj}{B@nAj}{B@lKh}{B@nKh}{B@lId}{B@nId}{BA`Aj}{BAbAj}{BAdAj}{BAfAj}{BA`ADh}{BAdAEj}{BAfBAh}{BA`Id}{BAbId}{BAdId}{BAfId}{BAjAj}{BAlAj}{BAnAj}{BAjJd}{BAlJd}{BAjId}{BAlId}{BAnId}{BB`Hf}{BBbHf}`````{{bd}f}{BBdBBf}{BBhBBf}000000{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}000{b{{b{BBj}}}}00{b{{b{c}}}{}}000{{{b{An}}}{{b{Anc}}}{}}000555{{{b{AMh}}}AMh}{{b{b{Anc}}}f{}}{{bn}f}{{}{{Bl{c}}}{}}000{{{b{An}}}{{Bl{{b{Anc}}}}}{}}000{b{{Bl{{b{c}}}}}{}}000::;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}}0{bHj}0{{}c{}}0","D":"GM`","p":[[1,"reference",null,null,1],[5,"Private",4159],[1,"unit"],[5,"And",4160],[10,"Policy",4161],[5,"PublicKey",0,4162],[1,"u8"],[1,"array"],[10,"Error",4163],[1,"slice"],[6,"KeyParsingError",0,4162],[5,"Backtrace",4164],[6,"Option",4165,null,1],[5,"RelayUrlParseError",0,4166],[0,"mut"],[5,"SecretKey",0,4162],[5,"NodeAddr",0,4167],[5,"RelayUrl",0,4166],[5,"RelayMap",0,4168],[5,"RelayNode",0,4168],[6,"Ordering",4169],[5,"Compat",4170],[1,"bool"],[1,"usize"],[1,"str"],[6,"Result",4171,null,1],[10,"Deserializer",4172],[17,"Item"],[6,"SocketAddr",4173],[10,"Iterator",4174],[5,"BTreeSet",4175],[5,"Formatter",4176],[5,"Error",4176],[10,"Display",4176],[5,"VerifyingKey",4177],[5,"DecodeError",4178],[5,"Error",4179],[5,"SigningKey",4180],[5,"NodeInfo",3900,4181],[1,"tuple",null,null,1],[5,"NodeTicket",4182],[5,"RemoteInfo",1224,4183],[5,"Url",4184],[10,"IntoIterator",4185],[6,"DecodingError",3901,4181],[10,"CryptoRng",4186],[17,"Value"],[10,"Watcher",0,4187],[10,"Clone",4188],[10,"Eq",4169],[5,"Arc",4189,null,1],[10,"Hasher",4190],[5,"InitializedFut",4187],[10,"Nullable",4187],[5,"Map",4187],[5,"Disconnected",4187],[17,"Output"],[10,"Fn",4191],[10,"Send",4192],[10,"Sync",4192],[5,"Or",4193],[5,"Context",4194],[6,"Poll",4195],[10,"Serializer",4196],[5,"Signature",4197],[5,"Stream",4187],[5,"String",4198],[5,"TryReserveError",4199],[5,"TypeId",4200],[5,"NextFut",4187],[15,"Decode",353],[15,"Key",353],[15,"DecodeInvalidLength",353],[5,"SpanTrace",4201],[1,"u16"],[5,"ConcurrentDiscovery",3900],[10,"Discovery",3900],[5,"NodeData",3900,4181],[5,"UserData",3900,4181],[6,"ParseError",3900,4181],[6,"IntoDiscoveryError",3900],[6,"DiscoveryError",3900],[5,"Lagged",3900],[6,"DiscoveryEvent",3900],[5,"DiscoveryItem",3900],[5,"DiscoveryContext",3900],[5,"DnsResolver",1178,4202],[8,"Result",4176],[6,"IrohAttr",4181],[5,"TxtAttrs",4181],[6,"PkarrError",900],[5,"Box",4203,null,1],[5,"SignedPacket",4204],[5,"Vec",4205],[5,"TxtLookup",4202],[10,"IntoDiscovery",3900],[1,"u64"],[8,"NodeId",0,4162],[8,"Boxed",4206],[1,"u32"],[6,"EncodingError",3901,4181],[15,"NoServiceConfigured",772],[15,"NoResults",772],[15,"User",772],[15,"User",781],[15,"UnexpectedFormat",3958],[15,"AttrFromString",3958],[15,"NumLabels",3958],[15,"Utf8",3958],[15,"NotAnIrohRecord",3958],[15,"DecodingError",3958],[5,"Utf8Error",4207],[5,"DnsDiscoveryBuilder",803],[5,"DnsDiscovery",803],[5,"MdnsDiscoveryBuilder",850],[5,"MdnsDiscovery",850],[5,"Duration",4208],[5,"PkarrPublisherBuilder",900],[5,"PkarrPublisher",900],[5,"PkarrResolverBuilder",900],[5,"PkarrResolver",900],[5,"PkarrRelayClient",900],[15,"PublicKey",1074],[6,"PublicKeyError",4209],[15,"Verify",1074],[6,"SignedPacketVerifyError",4204],[15,"HttpSend",1074],[5,"Error",4210],[15,"HttpPayload",1074],[15,"Encoding",1074],[15,"HttpRequest",1074],[5,"StatusCode",4211],[15,"InvalidRelayUrl",1074],[5,"Builder",1081],[5,"DhtDiscovery",1081],[5,"Client",4212],[5,"StaticProvider",1142],[10,"Into",4213,null,1],[5,"TokioRuntimeProvider",4214],[5,"GenericConnector",4215],[5,"Resolver",4216],[6,"IpAddr",4217],[6,"DnsError",4202],[10,"ToString",4198],[5,"StaggeredError",4202],[6,"LookupError",3901,4181],[5,"Name",4218],[10,"Future",4219,null,1],[5,"Pin",4220],[5,"Endpoint",1224],[5,"Accept",1224],[5,"Incoming",1224],[5,"Connecting",1224],[6,"ConnectionError",1224,4221],[5,"Connection",1224],[5,"AcceptBi",1224,4222],[5,"AcceptUni",1224,4222],[5,"ServerConfig",1224,4223],[5,"AckFrequencyConfig",1224,4224],[5,"VarInt",1224,4225],[5,"FrameStats",1224,4226],[5,"TransportConfig",1224,4224],[5,"Builder",1224],[6,"AddNodeAddrError",1224,4227],[5,"DirectAddrInfo",1224,4183],[5,"DirectAddr",1224,4227],[10,"HandshakeTokenKey",1224,4228],[10,"AeadKey",1224,4228],[6,"AlpnError",1224],[6,"ConnectWithOptsError",1224],[6,"ConnectError",1224],[6,"BindError",1224],[6,"GetMappingAddressError",1224],[5,"RemoteNodeIdError",1224],[5,"SocketAddrV4",4173],[5,"SocketAddrV6",4173],[5,"MtuDiscoveryConfig",1224,4224],[5,"PathStats",1224,4226],[10,"ControllerFactory",1224,4229],[5,"Instant",4230],[10,"Controller",1224,4229],[5,"Chunk",1224,4231],[5,"Bytes",4232],[5,"UdpStats",1224,4226],[5,"Written",1224,4233],[6,"SendDatagramError",1224,4222],[6,"ReadToEndError",1224,4234],[6,"ReadError",1224,4234],[6,"ResetError",1224,4234],[6,"ReadExactError",1224,4234],[6,"WriteError",1224,4235],[6,"StoppedError",1224,4235],[5,"ConnectionStats",1224,4226],[6,"ControlMsg",1224,4183],[6,"ConnectionType",1224,4183],[5,"ClosedStream",1224,4236],[6,"Source",1224,4237],[5,"ConnectionClose",1224,4238],[5,"ApplicationClose",1224,4238],[5,"TransportError",1224],[5,"TransportErrorCode",1224],[5,"StreamId",1224,4239],[6,"DirectAddrType",1224,4227],[6,"PathSelection",1224],[5,"ConnectOptions",1224],[6,"RelayMode",1224],[5,"Direct",4187],[5,"UnexpectedEnd",4240],[10,"Buf",4241],[6,"Dir",4239],[10,"Stream",4242],[5,"RecvStream",1224,4234],[5,"SendStream",1224,4235],[10,"BufMut",4243],[5,"ExportKeyingMaterialError",1224,4228],[5,"WeakConnectionHandle",1224,4222],[5,"RetryError",1224,4244],[5,"CryptoError",1224,4228],[5,"UnsupportedVersion",1224,4228],[5,"IncomingFuture",1224],[5,"ZeroRttAccepted",1224],[6,"ReadableError",4245],[6,"FrameType",4246],[6,"Close",4238],[5,"Unspecified",4247],[5,"InvalidFrame",4238],[6,"Error",4248],[5,"VarIntBoundsExceeded",4225],[10,"Any",4200],[10,"CryptoServerConfig",1224],[5,"ConnectionId",4249],[5,"Keys",4228],[6,"Side",4239],[5,"Incoming",4244],[5,"IdleTimeout",4224],[5,"EndpointMetrics",3405],[5,"RttEstimator",4250],[5,"OpenBi",1224,4222],[5,"OpenUni",1224,4222],[5,"ReadDatagram",1224,4222],[5,"Error",4251],[5,"ReadBuf",4252],[1,"i32"],[5,"HashMap",4253],[5,"TransportParameters",4248],[10,"Session",4228],[10,"TimeSource",4223],[1,"f32"],[1,"u128"],[5,"ValidationTokenConfig",4223],[5,"CertificateDer",4254],[6,"PrivateKeyDer",4254],[6,"Error",4255],[15,"Empty",3358],[15,"EmptyPruned",3358],[15,"OwnAddress",3358],[15,"ConnectionError",3365],[15,"Unavailable",3365],[15,"UnknownHandshake",3365],[15,"MagicSpawn",3372],[15,"Discovery",3372],[15,"Connect",3378],[15,"Connection",3378],[15,"AddNodeAddr",3384],[15,"SelfConnect",3384],[15,"NoAddress",3384],[15,"Quinn",3384],[6,"ConnectError",4256],[15,"DiscoveryStart",3395],[15,"Discover",3395],[15,"NoAddress",3395],[15,"Discovery",3403],[15,"NamedApp",3403],[5,"RelayMetrics",3405],[5,"Counter",4257],[5,"MagicsockMetrics",3405],[10,"Iterable",4258],[5,"PortmapMetrics",3405],[5,"MetricItem",4259],[10,"MetricsGroup",4259],[5,"Options",3589,4260],[6,"Probe",3589,4261],[5,"Report",3589,4262],[5,"QuicConfig",3589,4263],[5,"ClientConfig",4264],[5,"RelayLatencies",3589,4262],[5,"Metrics",3589,4265],[5,"Endpoint",4266],[5,"MaxLengthExceededError",3901,4181],[6,"SignedPacketBuildError",4204],[10,"NodeIdExt",3901,4181],[15,"InvalidEncodingZ32",3934],[15,"InvalidLength",3934],[15,"InvalidSignature",3934],[6,"Z32Error",4267],[15,"FailedBuildingPacket",3943],[15,"InvalidTxtEntry",3943],[6,"SimpleDnsError",4268],[15,"ParseError",3949],[15,"LookupFailed",3949],[15,"InvalidLabel",3949],[5,"ProtoError",4269],[10,"ProtocolHandler",3976],[6,"AcceptError",3976],[10,"DynProtocolHandler",3976],[5,"RouterBuilder",3976],[10,"AsRef",4213],[5,"AccessLimit",3976],[5,"Router",3976],[10,"Debug",4176],[5,"JoinError",4270],[15,"Connection",4106],[15,"MissingRemoteNodeId",4106],[15,"User",4106],[5,"DnsPkarrServer",4111,4271],[5,"CleanupDropGuard",4111],[8,"Result",4251],[5,"Server",4272],[6,"SpawnError",4272]],"r":[[0,4162],[1,4162],[2,1224],[3,4162],[4,4162],[5,4162],[6,4167],[7,4162],[8,4162],[9,4168],[10,1224],[11,4168],[12,4166],[13,4166],[14,4162],[15,4187],[16,4187],[17,4162],[18,4162],[19,4167],[20,4166],[21,4168],[22,4168],[23,4162],[24,4162],[25,4162],[26,4167],[27,4166],[28,4166],[29,4168],[30,4168],[31,4162],[32,4162],[33,4166],[34,4162],[35,4162],[36,4166],[37,4162],[38,4162],[39,4162],[40,4162],[41,4167],[42,4166],[43,4166],[44,4168],[45,4168],[46,4162],[47,4162],[48,4162],[49,4167],[50,4166],[51,4166],[52,4168],[53,4168],[54,4162],[55,4166],[56,4162],[57,4162],[58,4167],[59,4166],[60,4168],[61,4168],[62,4162],[63,4162],[64,4167],[65,4166],[66,4168],[67,4168],[68,4162],[69,4162],[70,4167],[71,4166],[72,4168],[73,4168],[74,4162],[75,4167],[76,4166],[77,4168],[78,4162],[79,4167],[80,4166],[81,4168],[82,4162],[83,4162],[84,4162],[85,4167],[86,4166],[87,4166],[88,4168],[89,4168],[90,4162],[91,4162],[92,4162],[93,4167],[94,4166],[95,4166],[96,4168],[97,4168],[98,4162],[99,4162],[100,4162],[101,4167],[102,4166],[103,4166],[104,4168],[105,4168],[106,4168],[108,4162],[109,4162],[110,4162],[111,4162],[112,4167],[113,4166],[114,4166],[115,4166],[116,4168],[117,4168],[118,4162],[119,4162],[120,4162],[121,4167],[122,4166],[123,4166],[124,4168],[125,4168],[126,4162],[127,4166],[128,4162],[129,4162],[130,4167],[131,4166],[132,4168],[133,4167],[134,4167],[137,4162],[138,4162],[139,4162],[140,4167],[141,4166],[142,4166],[143,4168],[144,4168],[145,4168],[147,4162],[148,4167],[149,4166],[150,4168],[151,4168],[152,4162],[153,4162],[154,4162],[155,4162],[156,4167],[157,4167],[158,4167],[159,4167],[160,4166],[161,4166],[162,4166],[163,4166],[164,4168],[165,4168],[166,4168],[167,4168],[168,4168],[169,4168],[170,4168],[171,4168],[172,4162],[173,4162],[174,4162],[175,4162],[176,4162],[177,4167],[178,4166],[179,4166],[180,4166],[181,4166],[182,4168],[183,4168],[184,4168],[185,4168],[186,4162],[187,4162],[188,4162],[189,4162],[190,4162],[191,4162],[192,4162],[193,4162],[194,4162],[195,4167],[196,4167],[197,4167],[198,4167],[199,4167],[200,4167],[201,4166],[202,4166],[203,4166],[204,4168],[205,4168],[206,4168],[207,4168],[208,4168],[209,4162],[210,4162],[211,4168],[212,4168],[213,4167],[214,4162],[215,4162],[216,4167],[217,4166],[218,4168],[219,4168],[220,4162],[221,4162],[222,4166],[223,4162],[224,4162],[225,4187],[226,4168],[227,4162],[228,4167],[229,4166],[230,4162],[231,4166],[232,4162],[233,4162],[234,4162],[235,4167],[236,4166],[237,4166],[238,4168],[239,4168],[240,4187],[241,4162],[242,4162],[243,4162],[244,4167],[245,4166],[246,4166],[247,4168],[248,4168],[249,4187],[250,4167],[251,4168],[252,4168],[253,4187],[256,4167],[257,4167],[258,4273],[259,4168],[260,4187],[261,4162],[262,4162],[263,4162],[264,4167],[265,4166],[266,4166],[267,4168],[268,4168],[269,4162],[270,4167],[271,4166],[272,4168],[273,4187],[275,4162],[276,4162],[277,4168],[278,4167],[279,4167],[280,4162],[281,4162],[282,4162],[283,4167],[284,4166],[285,4168],[286,4162],[287,4162],[288,4166],[289,4187],[290,4187],[292,4162],[293,4162],[294,4162],[295,4167],[296,4166],[297,4168],[298,4168],[299,4162],[300,4162],[301,4166],[302,4166],[303,4168],[304,4168],[305,4162],[306,4162],[307,4162],[308,4162],[309,4162],[310,4162],[311,4162],[312,4167],[313,4166],[314,4166],[315,4168],[316,4168],[317,4162],[318,4162],[319,4162],[320,4167],[321,4166],[322,4166],[323,4168],[324,4168],[325,4162],[326,4162],[327,4166],[328,4166],[329,4168],[330,4168],[331,4162],[332,4162],[333,4162],[334,4167],[335,4166],[336,4166],[337,4168],[338,4168],[339,4187],[340,4168],[341,4168],[342,4162],[343,4162],[344,4162],[345,4162],[346,4167],[347,4166],[348,4166],[349,4168],[350,4168],[351,4167],[352,4167],[364,4274],[379,4181],[381,4181],[392,4181],[395,4181],[396,4181],[397,4181],[398,4181],[399,4181],[400,4181],[403,4181],[404,4181],[405,4181],[406,4181],[407,4181],[411,4181],[412,4181],[413,4181],[414,4181],[415,4181],[423,4181],[427,4181],[428,4181],[432,4181],[433,4181],[434,4181],[435,4181],[443,4181],[444,4181],[445,4181],[446,4181],[454,4181],[458,4181],[459,4181],[460,4181],[461,4181],[464,4181],[465,4181],[466,4181],[469,4181],[470,4181],[471,4181],[474,4181],[475,4181],[476,4181],[477,4181],[478,4181],[479,4181],[487,4181],[488,4181],[489,4181],[490,4181],[498,4181],[499,4181],[500,4181],[501,4181],[509,4181],[510,4181],[512,4181],[513,4181],[514,4181],[515,4181],[516,4181],[525,4181],[526,4181],[527,4181],[528,4181],[529,4181],[537,4181],[541,4181],[544,4181],[545,4181],[546,4181],[547,4181],[556,4181],[557,4181],[558,4181],[561,4181],[562,4181],[563,4181],[564,4181],[565,4181],[566,4181],[567,4181],[568,4181],[569,4181],[570,4181],[571,4181],[572,4181],[581,4181],[582,4181],[583,4181],[584,4181],[585,4181],[586,4181],[597,4181],[598,4181],[599,4181],[600,4181],[601,4181],[602,4181],[603,4181],[604,4181],[605,4181],[606,4181],[620,4181],[621,4181],[622,4181],[623,4181],[624,4181],[628,4181],[629,4181],[630,4181],[631,4181],[635,4181],[636,4181],[637,4181],[638,4181],[646,4181],[647,4181],[648,4181],[649,4181],[659,4181],[663,4181],[664,4181],[668,4181],[670,4181],[671,4181],[672,4181],[673,4181],[681,4181],[686,4181],[690,4181],[691,4181],[692,4181],[699,4181],[701,4181],[702,4181],[703,4181],[706,4181],[707,4181],[708,4181],[712,4181],[713,4181],[714,4181],[715,4181],[716,4181],[717,4181],[725,4181],[726,4181],[727,4181],[728,4181],[736,4181],[737,4181],[741,4181],[742,4181],[743,4181],[744,4181],[752,4181],[755,4181],[756,4181],[757,4181],[758,4181],[766,4181],[767,4181],[768,4181],[769,4181],[770,4181],[771,4181],[805,4202],[806,4202],[1178,4202],[1179,4202],[1180,4202],[1181,4202],[1182,4202],[1183,4202],[1184,4202],[1185,4202],[1186,4202],[1187,4202],[1188,4202],[1189,4202],[1190,4202],[1191,4202],[1192,4202],[1193,4202],[1194,4202],[1195,4202],[1196,4202],[1197,4202],[1198,4202],[1199,4202],[1200,4202],[1201,4202],[1202,4202],[1203,4202],[1204,4202],[1205,4202],[1206,4202],[1207,4202],[1208,4202],[1209,4202],[1210,4202],[1211,4202],[1212,4202],[1213,4202],[1214,4202],[1215,4202],[1216,4202],[1217,4202],[1218,4202],[1219,4202],[1220,4202],[1221,4202],[1222,4202],[1223,4202],[1227,4222],[1228,4222],[1229,4224],[1231,4227],[1232,4228],[1235,4237],[1236,4238],[1237,4221],[1243,4183],[1244,4231],[1245,4221],[1246,4236],[1247,4234],[1248,4235],[1256,4238],[1257,4221],[1258,4221],[1260,4222],[1261,4234],[1262,4234],[1263,4235],[1264,4235],[1265,4226],[1266,4183],[1267,4183],[1268,4229],[1269,4229],[1270,4228],[1274,4183],[1275,4227],[1276,4183],[1277,4227],[1278,4222],[1281,4237],[1285,4227],[1286,4227],[1288,4228],[1292,4234],[1293,4226],[1295,4228],[1298,4234],[1302,4227],[1303,4221],[1304,4225],[1305,4225],[1307,4183],[1308,4224],[1311,4237],[1314,4183],[1315,4222],[1316,4222],[1317,4227],[1320,4226],[1321,4183],[1322,4183],[1323,4227],[1324,4227],[1325,4227],[1327,4234],[1328,4222],[1329,4234],[1330,4234],[1331,4234],[1332,4234],[1333,4234],[1334,4183],[1335,4237],[1338,4183],[1340,4234],[1341,4221],[1342,4234],[1343,4244],[1346,4237],[1348,4222],[1349,4235],[1350,4223],[1351,4237],[1353,4235],[1354,4235],[1355,4239],[1357,4221],[1358,4222],[1359,4234],[1360,4224],[1362,4221],[1364,4237],[1365,4226],[1367,4227],[1369,4222],[1370,4228],[1371,4225],[1372,4221],[1373,4222],[1374,4235],[1375,4233],[1377,4234],[1378,4234],[1379,4235],[1380,4235],[1381,4222],[1382,4234],[1383,4234],[1384,4234],[1385,4234],[1386,4235],[1387,4235],[1388,4225],[1389,4226],[1390,4226],[1391,4226],[1392,4226],[1393,4233],[1394,4183],[1395,4183],[1396,4183],[1397,4183],[1398,4236],[1399,4237],[1400,4221],[1401,4224],[1402,4224],[1403,4223],[1404,4238],[1405,4238],[1408,4239],[1409,4227],[1410,4227],[1421,4224],[1422,4226],[1423,4224],[1424,4226],[1428,4183],[1429,4227],[1430,4183],[1431,4228],[1432,4224],[1436,4222],[1437,4222],[1438,4222],[1439,4222],[1440,4222],[1441,4222],[1442,4222],[1443,4244],[1444,4234],[1445,4234],[1446,4234],[1447,4234],[1448,4234],[1449,4235],[1450,4235],[1451,4235],[1452,4224],[1453,4225],[1454,4231],[1455,4226],[1456,4226],[1457,4226],[1458,4226],[1459,4233],[1460,4183],[1461,4183],[1462,4183],[1463,4183],[1464,4236],[1465,4237],[1466,4221],[1467,4224],[1468,4224],[1469,4223],[1470,4228],[1471,4228],[1472,4228],[1473,4238],[1474,4238],[1475,4227],[1478,4239],[1479,4227],[1480,4227],[1498,4222],[1499,4244],[1500,4234],[1501,4234],[1502,4234],[1503,4234],[1504,4235],[1505,4235],[1506,4236],[1507,4221],[1508,4227],[1516,4227],[1526,4224],[1527,4226],[1528,4222],[1529,4222],[1530,4222],[1531,4222],[1532,4222],[1533,4222],[1534,4222],[1535,4244],[1536,4234],[1537,4234],[1538,4234],[1539,4234],[1540,4234],[1541,4235],[1542,4235],[1543,4235],[1544,4224],[1545,4225],[1546,4231],[1547,4226],[1548,4226],[1549,4226],[1550,4226],[1551,4233],[1552,4183],[1553,4183],[1554,4183],[1555,4183],[1556,4236],[1557,4237],[1558,4221],[1559,4224],[1560,4224],[1561,4223],[1562,4228],[1563,4228],[1564,4228],[1565,4238],[1566,4238],[1567,4227],[1570,4239],[1571,4227],[1572,4227],[1590,4222],[1591,4222],[1592,4222],[1593,4222],[1594,4222],[1595,4222],[1596,4222],[1597,4244],[1598,4234],[1599,4234],[1600,4234],[1601,4234],[1602,4234],[1603,4235],[1604,4235],[1605,4235],[1606,4224],[1607,4225],[1608,4231],[1609,4226],[1610,4226],[1611,4226],[1612,4226],[1613,4233],[1614,4183],[1615,4183],[1616,4183],[1617,4183],[1618,4236],[1619,4237],[1620,4221],[1621,4224],[1622,4224],[1623,4223],[1624,4228],[1625,4228],[1626,4228],[1627,4238],[1628,4238],[1629,4227],[1632,4239],[1633,4227],[1634,4227],[1653,4229],[1655,4231],[1656,4226],[1657,4233],[1658,4227],[1665,4233],[1667,4222],[1668,4234],[1669,4234],[1670,4234],[1671,4234],[1672,4235],[1673,4235],[1674,4225],[1675,4226],[1676,4226],[1677,4226],[1678,4226],[1679,4233],[1680,4183],[1681,4183],[1682,4183],[1683,4183],[1684,4236],[1685,4237],[1686,4221],[1687,4224],[1688,4224],[1689,4223],[1690,4238],[1691,4238],[1694,4239],[1695,4227],[1696,4227],[1702,4229],[1703,4222],[1704,4234],[1705,4234],[1706,4234],[1707,4234],[1708,4235],[1709,4235],[1710,4225],[1711,4226],[1712,4226],[1713,4226],[1714,4226],[1715,4233],[1716,4183],[1717,4183],[1718,4183],[1719,4183],[1720,4236],[1721,4237],[1722,4221],[1723,4224],[1724,4224],[1725,4223],[1726,4238],[1727,4238],[1730,4239],[1731,4227],[1732,4227],[1738,4222],[1739,4234],[1740,4234],[1741,4234],[1742,4234],[1743,4235],[1744,4235],[1745,4225],[1746,4226],[1747,4226],[1748,4226],[1749,4226],[1750,4233],[1751,4183],[1752,4183],[1753,4183],[1754,4183],[1755,4236],[1756,4237],[1757,4221],[1758,4224],[1759,4224],[1760,4223],[1761,4238],[1762,4238],[1765,4239],[1766,4227],[1767,4227],[1777,4225],[1778,4239],[1779,4227],[1780,4227],[1782,4225],[1783,4239],[1784,4227],[1785,4227],[1786,4222],[1787,4222],[1788,4222],[1789,4222],[1790,4222],[1791,4222],[1792,4222],[1793,4244],[1794,4234],[1795,4234],[1796,4234],[1797,4234],[1798,4234],[1799,4235],[1800,4235],[1801,4235],[1802,4224],[1803,4225],[1804,4231],[1805,4226],[1806,4226],[1807,4226],[1808,4226],[1809,4233],[1810,4183],[1811,4183],[1812,4183],[1813,4183],[1814,4236],[1815,4237],[1816,4221],[1817,4224],[1818,4224],[1819,4223],[1820,4228],[1821,4228],[1822,4228],[1823,4238],[1824,4238],[1825,4227],[1828,4239],[1829,4227],[1830,4227],[1848,4222],[1849,4222],[1850,4222],[1851,4222],[1852,4222],[1853,4222],[1854,4222],[1855,4244],[1856,4234],[1857,4234],[1858,4234],[1859,4234],[1860,4234],[1861,4235],[1862,4235],[1863,4235],[1864,4224],[1865,4225],[1866,4231],[1867,4226],[1868,4226],[1869,4226],[1870,4226],[1871,4233],[1872,4183],[1873,4183],[1874,4183],[1875,4183],[1876,4236],[1877,4237],[1878,4221],[1879,4224],[1880,4224],[1881,4223],[1882,4228],[1883,4228],[1884,4228],[1885,4238],[1886,4238],[1887,4227],[1890,4239],[1891,4227],[1892,4227],[1910,4222],[1911,4222],[1912,4222],[1913,4222],[1914,4222],[1915,4222],[1916,4222],[1917,4244],[1918,4234],[1919,4234],[1920,4234],[1921,4234],[1922,4234],[1923,4235],[1924,4235],[1925,4235],[1926,4224],[1927,4225],[1928,4231],[1929,4226],[1930,4226],[1931,4226],[1932,4226],[1933,4233],[1934,4183],[1935,4183],[1936,4183],[1937,4183],[1938,4236],[1939,4237],[1940,4221],[1941,4224],[1942,4224],[1943,4223],[1944,4228],[1945,4228],[1946,4228],[1947,4238],[1948,4238],[1949,4227],[1952,4239],[1953,4227],[1954,4227],[1972,4224],[1973,4226],[1976,4183],[1979,4226],[1981,4226],[1982,4223],[1983,4224],[1984,4226],[1985,4226],[1986,4226],[1987,4226],[1988,4224],[1989,4224],[1991,4226],[1992,4225],[1994,4239],[1995,4224],[1996,4225],[1997,4226],[1998,4226],[1999,4226],[2000,4226],[2001,4233],[2002,4183],[2003,4236],[2004,4224],[2005,4224],[2010,4222],[2011,4222],[2012,4222],[2013,4222],[2014,4222],[2015,4222],[2016,4222],[2017,4244],[2018,4234],[2019,4234],[2020,4234],[2021,4234],[2022,4234],[2023,4235],[2024,4235],[2025,4235],[2026,4224],[2027,4225],[2028,4231],[2029,4226],[2030,4226],[2031,4226],[2032,4226],[2033,4233],[2034,4183],[2035,4183],[2036,4183],[2037,4183],[2038,4236],[2039,4237],[2040,4221],[2041,4224],[2042,4224],[2043,4223],[2044,4228],[2045,4228],[2046,4228],[2047,4238],[2048,4238],[2049,4227],[2052,4239],[2053,4227],[2054,4227],[2072,4222],[2073,4222],[2074,4222],[2075,4222],[2076,4222],[2077,4222],[2078,4222],[2079,4244],[2080,4234],[2081,4234],[2082,4234],[2083,4234],[2084,4234],[2085,4235],[2086,4235],[2087,4235],[2088,4224],[2089,4225],[2090,4231],[2091,4226],[2092,4226],[2093,4226],[2094,4226],[2095,4233],[2096,4183],[2097,4183],[2098,4183],[2099,4183],[2100,4236],[2101,4237],[2102,4221],[2103,4224],[2104,4224],[2105,4223],[2106,4228],[2107,4228],[2108,4228],[2109,4238],[2110,4238],[2111,4227],[2114,4239],[2115,4227],[2116,4227],[2134,4227],[2141,4183],[2142,4183],[2143,4183],[2144,4183],[2145,4237],[2146,4239],[2156,4222],[2157,4222],[2158,4222],[2159,4222],[2160,4222],[2161,4222],[2162,4222],[2163,4244],[2164,4234],[2165,4234],[2166,4234],[2167,4234],[2168,4234],[2169,4234],[2170,4235],[2171,4235],[2172,4235],[2173,4235],[2174,4224],[2175,4225],[2176,4231],[2177,4226],[2178,4226],[2179,4226],[2180,4226],[2181,4233],[2182,4183],[2183,4183],[2184,4183],[2185,4183],[2186,4236],[2187,4237],[2188,4221],[2189,4224],[2190,4224],[2191,4223],[2192,4228],[2193,4228],[2194,4228],[2195,4238],[2196,4238],[2197,4227],[2200,4239],[2201,4227],[2202,4227],[2220,4224],[2221,4225],[2223,4239],[2224,4222],[2225,4234],[2226,4234],[2227,4234],[2228,4234],[2229,4235],[2230,4235],[2231,4225],[2232,4231],[2233,4233],[2234,4183],[2235,4183],[2236,4183],[2237,4183],[2238,4236],[2239,4237],[2240,4221],[2241,4228],[2242,4238],[2243,4238],[2246,4239],[2247,4227],[2248,4227],[2251,4222],[2252,4222],[2253,4222],[2254,4222],[2255,4234],[2256,4234],[2257,4234],[2258,4234],[2259,4234],[2260,4234],[2261,4234],[2262,4234],[2263,4234],[2264,4234],[2265,4234],[2266,4234],[2267,4234],[2268,4234],[2269,4234],[2270,4234],[2271,4235],[2272,4235],[2273,4235],[2274,4235],[2275,4235],[2276,4235],[2277,4235],[2278,4235],[2279,4225],[2280,4225],[2281,4225],[2282,4225],[2283,4231],[2284,4231],[2285,4231],[2286,4231],[2287,4233],[2288,4233],[2289,4233],[2290,4233],[2291,4183],[2292,4183],[2293,4183],[2294,4183],[2295,4183],[2296,4183],[2297,4183],[2298,4183],[2299,4183],[2300,4183],[2301,4183],[2302,4183],[2303,4183],[2304,4183],[2305,4183],[2306,4183],[2307,4236],[2308,4236],[2309,4236],[2310,4236],[2311,4237],[2312,4237],[2313,4237],[2314,4237],[2315,4221],[2316,4221],[2317,4221],[2318,4221],[2319,4228],[2320,4228],[2321,4228],[2322,4228],[2323,4238],[2324,4238],[2325,4238],[2326,4238],[2327,4238],[2328,4238],[2329,4238],[2330,4238],[2339,4239],[2340,4239],[2341,4239],[2342,4239],[2343,4227],[2344,4227],[2345,4227],[2346,4227],[2347,4227],[2348,4227],[2349,4227],[2350,4227],[2359,4238],[2360,4238],[2362,4235],[2363,4222],[2364,4222],[2365,4222],[2366,4244],[2367,4244],[2368,4234],[2369,4234],[2370,4234],[2371,4234],[2372,4234],[2373,4234],[2374,4234],[2375,4234],[2376,4234],[2377,4235],[2378,4235],[2379,4235],[2380,4235],[2381,4235],[2382,4224],[2383,4225],[2384,4225],[2385,4231],[2386,4226],[2387,4226],[2388,4226],[2389,4226],[2390,4233],[2391,4183],[2392,4183],[2393,4183],[2394,4183],[2395,4183],[2396,4183],[2397,4236],[2398,4236],[2399,4237],[2400,4237],[2401,4221],[2402,4221],[2403,4224],[2404,4224],[2405,4223],[2406,4228],[2407,4228],[2408,4228],[2409,4238],[2410,4238],[2411,4238],[2412,4238],[2413,4227],[2414,4227],[2419,4239],[2420,4239],[2421,4227],[2422,4227],[2423,4227],[2449,4226],[2450,4226],[2451,4238],[2452,4222],[2453,4222],[2454,4222],[2455,4222],[2456,4222],[2457,4222],[2458,4222],[2459,4222],[2460,4244],[2461,4234],[2462,4234],[2463,4234],[2464,4234],[2465,4234],[2466,4234],[2467,4234],[2468,4234],[2469,4234],[2470,4234],[2471,4234],[2472,4235],[2473,4235],[2474,4235],[2475,4235],[2476,4235],[2477,4235],[2478,4235],[2479,4224],[2480,4225],[2481,4225],[2482,4225],[2483,4225],[2484,4225],[2485,4225],[2486,4231],[2487,4226],[2488,4226],[2489,4226],[2490,4226],[2491,4233],[2492,4183],[2493,4183],[2494,4183],[2495,4183],[2496,4236],[2497,4237],[2498,4221],[2499,4221],[2500,4221],[2501,4224],[2502,4224],[2503,4223],[2504,4228],[2505,4228],[2506,4228],[2507,4228],[2508,4238],[2509,4238],[2510,4238],[2511,4227],[2517,4239],[2518,4239],[2519,4227],[2520,4227],[2543,4222],[2544,4234],[2545,4234],[2546,4234],[2547,4234],[2548,4235],[2549,4235],[2550,4225],[2551,4226],[2552,4226],[2553,4226],[2554,4226],[2555,4233],[2556,4183],[2557,4183],[2558,4183],[2559,4183],[2560,4236],[2561,4237],[2562,4221],[2563,4224],[2564,4224],[2565,4223],[2566,4238],[2567,4238],[2570,4239],[2571,4227],[2572,4227],[2578,4225],[2579,4225],[2580,4225],[2583,4226],[2584,4183],[2585,4225],[2586,4237],[2587,4239],[2588,4227],[2589,4227],[2591,4234],[2592,4235],[2594,4226],[2595,4222],[2596,4244],[2597,4234],[2598,4234],[2599,4234],[2600,4234],[2601,4235],[2602,4235],[2603,4236],[2604,4221],[2605,4227],[2613,4223],[2614,4223],[2615,4239],[2616,4222],[2617,4222],[2618,4222],[2619,4222],[2620,4222],[2621,4222],[2622,4222],[2623,4244],[2624,4234],[2625,4234],[2626,4234],[2627,4234],[2628,4234],[2629,4235],[2630,4235],[2631,4235],[2632,4224],[2633,4225],[2634,4231],[2635,4226],[2636,4226],[2637,4226],[2638,4226],[2639,4233],[2640,4183],[2641,4183],[2642,4183],[2643,4183],[2644,4236],[2645,4237],[2646,4221],[2647,4224],[2648,4224],[2649,4223],[2650,4228],[2651,4228],[2652,4228],[2653,4238],[2654,4238],[2655,4227],[2658,4239],[2659,4227],[2660,4227],[2679,4224],[2680,4224],[2681,4229],[2682,4239],[2684,4224],[2685,4222],[2686,4222],[2687,4222],[2688,4222],[2689,4222],[2690,4222],[2691,4222],[2692,4244],[2693,4234],[2694,4234],[2695,4234],[2696,4234],[2697,4234],[2698,4235],[2699,4235],[2700,4235],[2701,4224],[2702,4225],[2703,4231],[2704,4226],[2705,4226],[2706,4226],[2707,4226],[2708,4233],[2709,4183],[2710,4183],[2711,4183],[2712,4183],[2713,4236],[2714,4237],[2715,4221],[2716,4224],[2717,4224],[2718,4223],[2719,4228],[2720,4228],[2721,4228],[2722,4238],[2723,4238],[2724,4227],[2727,4239],[2728,4227],[2729,4227],[2748,4229],[2749,4222],[2750,4222],[2751,4222],[2752,4222],[2753,4222],[2759,4244],[2760,4225],[2761,4226],[2762,4234],[2763,4222],[2765,4224],[2768,4183],[2769,4183],[2770,4183],[2771,4183],[2772,4183],[2773,4183],[2774,4183],[2776,4226],[2777,4226],[2778,4226],[2779,4224],[2780,4224],[2781,4224],[2782,4226],[2784,4224],[2785,4223],[2786,4226],[2787,4226],[2788,4226],[2791,4223],[2792,4224],[2793,4224],[2794,4224],[2796,4222],[2797,4223],[2798,4239],[2800,4226],[2801,4226],[2804,4183],[2805,4226],[2806,4231],[2807,4229],[2808,4229],[2809,4229],[2810,4229],[2811,4229],[2812,4228],[2815,4222],[2816,4222],[2817,4222],[2818,4222],[2819,4222],[2820,4222],[2821,4222],[2822,4244],[2823,4234],[2824,4234],[2825,4234],[2826,4234],[2827,4234],[2828,4235],[2829,4235],[2830,4235],[2831,4224],[2832,4225],[2833,4231],[2834,4226],[2835,4226],[2836,4226],[2837,4226],[2838,4233],[2839,4183],[2840,4183],[2841,4183],[2842,4183],[2843,4236],[2844,4237],[2845,4221],[2846,4224],[2847,4224],[2848,4223],[2849,4228],[2850,4228],[2851,4228],[2852,4238],[2853,4238],[2854,4227],[2857,4239],[2858,4227],[2859,4227],[2877,4224],[2878,4225],[2879,4239],[2880,4227],[2881,4227],[2882,4226],[2883,4226],[2884,4226],[2887,4224],[2888,4226],[2889,4222],[2890,4222],[2891,4222],[2892,4222],[2893,4222],[2898,4235],[2899,4234],[2900,4234],[2901,4235],[2902,4235],[2903,4235],[2904,4223],[2905,4223],[2906,4235],[2909,4234],[2910,4234],[2911,4234],[2913,4234],[2914,4234],[2915,4238],[2916,4238],[2918,4224],[2919,4224],[2920,4234],[2924,4183],[2930,4224],[2931,4235],[2932,4226],[2933,4226],[2936,4223],[2938,4226],[2939,4225],[2940,4228],[2944,4224],[2945,4224],[2946,4224],[2947,4226],[2948,4226],[2949,4183],[2950,4183],[2951,4183],[2952,4183],[2953,4237],[2957,4235],[2960,4222],[2961,4234],[2962,4234],[2963,4234],[2964,4234],[2965,4235],[2966,4235],[2967,4221],[2968,4227],[2975,4183],[2976,4183],[2980,4234],[2981,4226],[2982,4235],[2983,4226],[2984,4226],[2985,4224],[2986,4226],[2987,4226],[2988,4223],[2989,4224],[2990,4222],[2991,4234],[2992,4234],[2993,4234],[2994,4234],[2995,4235],[2996,4235],[2997,4225],[2998,4226],[2999,4226],[3000,4226],[3001,4226],[3002,4233],[3003,4183],[3004,4183],[3005,4183],[3006,4183],[3007,4236],[3008,4237],[3009,4221],[3010,4224],[3011,4224],[3012,4223],[3013,4238],[3014,4238],[3017,4239],[3018,4227],[3019,4227],[3025,4222],[3026,4244],[3027,4234],[3028,4234],[3029,4234],[3030,4234],[3031,4235],[3032,4235],[3033,4225],[3034,4183],[3035,4183],[3036,4236],[3037,4237],[3038,4221],[3039,4238],[3040,4238],[3041,4227],[3044,4239],[3045,4227],[3052,4223],[3053,4223],[3054,4223],[3056,4222],[3057,4222],[3058,4222],[3059,4222],[3060,4222],[3061,4222],[3062,4222],[3063,4244],[3064,4234],[3065,4234],[3066,4234],[3067,4234],[3068,4234],[3069,4235],[3070,4235],[3071,4235],[3072,4224],[3073,4225],[3074,4225],[3075,4225],[3076,4225],[3077,4231],[3078,4226],[3079,4226],[3080,4226],[3081,4226],[3082,4233],[3083,4183],[3084,4183],[3085,4183],[3086,4183],[3087,4236],[3088,4237],[3089,4221],[3090,4224],[3091,4224],[3092,4223],[3093,4228],[3094,4228],[3095,4228],[3096,4238],[3097,4238],[3098,4227],[3101,4239],[3102,4227],[3103,4227],[3121,4222],[3122,4222],[3123,4222],[3124,4222],[3125,4222],[3126,4222],[3127,4222],[3128,4244],[3129,4234],[3130,4234],[3131,4234],[3132,4234],[3133,4234],[3134,4235],[3135,4235],[3136,4235],[3137,4224],[3138,4225],[3139,4231],[3140,4226],[3141,4226],[3142,4226],[3143,4226],[3144,4233],[3145,4183],[3146,4183],[3147,4183],[3148,4183],[3149,4236],[3150,4237],[3151,4221],[3152,4224],[3153,4224],[3154,4223],[3155,4228],[3156,4228],[3157,4228],[3158,4238],[3159,4238],[3160,4227],[3163,4239],[3164,4227],[3165,4227],[3183,4222],[3184,4222],[3185,4222],[3186,4222],[3187,4222],[3190,4222],[3191,4244],[3192,4234],[3193,4234],[3194,4234],[3195,4234],[3196,4235],[3197,4235],[3198,4225],[3199,4183],[3200,4183],[3201,4236],[3202,4237],[3203,4221],[3204,4238],[3205,4238],[3206,4227],[3209,4239],[3210,4227],[3217,4227],[3218,4222],[3219,4222],[3220,4222],[3221,4222],[3222,4222],[3223,4222],[3224,4222],[3225,4244],[3226,4234],[3227,4234],[3228,4234],[3229,4234],[3230,4234],[3231,4235],[3232,4235],[3233,4235],[3234,4224],[3235,4225],[3236,4231],[3237,4226],[3238,4226],[3239,4226],[3240,4226],[3241,4233],[3242,4183],[3243,4183],[3244,4183],[3245,4183],[3246,4236],[3247,4237],[3248,4221],[3249,4224],[3250,4224],[3251,4223],[3252,4228],[3253,4228],[3254,4228],[3255,4238],[3256,4238],[3257,4227],[3260,4239],[3261,4227],[3262,4227],[3280,4226],[3281,4226],[3282,4224],[3284,4223],[3285,4223],[3286,4222],[3287,4222],[3288,4222],[3289,4222],[3290,4222],[3291,4222],[3292,4222],[3293,4244],[3294,4234],[3295,4234],[3296,4234],[3297,4234],[3298,4234],[3299,4235],[3300,4235],[3301,4235],[3302,4224],[3303,4225],[3304,4231],[3305,4226],[3306,4226],[3307,4226],[3308,4226],[3309,4233],[3310,4183],[3311,4183],[3312,4183],[3313,4183],[3314,4236],[3315,4237],[3316,4221],[3317,4224],[3318,4224],[3319,4223],[3320,4228],[3321,4228],[3322,4228],[3323,4238],[3324,4238],[3325,4227],[3328,4239],[3329,4227],[3330,4227],[3348,4229],[3350,4223],[3351,4223],[3353,4235],[3354,4235],[3355,4235],[3356,4235],[3357,4235],[3589,4261],[3590,4265],[3591,4260],[3592,4261],[3593,4261],[3594,4261],[3595,4263],[3596,4262],[3597,4262],[3598,4261],[3599,4262],[3600,4262],[3601,4263],[3602,4260],[3603,4265],[3604,4261],[3605,4262],[3606,4262],[3607,4263],[3608,4260],[3609,4265],[3610,4260],[3611,4265],[3612,4261],[3613,4262],[3614,4262],[3615,4263],[3616,4260],[3617,4265],[3618,4261],[3619,4262],[3620,4262],[3621,4263],[3622,4260],[3623,4262],[3624,4263],[3625,4261],[3626,4262],[3627,4262],[3628,4263],[3629,4260],[3630,4261],[3631,4262],[3632,4262],[3633,4263],[3634,4260],[3635,4261],[3636,4262],[3637,4262],[3638,4263],[3639,4260],[3640,4261],[3641,4261],[3642,4265],[3643,4261],[3644,4262],[3645,4262],[3646,4263],[3647,4260],[3648,4265],[3649,4261],[3650,4262],[3651,4262],[3652,4263],[3653,4260],[3654,4265],[3655,4261],[3656,4262],[3657,4262],[3658,4263],[3659,4260],[3660,4265],[3661,4262],[3662,4262],[3663,4260],[3664,4265],[3665,4261],[3666,4262],[3667,4262],[3668,4263],[3669,4260],[3670,4265],[3671,4261],[3672,4262],[3673,4262],[3674,4263],[3675,4260],[3676,4265],[3677,4262],[3678,4262],[3679,4260],[3680,4265],[3681,4261],[3682,4262],[3683,4262],[3684,4263],[3685,4260],[3686,4263],[3687,4261],[3688,4262],[3689,4262],[3690,4261],[3691,4261],[3692,4261],[3693,4261],[3694,4262],[3695,4262],[3696,4262],[3697,4262],[3698,4262],[3699,4262],[3700,4262],[3701,4262],[3702,4265],[3703,4265],[3704,4265],[3705,4261],[3706,4261],[3707,4262],[3708,4262],[3709,4262],[3710,4263],[3711,4260],[3712,4265],[3713,4261],[3714,4262],[3715,4262],[3716,4263],[3717,4260],[3718,4261],[3719,4262],[3720,4262],[3721,4263],[3722,4260],[3723,4262],[3724,4262],[3725,4262],[3726,4260],[3727,4265],[3728,4261],[3729,4262],[3730,4262],[3731,4263],[3732,4260],[3733,4260],[3734,4265],[3735,4261],[3736,4262],[3737,4262],[3738,4263],[3739,4260],[3740,4263],[3741,4263],[3742,4262],[3743,4262],[3744,4262],[3745,4262],[3746,4265],[3747,4265],[3748,4261],[3749,4262],[3750,4262],[3751,4263],[3752,4260],[3753,4261],[3754,4262],[3755,4260],[3756,4262],[3757,4265],[3758,4265],[3759,4265],[3760,4262],[3761,4262],[3762,4261],[3763,4262],[3764,4262],[3765,4263],[3766,4260],[3767,4261],[3768,4262],[3769,4265],[3770,4261],[3771,4262],[3772,4262],[3773,4263],[3774,4260],[3775,4265],[3776,4261],[3777,4262],[3778,4262],[3779,4263],[3780,4260],[3781,4261],[3782,4262],[3783,4265],[3784,4261],[3785,4262],[3786,4262],[3787,4263],[3788,4260],[3789,4262],[3790,4262],[3791,4265],[3792,4261],[3793,4262],[3794,4262],[3795,4263],[3796,4260],[3797,4181],[3798,4181],[3799,4181],[3800,4181],[3801,4181],[3802,4181],[3803,4181],[3804,4181],[3805,4181],[3806,4181],[3807,4181],[3808,4181],[3809,4181],[3810,4181],[3811,4181],[3812,4181],[3813,4181],[3814,4181],[3815,4181],[3816,4181],[3817,4181],[3818,4181],[3819,4181],[3820,4181],[3821,4181],[3822,4181],[3823,4181],[3824,4181],[3825,4181],[3826,4181],[3827,4181],[3828,4181],[3829,4181],[3830,4181],[3831,4181],[3832,4181],[3833,4181],[3834,4181],[3835,4181],[3836,4181],[3837,4181],[3838,4181],[3839,4181],[3840,4181],[3841,4181],[3842,4181],[3843,4181],[3844,4181],[3845,4181],[3846,4181],[3847,4181],[3848,4181],[3849,4181],[3850,4181],[3851,4181],[3852,4181],[3853,4181],[3854,4181],[3855,4181],[3856,4181],[3857,4181],[3858,4181],[3859,4181],[3860,4181],[3861,4181],[3862,4181],[3863,4181],[3864,4181],[3865,4181],[3866,4181],[3867,4181],[3868,4181],[3869,4181],[3870,4181],[3871,4181],[3872,4181],[3873,4181],[3874,4181],[3875,4181],[3876,4181],[3877,4181],[3878,4181],[3879,4181],[3880,4181],[3881,4181],[3882,4181],[3883,4181],[3884,4181],[3885,4181],[3886,4181],[3887,4181],[3888,4181],[3889,4181],[3890,4181],[3891,4181],[3892,4181],[3893,4181],[3894,4181],[3895,4181],[3896,4181],[3897,4181],[3898,4181],[3899,4181],[3900,4181],[3901,4181],[3902,4181],[3903,4181],[3904,4181],[3905,4181],[3906,4181],[3907,4181],[3908,4181],[3909,4181],[3910,4181],[3911,4181],[3912,4181],[3913,4181],[3914,4181],[3915,4181],[3916,4181],[3917,4181],[3918,4181],[3919,4181],[3920,4181],[3921,4181],[3922,4181],[3923,4181],[3924,4181],[3925,4181],[3926,4181],[3927,4181],[3928,4181],[3929,4181],[3930,4181],[3931,4181],[3932,4181],[3933,4181],[4112,4271],[4114,4271],[4116,4271],[4118,4271],[4120,4271],[4122,4271],[4124,4271],[4126,4271],[4128,4271],[4129,4271],[4130,4271],[4132,4271],[4134,4271],[4136,4271],[4138,4271],[4140,4271],[4141,4271],[4142,4271],[4143,4271],[4145,4271],[4146,4271],[4147,4271],[4150,4271],[4152,4271],[4154,4271],[4156,4271],[4158,4271]],"b":[[172,"impl-Debug-for-PublicKey"],[173,"impl-Display-for-PublicKey"],[174,"impl-Debug-for-KeyParsingError"],[175,"impl-Display-for-KeyParsingError"],[178,"impl-Debug-for-RelayUrl"],[179,"impl-Display-for-RelayUrl"],[180,"impl-Debug-for-RelayUrlParseError"],[181,"impl-Display-for-RelayUrlParseError"],[182,"impl-Debug-for-RelayMap"],[183,"impl-Display-for-RelayMap"],[184,"impl-Debug-for-RelayNode"],[185,"impl-Display-for-RelayNode"],[189,"impl-From%3CDecodeError%3E-for-KeyParsingError"],[191,"impl-From%3CError%3E-for-KeyParsingError"],[192,"impl-From%3C%5Bu8;+32%5D%3E-for-SecretKey"],[194,"impl-From%3CSigningKey%3E-for-SecretKey"],[195,"impl-From%3CPublicKey%3E-for-NodeAddr"],[197,"impl-From%3CNodeInfo%3E-for-NodeAddr"],[198,"impl-From%3C(PublicKey,+Option%3CRelayUrl%3E,+%26%5BSocketAddr%5D)%3E-for-NodeAddr"],[199,"impl-From%3CNodeTicket%3E-for-NodeAddr"],[200,"impl-From%3CRemoteInfo%3E-for-NodeAddr"],[204,"impl-From%3CRelayUrl%3E-for-RelayMap"],[206,"impl-From%3CRelayNode%3E-for-RelayMap"],[211,"impl-FromIterator%3CRelayNode%3E-for-RelayMap"],[212,"impl-FromIterator%3CRelayUrl%3E-for-RelayMap"],[306,"impl-TryFrom%3C%26%5Bu8;+32%5D%3E-for-PublicKey"],[307,"impl-TryFrom%3C%26%5Bu8%5D%3E-for-PublicKey"],[582,"impl-Display-for-UserData"],[583,"impl-Debug-for-UserData"],[585,"impl-Debug-for-ParseError"],[586,"impl-Display-for-ParseError"],[588,"impl-Debug-for-IntoDiscoveryError"],[589,"impl-Display-for-IntoDiscoveryError"],[590,"impl-Debug-for-DiscoveryError"],[591,"impl-Display-for-DiscoveryError"],[595,"impl-Debug-for-Lagged"],[596,"impl-Display-for-Lagged"],[600,"impl-From%3C%26TxtAttrs%3CIrohAttr%3E%3E-for-NodeInfo"],[602,"impl-From%3CDiscoveryItem%3E-for-NodeInfo"],[603,"impl-From%3CTxtAttrs%3CIrohAttr%3E%3E-for-NodeInfo"],[604,"impl-From%3CNodeAddr%3E-for-NodeInfo"],[994,"impl-Display-for-PkarrError"],[995,"impl-Debug-for-PkarrError"],[2364,"impl-Display-for-SendDatagramError"],[2365,"impl-Debug-for-SendDatagramError"],[2366,"impl-Debug-for-RetryError"],[2367,"impl-Display-for-RetryError"],[2369,"impl-Debug-for-ReadToEndError"],[2370,"impl-Display-for-ReadToEndError"],[2371,"impl-Debug-for-ReadError"],[2372,"impl-Display-for-ReadError"],[2373,"impl-Debug-for-ResetError"],[2374,"impl-Display-for-ResetError"],[2375,"impl-Display-for-ReadExactError"],[2376,"impl-Debug-for-ReadExactError"],[2378,"impl-Debug-for-WriteError"],[2379,"impl-Display-for-WriteError"],[2380,"impl-Display-for-StoppedError"],[2381,"impl-Debug-for-StoppedError"],[2383,"impl-Debug-for-VarInt"],[2384,"impl-Display-for-VarInt"],[2391,"impl-Display-for-ControlMsg"],[2392,"impl-Debug-for-ControlMsg"],[2395,"impl-Debug-for-ConnectionType"],[2396,"impl-Display-for-ConnectionType"],[2397,"impl-Display-for-ClosedStream"],[2398,"impl-Debug-for-ClosedStream"],[2399,"impl-Display-for-Source"],[2400,"impl-Debug-for-Source"],[2401,"impl-Display-for-ConnectionError"],[2402,"impl-Debug-for-ConnectionError"],[2409,"impl-Debug-for-ConnectionClose"],[2410,"impl-Display-for-ConnectionClose"],[2411,"impl-Debug-for-ApplicationClose"],[2412,"impl-Display-for-ApplicationClose"],[2413,"impl-Display-for-AddNodeAddrError"],[2414,"impl-Debug-for-AddNodeAddrError"],[2415,"impl-Debug-for-TransportError"],[2416,"impl-Display-for-TransportError"],[2417,"impl-Debug-for-TransportErrorCode"],[2418,"impl-Display-for-TransportErrorCode"],[2419,"impl-Debug-for-StreamId"],[2420,"impl-Display-for-StreamId"],[2422,"impl-Debug-for-DirectAddrType"],[2423,"impl-Display-for-DirectAddrType"],[2427,"impl-Display-for-ConnectWithOptsError"],[2428,"impl-Debug-for-ConnectWithOptsError"],[2429,"impl-Debug-for-ConnectError"],[2430,"impl-Display-for-ConnectError"],[2431,"impl-Display-for-BindError"],[2432,"impl-Debug-for-BindError"],[2433,"impl-Display-for-GetMappingAddressError"],[2434,"impl-Debug-for-GetMappingAddressError"],[2440,"impl-Display-for-AlpnError"],[2441,"impl-Debug-for-AlpnError"],[2444,"impl-Display-for-RemoteNodeIdError"],[2445,"impl-Debug-for-RemoteNodeIdError"],[2464,"impl-From%3CConnectionError%3E-for-ReadError"],[2465,"impl-From%3CResetError%3E-for-ReadError"],[2466,"impl-From%3CReadableError%3E-for-ReadError"],[2473,"impl-From%3CStoppedError%3E-for-WriteError"],[2474,"impl-From%3CConnectionError%3E-for-WriteError"],[2476,"impl-From%3CClosedStream%3E-for-WriteError"],[2481,"impl-From%3Cu32%3E-for-VarInt"],[2482,"impl-From%3Cu16%3E-for-VarInt"],[2483,"impl-From%3Cu8%3E-for-VarInt"],[2484,"impl-From%3CFrameType%3E-for-VarInt"],[2485,"impl-From%3CStreamId%3E-for-VarInt"],[2499,"impl-From%3CTransportError%3E-for-ConnectionError"],[2500,"impl-From%3CClose%3E-for-ConnectionError"],[2512,"impl-From%3CTransportErrorCode%3E-for-TransportError"],[2513,"impl-From%3CInvalidFrame%3E-for-TransportError"],[2515,"impl-From%3CError%3E-for-TransportError"],[2526,"impl-From%3CConnectWithOptsError%3E-for-ConnectError"],[2527,"impl-From%3CConnectionError%3E-for-ConnectError"],[2899,"impl-AsyncRead-for-RecvStream"],[2900,"impl-RecvStream"],[2902,"impl-SendStream"],[2903,"impl-AsyncWrite-for-SendStream"],[3073,"impl-TryFrom%3Cu128%3E-for-VarInt"],[3074,"impl-TryFrom%3Cu64%3E-for-VarInt"],[3076,"impl-TryFrom%3Cusize%3E-for-VarInt"],[3705,"impl-Debug-for-Probe"],[3706,"impl-Display-for-Probe"],[3707,"impl-Debug-for-Report"],[3708,"impl-Display-for-Report"],[3874,"impl-Display-for-EncodingError"],[3875,"impl-Debug-for-EncodingError"],[3876,"impl-Display-for-DecodingError"],[3877,"impl-Debug-for-DecodingError"],[3878,"impl-Display-for-MaxLengthExceededError"],[3879,"impl-Debug-for-MaxLengthExceededError"],[3880,"impl-Display-for-LookupError"],[3881,"impl-Debug-for-LookupError"],[4044,"impl-Debug-for-AcceptError"],[4045,"impl-Display-for-AcceptError"],[4049,"impl-From%3CBox%3Cdyn+Error+%2B+Send+%2B+Sync%3E%3E-for-AcceptError"],[4050,"impl-From%3CRemoteNodeIdError%3E-for-AcceptError"],[4052,"impl-From%3CClosedStream%3E-for-AcceptError"],[4053,"impl-From%3CError%3E-for-AcceptError"],[4054,"impl-From%3CConnectionError%3E-for-AcceptError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAFcM8wADAAAACwAAABIADQAhAEkAbQAYAIoABwCUACYAvAAAAL4AAADAAAEAwwABAMYAAQDJAAAAywAAAM8AAQDUAAAA1wAJAOQADAAGAQsAGgEEACABAQAmAR8ATAEHAFgBBwBiAQcAfAEAAH4BAACKAQEAjgEFAJUBBQCdAS0AzA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CAPcPCgADEAwAEhAPACQQAwAqEAEAMRABADgQBwA=","P":[[23,"B,E,P,T"],[31,""],[37,"T"],[38,""],[39,"T"],[54,""],[62,"T"],[68,""],[78,"K"],[82,"T"],[106,""],[109,"T"],[114,""],[115,"T"],[126,""],[128,"D"],[130,"__D"],[133,""],[152,"K"],[172,""],[188,"T"],[189,""],[190,"T"],[191,""],[193,"T"],[194,""],[196,"T"],[197,""],[201,"T"],[202,""],[203,"T"],[204,""],[205,"T"],[206,""],[208,"T"],[209,""],[211,"T"],[213,""],[214,"T"],[220,""],[224,"R"],[225,"Watcher::Value"],[226,""],[227,"H"],[228,"__H"],[230,""],[240,"Watcher::Value,T,W"],[241,"U"],[249,"Watcher::Value"],[250,""],[253,"Watcher::Value,T,"],[256,""],[260,"Watcher::Value,W"],[261,"B,E,P,T"],[269,""],[273,"Watcher::Value"],[275,""],[281,"S"],[283,"__S"],[286,""],[289,"Watcher::Value"],[292,""],[293,"T"],[299,""],[308,"U,T"],[311,""],[312,"U,T"],[317,"U"],[325,""],[339,"Watcher::Value"],[340,""],[343,"V"],[351,""],[352,""],[410,""],[412,"B,E,P,T"],[423,""],[432,"T"],[454,""],[464,"T"],[469,""],[475,"K"],[476,"T"],[509,""],[512,"T"],[514,""],[515,"T"],[522,"Deref::Target"],[523,"T"],[527,""],[528,"T"],[537,""],[561,"K"],[581,""],[597,"T"],[598,""],[599,"T"],[600,""],[601,"T"],[602,""],[605,"T"],[606,""],[607,"T"],[609,""],[610,"T"],[618,""],[622,"T"],[627,""],[630,"__H"],[631,""],[646,"U"],[657,""],[670,"B,E,P,T"],[681,""],[701,"T"],[706,""],[713,"U,T"],[714,""],[715,"U,T"],[725,"U"],[736,""],[755,"V"],[766,""],[807,"B,E,P,T"],[809,"T"],[813,""],[815,"T"],[825,""],[830,"T"],[832,""],[834,"U"],[836,""],[839,"B,E,P,T"],[841,""],[842,"U,T"],[844,"U"],[846,""],[848,"V"],[852,""],[854,"B,E,P,T"],[856,"T"],[860,""],[862,"T"],[868,""],[869,"T"],[873,""],[877,"T"],[879,""],[881,"U"],[883,""],[887,"B,E,P,T"],[889,""],[892,"U,T"],[894,"U"],[896,""],[898,"V"],[900,""],[920,"B,E,P,T"],[926,""],[928,"T"],[940,""],[948,"T"],[951,""],[954,"T"],[984,""],[1001,"T"],[1010,""],[1017,"U"],[1023,""],[1030,"B,E,P,T"],[1036,""],[1042,"T"],[1045,""],[1046,"U,T"],[1052,"U"],[1058,""],[1067,"V"],[1073,""],[1084,"B,E,P,T"],[1086,"T"],[1090,""],[1094,"T"],[1095,""],[1096,"T"],[1102,""],[1104,"T"],[1108,""],[1113,"T"],[1116,""],[1119,"U"],[1121,""],[1125,"B,E,P,T"],[1127,""],[1132,"T"],[1133,"U,T"],[1135,"U"],[1137,""],[1140,"V"],[1144,""],[1145,""],[1146,"B,E,P,T"],[1147,"T"],[1149,""],[1150,"T"],[1151,""],[1152,"T"],[1155,""],[1156,"T"],[1158,""],[1160,"T"],[1161,","],[1162,"T"],[1163,""],[1165,"U"],[1166,""],[1168,"B,E,P,T"],[1169,""],[1172,""],[1173,"T"],[1174,"U,T"],[1175,"U"],[1176,""],[1177,"V"],[1179,""],[1182,"B,E,P,T"],[1183,"T"],[1185,""],[1187,"T"],[1188,""],[1189,"T"],[1192,""],[1193,"T"],[1195,""],[1197,"T"],[1198,""],[1199,"T"],[1200,""],[1201,"U"],[1202,"T"],[1204,""],[1206,"T"],[1207,""],[1208,""],[1212,"T"],[1213,""],[1214,"B,E,P,T"],[1215,""],[1218,"T"],[1219,"U,T"],[1220,"U"],[1221,""],[1222,"V"],[1223,""],[1425,""],[1426,""],[1436,"B,E,P,T"],[1498,""],[1528,"T"],[1652,""],[1703,"T"],[1738,""],[1782,"K"],[1786,"T"],[1972,""],[1977,""],[1979,""],[1992,"B"],[1995,""],[2010,"T"],[2134,""],[2141,"__D"],[2146,""],[2148,""],[2149,""],[2221,"B"],[2224,""],[2251,"K"],[2359,""],[2452,"T"],[2458,""],[2459,"T"],[2462,""],[2463,"T"],[2464,""],[2467,"T"],[2468,""],[2469,"T"],[2470,""],[2471,"T"],[2473,""],[2475,"T"],[2476,""],[2478,"T"],[2481,""],[2486,"T"],[2499,""],[2501,"T"],[2505,""],[2506,"T"],[2508,""],[2509,"T"],[2512,""],[2514,"T"],[2515,""],[2516,"T"],[2517,""],[2518,"T"],[2525,""],[2528,"T"],[2529,""],[2530,"T"],[2538,""],[2539,"T"],[2578,""],[2585,"__H"],[2590,""],[2685,"U"],[2747,""],[2755,"IntoFuture::IntoFuture"],[2756,""],[2815,"B,E,P,T"],[2877,""],[2894,"Future::Output"],[2898,""],[2939,""],[2940,""],[2949,"__S"],[2954,""],[2990,"T"],[3025,""],[3056,"U,T"],[3073,""],[3075,"U,T"],[3076,""],[3077,"U,T"],[3121,"U"],[3183,"F"],[3190,""],[3286,"V"],[3348,""],[3419,"B,E,P,T"],[3423,""],[3426,"T"],[3434,""],[3438,"T"],[3439,""],[3440,"T"],[3452,""],[3459,"T"],[3467,"__D"],[3470,""],[3489,"T"],[3494,""],[3501,"U"],[3505,""],[3520,"B,E,P,T"],[3524,""],[3562,"__S"],[3565,"T"],[3566,"U,T"],[3570,"U"],[3574,""],[3585,"V"],[3598,""],[3603,"B,E,P,T"],[3609,""],[3611,"T"],[3623,""],[3630,"T"],[3635,""],[3641,"K"],[3642,"T"],[3660,""],[3664,"T"],[3676,"__D"],[3679,""],[3690,"K"],[3702,""],[3712,"T"],[3723,""],[3734,"U"],[3740,""],[3747,"B,E,P,T"],[3753,""],[3759,"__S"],[3762,"T"],[3767,""],[3769,"U,T"],[3775,"U"],[3781,""],[3791,"V"],[3802,""],[3821,"B,E,P,T"],[3825,""],[3833,"T"],[3841,""],[3845,"T"],[3857,""],[3858,"T"],[3866,""],[3883,"T"],[3887,""],[3896,"U"],[3900,""],[3901,"B,E,P,T"],[3905,""],[3914,"U,T"],[3918,"U"],[3922,""],[3930,"V"],[3934,""],[3990,","],[3991,"P"],[3992,""],[3993,"B,E,P,T"],[3997,""],[3999,"T"],[4007,""],[4010,"P"],[4011,"T"],[4013,""],[4015,"T"],[4035,""],[4046,"P"],[4047,"T"],[4049,""],[4051,"T"],[4052,""],[4055,"T"],[4059,""],[4064,"U"],[4068,""],[4070,"P,F"],[4071,""],[4073,"P"],[4074,""],[4075,"B,E,P,T"],[4079,""],[4083,"P"],[4084,""],[4086,"T"],[4088,""],[4089,"U,T"],[4093,"U"],[4097,""],[4102,"V"],[4106,""],[4113,"B,E,P,T"],[4115,"T"],[4129,""],[4135,"T"],[4137,""],[4139,"U"],[4141,""],[4144,"B,E,P,T"],[4146,""],[4151,"U,T"],[4153,"U"],[4155,""],[4157,"V"]]}],["iroh_base",{"t":"TPPPGTFIFFFFFINNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNONNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOPTPFGPKPNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNMNNNNNNNNNNNNOOOOOOOOOOOO","n":["BYTE_SIZE","Decode","DecodeInvalidLength","Key","KeyParsingError","LENGTH","NodeAddr","NodeId","PublicKey","RelayUrl","RelayUrlParseError","SecretKey","Signature","SignatureError","algorithm_identifier","as_bytes","as_error_source","","as_ref","backtrace","","borrow","","","","","","","","borrow_mut","","","","","","","cause","","clone","","","","","clone_into","","","","","clone_to_uninit","","","","","cmp","","","deref","","description","","deserialize","","","","","direct_addresses","","eq","","","","fmt","","","","","","","","","","","","","","fmt_short","from","","","","","","","","","","","","","","","","","","","from_bytes","","","from_components","from_parts","from_slice","from_str","","","","generate","hash","","","in_current_span","","into","","","","","","","is_empty","new","node_id","partial_cmp","","","public","","r_bytes","relay_url","","s_bytes","secret","serialize","","","","","sign","source","","ticket","to_bitstring","to_bytes","","","to_owned","","","","","to_string","","","","","to_vec","try_from","","","","","","","","","","","try_into","","","","","","","type_id","","","","","","","verify","with_direct_addresses","with_relay_url","backtrace","","","source","","span_trace","","","Encoding","KIND","Kind","NodeTicket","ParseError","Postcard","Ticket","Verify","as_error_source","backtrace","borrow","","borrow_mut","","cause","clone","clone_into","clone_to_uninit","description","deserialize","","eq","fmt","","","","from","","","","","from_bytes","","from_str","in_current_span","into","","new","node_addr","serialize","","source","to_bytes","","to_owned","to_string","","try_from","","try_into","","type_id","","verification_failed","wrong_prefix","backtrace","","","","expected","message","source","","span_trace","","",""],"q":[[0,"iroh_base"],[193,"iroh_base::KeyParsingError"],[201,"iroh_base::ticket"],[256,"iroh_base::ticket::ParseError"],[268,"der::asn1::any::allocating"],[269,"spki::algorithm"],[270,"spki::error"],[271,"core::result"],[272,"iroh_base::key"],[273,"core::error"],[274,"backtrace::capture"],[275,"core::option"],[276,"iroh_base::relay_url"],[277,"ed25519"],[278,"iroh_base::node_addr"],[279,"core::cmp"],[280,"serde_core::de"],[281,"core::net::socket_addr"],[282,"core::iter::traits::iterator"],[283,"alloc::collections::btree::set"],[284,"core::fmt"],[285,"ed25519_dalek::signature"],[286,"ed25519_dalek::verifying"],[287,"ed25519_dalek::errors"],[288,"data_encoding"],[289,"ed25519_dalek::signing"],[290,"iroh_base::ticket::node"],[291,"url"],[292,"core::iter::traits::collect"],[293,"signature::error"],[294,"rand_core"],[295,"core::hash"],[296,"serde_core::ser"],[297,"der::asn1::bit_string::allocating"],[298,"der::error"],[299,"alloc::string"],[300,"alloc::vec"],[301,"core::any"],[302,"n0_snafu::spantrace"],[303,"postcard::error"]],"i":"B`Af00`l````````201Al1203112BbBdBf3645210353642106421064210410405364210116410666644552100334666644555222111100364261664202410536452103111410426116264210253`6662642106450366644452210364521036452103411FhFjFl21210G`Gb1``1`111Dn20220002100002200222100202001021000202020222GfGhGjGl30213210","f":"``````````````{b{{j{{f{d}}h}}}}{{{b{l}}}{{b{{A`{n}}}}}}{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j}{FlAj}{FhDh}{FjDf}{FhFn}{FjFn}{FlFn}````````{b{{b{Ab}}}}{{{b{G`}}}{{Aj{{b{Ah}}}}}}{b{{b{c}}}{}}0{{{b{An}}}{{b{Anc}}}{}}0{{{b{G`}}}{{Aj{{b{Ab}}}}}}{{{b{Dn}}}Dn}{{b{b{Anc}}}Bh{}}{{bn}Bh}{{{b{G`}}}{{b{Bl}}}}{{{b{Bl}}}{{j{GbG`}}}}{c{{j{Dn}}}Bn}{{{b{Dn}}{b{Dn}}}Ch}{{{b{Dn}}{b{AnCj}}}Cn}0{{{b{G`}}{b{AnCj}}}Cn}0{BdDn}{cc{}}{DhG`}1{GdG`}{{{b{{Ad{n}}}}}{{j{GbG`}}}}{{{b{{Ad{n}}}}}{{j{DnG`}}}}{{{b{Bl}}}{{j{Dnc}}}{}}{{}}{{}c{}}08{{{b{Dn}}}{{b{Bd}}}}{{{b{Gb}}}Fb}{{{b{Dn}}c}jEl}{{{b{G`}}}{{Aj{{b{Ab}}}}}}{{{b{Gb}}}{{Fd{n}}}}{{{b{Dn}}}{{Fd{n}}}}{bc{}}{bFb}0{c{{j{e}}}{}{}}0{{}{{j{c}}}{}}0{bFf}0{{{b{Bl}}}G`}0{GfAj}{GhAj}{GjAj}{GlAj}{Gfb}{Glb}{GhGd}{GjDh}{GfFn}{GhFn}{GjFn}{GlFn}","D":"Jb","p":[[1,"reference",null,null,1],[5,"Any",268],[5,"AlgorithmIdentifier",269],[6,"Error",270],[6,"Result",271,null,1],[5,"PublicKey",0,272],[1,"u8"],[1,"array"],[10,"Error",273],[1,"slice"],[6,"KeyParsingError",0,272],[5,"Backtrace",274],[6,"Option",275,null,1],[5,"RelayUrlParseError",0,276],[0,"mut"],[5,"Signature",0,277],[5,"SecretKey",0,272],[5,"NodeAddr",0,278],[5,"RelayUrl",0,276],[1,"unit"],[6,"Ordering",279],[1,"str"],[10,"Deserializer",280],[17,"Item"],[6,"SocketAddr",281],[10,"Iterator",282],[5,"BTreeSet",283],[1,"bool"],[5,"Formatter",284],[5,"Error",284],[8,"Result",284],[10,"Display",284],[5,"InternalSignature",285],[5,"VerifyingKey",286],[8,"SignatureError",0,287],[5,"DecodeError",288],[5,"SigningKey",289],[1,"tuple",null,null,1],[5,"NodeTicket",201,290],[8,"NodeId",0,272],[5,"Url",291],[10,"IntoIterator",292],[5,"Error",293],[10,"CryptoRng",294],[10,"Hasher",295],[10,"Serializer",296],[5,"BitString",297],[5,"Error",298],[5,"String",299],[5,"Vec",300],[5,"TypeId",301],[15,"Decode",193],[15,"Key",193],[15,"DecodeInvalidLength",193],[5,"SpanTrace",302],[6,"ParseError",201],[10,"Ticket",201],[6,"Error",303],[15,"Kind",256],[15,"Postcard",256],[15,"Encoding",256],[15,"Verify",256]],"r":[[0,277],[1,272],[2,272],[3,272],[4,272],[5,272],[6,278],[7,272],[8,272],[9,276],[10,276],[11,272],[12,277],[13,287],[14,277],[15,272],[16,272],[17,276],[18,272],[19,272],[20,276],[21,277],[22,272],[23,272],[24,272],[25,272],[26,278],[27,276],[28,276],[29,277],[30,272],[31,272],[32,272],[33,278],[34,276],[35,276],[36,272],[37,276],[38,277],[39,272],[40,272],[41,278],[42,276],[43,277],[44,272],[45,272],[46,278],[47,276],[48,277],[49,272],[50,272],[51,278],[52,276],[53,272],[54,278],[55,276],[56,272],[57,276],[58,272],[59,276],[60,277],[61,272],[62,272],[63,278],[64,276],[65,278],[66,278],[67,277],[68,272],[69,278],[70,276],[71,277],[72,277],[73,277],[74,277],[75,272],[76,272],[77,272],[78,272],[79,272],[80,278],[81,276],[82,276],[83,276],[84,276],[85,272],[86,277],[87,277],[88,277],[89,277],[90,272],[91,272],[92,272],[93,272],[94,272],[95,272],[96,272],[97,272],[98,278],[99,278],[100,278],[101,278],[102,276],[103,276],[104,276],[105,277],[106,272],[107,272],[108,277],[109,278],[110,277],[111,277],[112,272],[113,272],[114,276],[115,272],[116,272],[117,278],[118,276],[119,272],[120,276],[121,277],[122,272],[123,272],[124,272],[125,278],[126,276],[127,276],[128,278],[129,278],[130,278],[131,272],[132,278],[133,276],[134,272],[135,272],[136,277],[137,278],[138,278],[139,277],[140,272],[141,277],[142,272],[143,272],[144,278],[145,276],[146,272],[147,272],[148,276],[150,277],[151,277],[152,277],[153,272],[154,277],[155,272],[156,272],[157,278],[158,276],[159,277],[160,272],[161,272],[162,276],[163,276],[164,277],[165,277],[166,277],[167,272],[168,272],[169,272],[170,272],[171,272],[172,272],[173,278],[174,276],[175,276],[176,277],[177,272],[178,272],[179,272],[180,278],[181,276],[182,276],[183,277],[184,272],[185,272],[186,272],[187,278],[188,276],[189,276],[190,272],[191,278],[192,278],[204,290],[211,290],[213,290],[216,290],[217,290],[218,290],[221,290],[222,290],[223,290],[224,290],[227,290],[228,290],[233,290],[234,290],[236,290],[238,290],[239,290],[241,290],[244,290],[245,290],[246,290],[248,290],[250,290],[252,290]],"b":[[71,"impl-UpperHex-for-Signature"],[72,"impl-Debug-for-Signature"],[73,"impl-Display-for-Signature"],[74,"impl-LowerHex-for-Signature"],[75,"impl-Display-for-PublicKey"],[76,"impl-Debug-for-PublicKey"],[77,"impl-Debug-for-KeyParsingError"],[78,"impl-Display-for-KeyParsingError"],[81,"impl-Debug-for-RelayUrl"],[82,"impl-Display-for-RelayUrl"],[83,"impl-Display-for-RelayUrlParseError"],[84,"impl-Debug-for-RelayUrlParseError"],[86,"impl-From%3C%26%5Bu8;+ed25519::::SignatureBytes::%7Bconstant%230%7D%5D%3E-for-Signature"],[87,"impl-From%3C%5Bu8;+ed25519::::SignatureBytes::%7Bconstant%230%7D%5D%3E-for-Signature"],[88,"impl-From%3CInternalSignature%3E-for-Signature"],[93,"impl-From%3CError%3E-for-KeyParsingError"],[94,"impl-From%3CDecodeError%3E-for-KeyParsingError"],[95,"impl-From%3C%5Bu8;+32%5D%3E-for-SecretKey"],[97,"impl-From%3CSigningKey%3E-for-SecretKey"],[98,"impl-From%3C(PublicKey,+Option%3CRelayUrl%3E,+%26%5BSocketAddr%5D)%3E-for-NodeAddr"],[99,"impl-From%3CNodeTicket%3E-for-NodeAddr"],[100,"impl-From%3CPublicKey%3E-for-NodeAddr"],[151,"impl-Signature"],[152,"impl-SignatureEncoding-for-Signature"],[168,"impl-TryFrom%3C%26%5Bu8%5D%3E-for-PublicKey"],[169,"impl-TryFrom%3C%26%5Bu8;+32%5D%3E-for-PublicKey"],[223,"impl-Debug-for-NodeTicket"],[224,"impl-Display-for-NodeTicket"],[225,"impl-Debug-for-ParseError"],[226,"impl-Display-for-ParseError"],[229,"impl-From%3CDecodeError%3E-for-ParseError"],[231,"impl-From%3CError%3E-for-ParseError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAALsAHAAPAAAAEQAwAEQAEQBXAAIAWwAAAF4AAgBiAAEAZQAAAGcAAABwAAMAdQAEAIQAAgCOAAQAlAABAJcAAACZAAAAmwAJAKYAGADCAAcA0gAKAN4ABQDmAAAA6AAAAOoAAgDyAAEA9QAJAAEBAwAGAQYA","P":[[21,"T"],[22,""],[23,"T"],[36,""],[43,"T"],[48,""],[56,"Deref::Target"],[58,""],[60,"D"],[63,"__D"],[65,""],[89,"T"],[90,""],[91,"T"],[93,""],[96,"T"],[97,""],[101,"T"],[102,""],[103,"T"],[105,""],[109,""],[110,""],[112,"FromStr::Err"],[115,"R"],[116,"H"],[117,"__H"],[119,""],[121,"U"],[128,""],[141,"S"],[144,"__S"],[146,""],[154,"T"],[159,""],[165,"U,T"],[166,""],[167,"U,T"],[168,"TryFrom::Error"],[170,"U,T"],[171,"TryFrom::Error"],[172,"U,T"],[176,"U"],[183,""],[191,""],[192,""],[211,"T"],[215,""],[217,"T"],[218,""],[221,"D"],[222,""],[228,"T"],[229,""],[230,"T"],[231,""],[234,"FromStr::Err"],[235,""],[236,"U"],[238,""],[241,"S"],[242,""],[245,"T"],[246,""],[248,"U,T"],[250,"U"],[252,""]]}],["iroh_bench",{"t":"FGGGPPPFPPPPNNNNNNNNNNNNNNNNNNNNNHONNNNNNNNNNNNNNNNNNNNNNNNNNNHNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNONNNNNCOOONNNNNNCOHCCNOONNNNNNNNNNNNNNNNNNNNNONNNNNSHHHHHHSHHHHHHFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFFNNNONNNNNNOOOONNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNONOOOHOOONNNNNNOONNNNNN","n":["ClientStats","Commands","ConnectionSelector","EndpointSelector","Iroh","","","Opt","Quinn","","","S2n","__clone_box","","and","","","","","augment_args","augment_args_for_update","augment_subcommands","augment_subcommands_for_update","borrow","","","","","borrow_mut","","","","","client_handler","clients","clone","","clone_into","","clone_to_uninit","","close","","command","","command_for_update","","compat","","","","","compat_mut","","","","","compat_ref","","","","","configure_tracing_subscriber","default","deref","","","","","deref_mut","","","","","download_size","drop","","","","","fmt","","from","","","","","from_arg_matches","","from_arg_matches_mut","","from_ref","","group_id","has_subcommand","init","","","","","initial_mtu","into","","","","","iroh","max_streams","metrics","only_relay","or","","","","","print","quinn","read_unordered","rt","s2n","stats","","","streams","to_owned","","try_from","","","","","try_into","","","","","type_id","","","","","update_from_arg_matches","","update_from_arg_matches_mut","","upload_size","vzip","","","","","ALPN","client","connect_client","handle_client_stream","server","server_endpoint","transport_config","ALPN","client","connect_client","handle_client_stream","server","server_endpoint","transport_config","Opt","__clone_box","and","augment_args","augment_args_for_update","borrow","borrow_mut","clone","clone_into","clone_to_uninit","command","command_for_update","compat","compat_mut","compat_ref","deref","deref_mut","drop","fmt","from","from_arg_matches","from_arg_matches_mut","from_ref","group_id","init","into","or","to_owned","try_from","try_into","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","Stats","StreamStats","TransferResult","and","","","avg_chunk_size","borrow","","","borrow_mut","","","chunk_size","chunk_time","chunks","","compat","","","compat_mut","","","compat_ref","","","default","","deref","","","deref_mut","","","drop","","","duration","duration_hist","fmt","","","from","","","init","","","into","","","new","or","","","print","size","stream_finished","stream_stats","streams","throughput","throughput_bps","throughput_hist","total_duration","total_size","try_from","","","try_into","","","ttfb","ttfb_hist","type_id","","","vzip","",""],"q":[[0,"iroh_bench"],[151,"iroh_bench::iroh"],[158,"iroh_bench::quinn"],[165,"iroh_bench::s2n"],[199,"iroh_bench::stats"],[278,"dyn_clone::sealed"],[279,"tower_http::follow_redirect::policy::and"],[280,"tower_http::follow_redirect::policy"],[281,"clap_builder::builder::command"],[282,"n0_snafu::error"],[283,"async_compat"],[284,"core::fmt"],[285,"clap_builder::parser::matches::arg_matches"],[286,"clap_builder"],[287,"core::result"],[288,"clap_builder::util::id"],[289,"core::option"],[290,"tower_http::follow_redirect::policy::or"],[291,"tokio::runtime::runtime"],[292,"core::any"],[293,"iroh_base::node_addr"],[294,"iroh_base::relay_url"],[295,"iroh::endpoint"],[296,"iroh_quinn_proto::config::transport"],[297,"core::net::socket_addr"],[298,"rustls_pki_types"],[299,"iroh_quinn::endpoint"],[300,"iroh_quinn::connection"],[301,"hdrhistogram"],[302,"core::time"]],"i":"````A`AbAl`21000Ad3210Af11224321043210`1212121432121432104321043210`0432104321014321021432102121211243210143210`111432100`1```311214321043210432102121143210```````````````Ej00000000000000000000000000000000```F`ElDl0210210111021021021021210210210012102102102100210202220`12221021001210210","f":"````````````{{bd}f}0{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}0000{ll}000{b{{b{c}}}{}}0000{{{b{n}}}{{b{nc}}}{}}0000{{A`AbAd}{{Ah{Af}}}}{AdAj}{{{b{Al}}}Al}{{{b{Ad}}}Ad}{{b{b{nc}}}f{}}0{{bAn}f}0{A`f}{{{b{Ab}}B`{b{{Bb{An}}}}}f}{{}l}000{{}{{Bd{c}}}{}}0000{{{b{n}}}{{Bd{{b{nc}}}}}{}}0000{b{{Bd{{b{c}}}}}{}}0000{{}f}{{}Af}{Aj{{b{c}}}{}}0000{Aj{{b{nc}}}{}}0000{AdBf}{Ajf}0000{{{b{Al}}{b{nBh}}}Bj}{{{b{Ad}}{b{nBh}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}}{b{nBh}}}Bj}{cc{}}{{{b{Bl}}}{{C`{EjBn}}}}{{{b{nBl}}}{{C`{EjBn}}}}{{{b{c}}}c{}}{{}{{Cd{Cb}}}}{{}Aj}{{}c{}}{g{{Cl{ig}}}{}{}{{j{ce}}}{{j{ce}}}}{bc{}}{c{{C`{e}}}{}{}}{{}{{C`{c}}}{}}{bD`}{{{b{nEj}}{b{Bl}}}{{C`{fBn}}}}{{{b{nEj}}{b{nBl}}}{{C`{fBn}}}}{{}c{}}```{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}00{DlBf}{b{{b{c}}}{}}00{{{b{n}}}{{b{nc}}}{}}00{ElEn}0{ElBf}4{{}{{Bd{c}}}{}}00{{{b{n}}}{{Bd{{b{nc}}}}}{}}00{b{{Bd{{b{c}}}}}{}}00{{}F`}{{}El}{Aj{{b{c}}}{}}00{Aj{{b{nc}}}{}}00{Ajf}00{DlFb}:{{{b{F`}}{b{nBh}}}Bj}{{{b{El}}{b{nBh}}}Bj}{{{b{Dl}}{b{nBh}}}Bj}{cc{}}00{{}Aj}00{{}c{}}00{{FbBfFbBf}Dl}{g{{Cl{ig}}}{}{}{{j{ce}}}{{j{ce}}}}00{{{b{F`}}{b{Cf}}}f}{DlBf}{{{b{nF`}}Dl}f}{F`El}{F`Aj}{DlFd}{{FbBf}Fd}{ElEn}{F`Fb}{F`Bf}{c{{C`{e}}}{}{}}00{{}{{C`{c}}}{}}00{DlFb}5{bD`}00{{}c{}}00","D":"Dj","p":[[1,"reference",null,null,1],[5,"Private",278],[1,"unit"],[5,"And",279],[10,"Policy",280],[5,"Command",281],[0,"mut"],[6,"EndpointSelector",0],[6,"ConnectionSelector",0],[5,"Opt",0],[5,"ClientStats",0],[8,"Result",282],[1,"usize"],[6,"Commands",0],[1,"u8"],[1,"u32"],[1,"slice"],[5,"Compat",283],[1,"u64"],[5,"Formatter",284],[8,"Result",284],[5,"ArgMatches",285],[8,"Error",286],[6,"Result",287,null,1],[5,"Id",288],[6,"Option",289,null,1],[1,"str"],[1,"bool"],[1,"u16"],[5,"Or",290],[5,"Runtime",291],[5,"TypeId",292],[5,"NodeAddr",293],[5,"RelayUrl",294],[5,"Endpoint",295],[5,"Connection",295],[1,"tuple",null,null,1],[5,"TransferResult",199],[5,"TransportConfig",296],[6,"SocketAddr",297],[5,"CertificateDer",298],[5,"Endpoint",299],[5,"Connection",300],[6,"PrivateKeyDer",298],[5,"Opt",165],[5,"StreamStats",199],[5,"Histogram",301],[5,"Stats",199],[5,"Duration",302],[1,"f64"]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAPEAEQAAACEAJAAmAEwABgBYAAwAawAAAG8ABgB3AAMAfQAUAJMABQCbAAAAngABAKIAAAClABMAugAEAMAAMQD1AAIA+wAbAA==","P":[[14,"B,E,P,T"],[19,""],[23,"T"],[33,""],[37,"T"],[39,""],[47,"T"],[62,""],[64,"T"],[74,""],[82,"T"],[87,""],[91,"T"],[93,""],[101,"U"],[107,""],[110,"B,E,P,T"],[115,""],[124,"T"],[126,"U,T"],[131,"U"],[136,""],[146,"V"],[151,""],[167,"B,E,P,T"],[168,""],[170,"T"],[172,""],[173,"T"],[174,""],[177,"T"],[182,""],[184,"T"],[185,""],[187,"T"],[188,""],[190,"U"],[191,"B,E,P,T"],[192,"T"],[193,"U,T"],[194,"U"],[195,""],[198,"V"],[202,"B,E,P,T"],[205,""],[206,"T"],[212,""],[216,"T"],[225,""],[227,"T"],[233,""],[241,"T"],[244,""],[247,"U"],[250,""],[251,"B,E,P,T"],[254,""],[264,"U,T"],[267,"U"],[270,""],[275,"V"]]}],["iroh_dns_server",{"t":"FNNNNNNNNNNCCNNNNCNNNCNNNNCCNNNNNNGFPPFFFNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNOONNNNNNOONNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNOFFFFNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNOOOOONNNNNNNNNNNNNNNNNNNNNNNNGPFFFPPGPPPNNNNNNNNNOONNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFNNNNNNNNOOOOOONNNNOOOONNNOOOOOONNNNFNNNNNNNNNNHNNNNNNFNNNNNNNNNNONNNONONNNNN","n":["ZoneStore","__clone_box","and","borrow","borrow_mut","clone","clone_into","clone_to_uninit","compat","compat_mut","compat_ref","config","dns","fmt","from","from_ref","get_signed_packet","http","in_memory","insert","into","metrics","new","or","persistent","resolve","server","state","to_owned","try_from","try_into","type_id","vzip","with_mainline_fallback","BootstrapOption","Config","Custom","Default","MainlineConfig","MetricsConfig","StoreConfig","__clone_box","and","","","","","bind_addr","bootstrap","borrow","","","","","borrow_mut","","","","","clone","clone_into","clone_to_uninit","compat","","","","","compat_mut","","","","","compat_ref","","","","","data_dir","default","","","","deserialize","","","","","disabled","","dns","enabled","fmt","","","","","from","","","","","from_ref","http","https","into","","","","","load","mainline","metrics","or","","","","","pkarr_put_rate_limit","serialize","","","","","signed_packet_store_path","to_owned","try_from","","","","","try_into","","","","","type_id","","","","","vzip","","","","","zone_store","DnsConfig","DnsHandler","DnsServer","Handle","__clone_box","","","and","","","","answer_request","bind_addr","borrow","","","","borrow_mut","","","","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","compat_mut","","","","compat_ref","","","","default_soa","default_ttl","deserialize","fmt","","","from","","","","from_ref","","","handle_request","into","","","","local_addr","new","or","","","","origins","port","rr_a","rr_aaaa","rr_ns","run_until_done","send_response","serialize","shutdown","spawn","to_owned","","","try_from","","","","try_into","","","","type_id","","","","vzip","","","","CertMode","Disabled","HttpConfig","HttpServer","HttpsConfig","LetsEncrypt","Manual","RateLimitConfig","SelfSigned","Simple","Smart","__clone_box","","","","and","","","","","bind_addr","","borrow","","","","","borrow_mut","","","","","cert_mode","clone","","","","clone_into","","","","clone_to_uninit","","","","compat","","","","","compat_mut","","","","","compat_ref","","","","","default","","deserialize","","","","domains","eq","equivalent","","","","fmt","","","","","from","","","","","from_ref","","","","http_addr","https_addr","into","","","","","letsencrypt_contact","letsencrypt_prod","or","","","","","port","","run_until_done","serialize","","","","shutdown","spawn","to_owned","","","","to_string","try_from","","","","","try_into","","","","","try_to_string","type_id","","","","","vzip","","","","","Metrics","and","as_iterable","borrow","borrow_mut","compat","compat_mut","compat_ref","default","dns_lookup_error","dns_lookup_notfound","dns_lookup_success","dns_requests","dns_requests_https","dns_requests_udp","field_count","field_ref","fmt","from","http_requests","http_requests_duration_ms","http_requests_error","http_requests_success","into","name","or","pkarr_publish_noop","pkarr_publish_update","store_packets_expired","store_packets_inserted","store_packets_removed","store_packets_updated","try_from","try_into","type_id","vzip","Server","and","borrow","borrow_mut","compat","compat_mut","compat_ref","from","into","or","run_until_error","run_with_config_until_ctrl_c","shutdown","spawn","try_from","try_into","type_id","vzip","AppState","__clone_box","and","borrow","borrow_mut","clone","clone_into","clone_to_uninit","compat","compat_mut","compat_ref","dns_handler","from","from_ref","into","metrics","or","store","to_owned","try_from","try_into","type_id","vzip"],"q":[[0,"iroh_dns_server"],[34,"iroh_dns_server::config"],[146,"iroh_dns_server::dns"],[241,"iroh_dns_server::http"],[376,"iroh_dns_server::metrics"],[412,"iroh_dns_server::server"],[430,"iroh_dns_server::state"],[453,"dyn_clone::sealed"],[454,"tower_http::follow_redirect::policy::and"],[455,"tower_http::follow_redirect::policy"],[456,"iroh_dns_server::store"],[457,"async_compat"],[458,"core::fmt"],[459,"pkarr::signed_packet"],[460,"core::option"],[461,"n0_snafu::error"],[462,"alloc::sync"],[463,"tower_http::follow_redirect::policy::or"],[464,"std::path"],[465,"core::convert"],[466,"hickory_proto::rr::domain::name"],[467,"hickory_proto::rr::record_type"],[468,"hickory_proto::rr::rr_set"],[469,"core::result"],[470,"core::any"],[471,"serde_core::de"],[472,"iroh_dns_server::http::rate_limiting"],[473,"serde_core::ser"],[474,"hickory_server::server::request_handler"],[475,"bytes::bytes"],[476,"alloc::string"],[477,"core::future::future"],[478,"alloc::boxed"],[479,"core::pin"],[480,"hickory_server::server::response_handler"],[481,"core::net::socket_addr"],[482,"alloc::vec"],[483,"hickory_server::authority::message_response"],[484,"hickory_proto::rr::resource"],[485,"core::iter::traits::iterator"],[486,"core::marker"],[487,"iroh_dns_server::http::tls"],[488,"alloc::collections"],[489,"iroh_metrics::iterable"],[490,"iroh_metrics::metrics"],[491,"iroh_metrics::base"]],"i":"`n000000000``0000`000`0000``000000``Cd0```CjCn1CfCh4102310423104333231042310423104223042310411202310423104322231042222310422310423231042310423104231042````DbDhDnEl321230321032132132132103210321032133332103213212032102032133333013003210321032103210321`Dd```Gb0`01110FnG`Gf43212104321043211432143214321043210432104321444321133333433210432143210004321110432121043210043213043210432130432104321`An0000000000000000000000000000000000`Hf000000000`000000`Gh000000000000000000000","f":"`{{bd}f}{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}{b{{b{c}}}{}}{{{b{l}}}{{b{lc}}}{}}{{{b{n}}}n}{{b{b{lc}}}f{}}{{bA`}f}{{}{{Ab{c}}}{}}{{{b{l}}}{{Ab{{b{lc}}}}}{}}{b{{Ab{{b{c}}}}}{}}``{{{b{n}}{b{lAd}}}Af}{cc{}}{{{b{c}}}c{}}{{{b{n}}{b{`}}}{{Al{{Aj{Ah}}}}}}```{{}c{}}``{g{{Bd{ig}}}{}{}{{j{ce}}}{{j{ce}}}}`{{{b{n}}{b{`}}{b{Bj}}Bl}{{Al{{Aj{{B`{Bn}}}}}}}}``{bc{}}{c{{C`{e}}}{}{}}{{}{{C`{c}}}{}}{bCb}{{}c{}}{{nCd}n}```````{{bd}f}{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}0000{CfAj}{ChAj}{b{{b{c}}}{}}0000{{{b{l}}}{{b{lc}}}{}}0000{{{b{Cj}}}Cj}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}{{{b{Fn}}c}C`Df}{{{b{G`}}c}C`Df}4{{{Aj{Fn}}{Aj{G`}}DdGh}{{Al{Gf}}}}{bc{}}000{bE`}{c{{C`{e}}}{}{}}0000{{}{{C`{c}}}{}}0000{b{{C`{E`Gj}}}}{bCb}0000{{}c{}}0000`{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}{b{{b{Gl}}}}{b{{b{c}}}{}}{{{b{l}}}{{b{lc}}}{}}{{}{{Ab{c}}}{}}{{{b{l}}}{{Ab{{b{lc}}}}}{}}{b{{Ab{{b{c}}}}}{}}{{}An}{AnGn}00000{{{b{An}}}H`}{{{b{An}}H`}{{Aj{Hb}}}}{{{b{An}}{b{lAd}}}Af}{cc{}}4444{{}c{}}{{{b{An}}}{{b{Hd}}}}{g{{Bd{ig}}}{}{}{{j{ce}}}{{j{ce}}}}777777{c{{C`{e}}}{}{}}{{}{{C`{c}}}{}}{bCb}{{}c{}}`{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}{b{{b{c}}}{}}{{{b{l}}}{{b{lc}}}{}}{{}{{Ab{c}}}{}}{{{b{l}}}{{Ab{{b{lc}}}}}{}}{b{{Ab{{b{c}}}}}{}}=<:{Hf{{Al{f}}}}{Cn{{Al{f}}}}1{{Cnn{B`{An}}}{{Al{Hf}}}}<;:9`{{bd}f}987{{{b{Gh}}}Gh}{{b{b{lc}}}f{}}{{bA`}f}987{GhDh}{cc{}}{{{b{c}}}c{}}{{}c{}}{GhB`}{g{{Bd{ig}}}{}{}{{j{ce}}}{{j{ce}}}}{Ghn}{bc{}}{c{{C`{e}}}{}{}}{{}{{C`{c}}}{}}{bCb}{{}c{}}","D":"AAl","p":[[1,"reference",null,null,1],[5,"Private",453],[1,"unit"],[5,"And",454],[10,"Policy",455],[0,"mut"],[5,"ZoneStore",0,456],[1,"u8"],[5,"Compat",457],[5,"Formatter",458],[8,"Result",458],[5,"SignedPacket",459],[6,"Option",460,null,1],[8,"Result",461],[5,"Metrics",376],[5,"Arc",462,null,1],[1,"bool"],[5,"Or",463],[5,"Path",464],[10,"AsRef",465],[5,"Name",466],[6,"RecordType",467],[5,"RecordSet",468],[6,"Result",469,null,1],[5,"TypeId",470],[6,"BootstrapOption",34],[5,"MetricsConfig",34],[5,"MainlineConfig",34],[5,"StoreConfig",34],[5,"PathBuf",464],[5,"Config",34],[10,"Deserializer",471],[5,"DnsConfig",146],[6,"RateLimitConfig",241,472],[10,"Serializer",473],[5,"DnsHandler",146],[5,"Request",474],[5,"Bytes",475],[5,"Handle",146],[5,"String",476],[1,"u32"],[10,"Future",477,null,1],[5,"Box",478,null,1],[5,"Pin",479],[10,"ResponseHandler",480],[5,"DnsServer",146],[6,"SocketAddr",481],[5,"Vec",482],[1,"u16"],[5,"MessageResponse",483],[17,"Item"],[5,"Record",484],[10,"Iterator",485],[10,"Send",486],[5,"HttpConfig",241],[5,"HttpsConfig",241],[6,"CertMode",241,487],[5,"Error",458],[5,"HttpServer",241],[5,"AppState",430],[5,"TryReserveError",488],[10,"Iterable",489],[5,"Counter",490],[1,"usize"],[5,"MetricItem",491],[1,"str"],[5,"Server",412]],"r":[[0,456],[1,456],[2,456],[3,456],[4,456],[5,456],[6,456],[7,456],[8,456],[9,456],[10,456],[13,456],[14,456],[15,456],[16,456],[18,456],[19,456],[20,456],[22,456],[23,456],[24,456],[25,456],[28,456],[29,456],[30,456],[31,456],[32,456],[33,456],[241,487],[242,472],[246,487],[247,487],[248,472],[249,487],[250,472],[251,472],[252,472],[253,487],[257,472],[258,487],[264,472],[265,487],[269,472],[270,487],[274,472],[275,487],[278,472],[279,487],[282,472],[283,487],[287,472],[288,487],[292,472],[293,487],[297,472],[298,487],[301,472],[302,472],[303,472],[304,487],[308,487],[309,487],[310,487],[311,487],[312,487],[313,472],[314,487],[315,487],[319,472],[320,487],[323,472],[324,487],[330,472],[331,487],[337,472],[338,487],[344,472],[345,487],[350,472],[351,487],[354,487],[356,472],[357,487],[361,472],[362,487],[365,487],[367,472],[368,487],[372,472],[373,487]],"b":[[301,"impl-Default-for-%26RateLimitConfig"],[302,"impl-Default-for-RateLimitConfig"],[314,"impl-Debug-for-CertMode"],[315,"impl-Display-for-CertMode"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAADcBKAACAAkADgAAABAAAAAYAAAAHQAEACoABQAyABsATwAIAFwABABmAAAAcQAEAHcABAB9ABQAlwAGAKAAHAC/AAMAxwADANEAAwDbAAEA3wASAP0ACAAIAQkAEwEgADUBCQBEAQMAUQEEAFkBAwBfAQ4AbwEJAHoBBwCIAQIAkQEBAJkBAwCeAQUApgEAAKsBAwCwAQkAvAEAAL8BAADBAQQA","P":[[2,"B,E,P,T"],[3,"T"],[5,""],[6,"T"],[7,""],[8,"T"],[13,""],[14,"T"],[16,""],[20,"U"],[22,""],[23,"B,E,P,T"],[24,""],[25,""],[28,"T"],[29,"U,T"],[30,"U"],[31,""],[32,"V"],[33,""],[42,"B,E,P,T"],[47,""],[49,"T"],[59,""],[60,"T"],[61,""],[62,"T"],[77,""],[82,"__D"],[87,""],[96,"T"],[102,""],[104,"U"],[109,""],[110,""],[112,"B,E,P,T"],[117,""],[118,"__S"],[123,""],[124,"T"],[125,"U,T"],[130,"U"],[135,""],[140,"V"],[145,""],[153,"B,E,P,T"],[157,""],[159,"T"],[167,""],[170,"T"],[173,""],[176,"T"],[188,""],[190,"__D"],[191,""],[194,"T"],[201,"R"],[202,"U"],[206,""],[208,"B,E,P,T"],[212,""],[218,",,,"],[219,"__S"],[220,""],[222,"T"],[225,"U,T"],[229,"U"],[233,""],[237,"V"],[252,""],[256,"B,E,P,T"],[261,""],[263,"T"],[273,""],[278,"T"],[282,""],[286,"T"],[301,""],[303,"__D"],[307,""],[309,"K"],[313,""],[318,"T"],[327,""],[329,"U"],[334,""],[336,"B,E,P,T"],[341,""],[344,"__S"],[348,""],[350,"T"],[354,""],[355,"U,T"],[360,"U"],[365,""],[371,"V"],[377,"B,E,P,T"],[378,""],[379,"T"],[384,""],[394,"T"],[395,""],[399,"U"],[400,""],[401,"B,E,P,T"],[402,""],[408,"U,T"],[409,"U"],[410,""],[411,"V"],[413,"B,E,P,T"],[414,"T"],[420,"U"],[421,"B,E,P,T"],[422,""],[426,"U,T"],[427,"U"],[428,""],[429,"V"],[431,""],[432,"B,E,P,T"],[433,"T"],[435,""],[436,"T"],[437,""],[438,"T"],[441,""],[442,"T"],[444,"U"],[445,""],[446,"B,E,P,T"],[447,""],[448,"T"],[449,"U,T"],[450,"U"],[451,""],[452,"V"]]}],["iroh_relay",{"t":"EFFFFNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNCNNNNNNNNOCCONNCNNNNNNNNNNNNNNNNNNNNONNNNNFFFFGPGPPPPPPPPPPPPPPPPPGGPPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOSSSSSGFPPSSPPPFFPFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOSSSSPGPGPSPPPPPGPTFFKFPPGPPFPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN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OOOOOOOOOOOOOOOOOOOOOOHHHHH","n":["MAX_PACKET_SIZE","PingTracker","RelayMap","RelayNode","RelayQuicConfig","__clone_box","","","and","","","","borrow","","","","borrow_mut","","","","client","clone","","","clone_into","","","clone_to_uninit","","","cmp","","compare","","compat","","","","compat_mut","","","","compat_ref","","","","contains_node","default","","default_timeout","defaults","deref","","","","deref_mut","","","","deserialize","","dns","drop","","","","empty","eq","","","equivalent","","","","","","","","","","","","fmt","","","","","","from","","","","","","","from_iter","","get_node","http","init","","","","into","","","","is_empty","len","new","new_ping","node_info","nodes","or","","","","partial_cmp","","pong_received","port","protos","quic","","serialize","","server","timeout","to_owned","","","to_string","","try_from","","","","try_into","","","","try_to_string","","type_id","","","","url","urls","vzip","","","","Client","ClientBuilder","ClientSink","ClientStream","ConnectError","Dial","DialError","Dns","EmptyPacket","ExceedsMaxPacketSize","Handshake","InvalidRelayUrl","InvalidTargetPort","InvalidTlsServername","InvalidUrl","InvalidWebsocketUrl","Io","NoLocalAddr","Protocol","ProxyConnect","ProxyConnectInvalidStatus","ProxyInvalidTargetPort","ProxyInvalidTlsServername","ProxyInvalidUrl","RecvError","SendError","StreamError","","Timeout","Tls","UnexpectedUpgradeStatus","Upgrade","Websocket","__clone_box","address_family_selector","and","","","","","","","","as_error_source","","","","backtrace","","","","borrow","","","","","","","","borrow_mut","","","","","","","","cause","","","","clone","clone_into","clone_to_uninit","compat","","","","","","","","compat_mut","","","","","","","","compat_ref","","","","","","","","connect","deref","","","","","","","","deref_mut","","","","","","","","description","","","","drop","","","","","","","","fmt","","","","","","","","","","","","from","","","","","","","","","","","","","","","","","in_current_span","","","","init","","","","","","","","insecure_skip_cert_verify","into","","","","","","","","key_cache_capacity","local_addr","make_dangerous_client_config","new","or","","","","","","","","poll_close","","poll_flush","","poll_next","","poll_ready","","proxy_url","source","","","","split","start_send","","to_owned","to_string","","","","try_from","","","","","","","","try_into","","","","","","","","try_poll_next","","try_to_string","","","","type_id","","","","","","","","vzip","","","","","","","","backtrace","","","","","","","","","","code","source","","","","","span_trace","","","","","","","","","","url","","backtrace","","","","","","","","","","proxy_hostname","proxy_url","source","","","","span_trace","","","","","","","","","","status","url","backtrace","","source","","span_trace","","backtrace","","","size","source","span_trace","","","DEFAULT_HTTPS_PORT","DEFAULT_HTTP_PORT","DEFAULT_KEY_CACHE_CAPACITY","DEFAULT_METRICS_PORT","DEFAULT_RELAY_QUIC_PORT","DnsError","DnsResolver","InvalidResponse","MissingHost","N0_DNS_NODE_ORIGIN_PROD","N0_DNS_NODE_ORIGIN_STAGING","NoResponse","Resolve","ResolveBoth","StaggeredError","TXT","Timeout","TxtLookup","__clone_box","","","and","","","","","as_error_source","","backtrace","","borrow","","","","","borrow_mut","","","","","cause","","clear_cache","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","","compat_mut","","","","","compat_ref","","","","","default","deref","","","","","deref_mut","","","","","description","","drop","","","","","fmt","","","","","","","","from","","","","","","","","","in_current_span","","init","","","","","into","","","","","into_iter","lookup_ipv4","lookup_ipv4_ipv6","lookup_ipv4_ipv6_staggered","lookup_ipv4_staggered","lookup_ipv6","lookup_ipv6_staggered","lookup_node_by_domain_name","lookup_node_by_domain_name_staggered","lookup_node_by_id","lookup_node_by_id_staggered","lookup_txt","new","or","","","","","reset","resolve","resolve_host","source","","to_owned","","","to_string","","","try_from","","","","","try_into","","","","","try_to_string","","","txt_data","type_id","","","","","vzip","","","","","with_nameserver","backtrace","","","","","","ipv4","ipv6","source","","span_trace","","","","","","CLIENT_AUTH_HEADER","RELAY_PATH","RELAY_PROBE_PATH","RELAY_PROTOCOL_VERSION","AttrFromString","DecodingError","","EncodingError","FailedBuildingPacket","IROH_TXT_NAME","InvalidEncodingZ32","InvalidLabel","InvalidLength","InvalidSignature","InvalidTxtEntry","LookupError","LookupFailed","MAX_LENGTH","MaxLengthExceededError","NodeData","NodeIdExt","NodeInfo","NotAnIrohRecord","NumLabels","ParseError","","UnexpectedFormat","UserData","Utf8","__clone_box","","","add_direct_addresses","and","","","","","","","","as_error_source","","","","","as_ref","backtrace","","","","","borrow","","","","","","","","borrow_mut","","","","","","","","cause","","","","","clear_direct_addresses","clone","","","clone_into","","","clone_to_uninit","","","cmp","compare","compat","","","","","","","","compat_mut","","","","","","","","compat_ref","","","","","","","","data","default","deref","","","","","","","","","deref_mut","","","","","","","","","description","","","","","direct_addresses","drop","","","","","","","","eq","","","equivalent","","","","","","","","","","","","fmt","","","","","","","","","","","","","","from","","","","","","","","","","","","from_parts","from_pkarr_signed_packet","from_str","from_txt_lookup","from_z32","hash","in_current_span","","","","","init","","","","","","","","into","","","","","","","","into_node_addr","new","","node_id","or","","","","","","","","partial_cmp","relay_url","set_relay_url","set_user_data","source","","","","","to_node_addr","to_owned","","","to_pkarr_signed_packet","to_string","","","","","","to_txt_strings","to_z32","try_from","","","","","","","","","try_into","","","","","","","","try_to_string","","","","","","type_id","","","","","","","","user_data","vzip","","","","","","","","with_direct_addresses","","with_relay_url","","with_user_data","","backtrace","","","len","source","","span_trace","","","backtrace","","source","","span_trace","","backtrace","","","source","","","span_trace","","","backtrace","","","","","","key","label","num_labels","s","source","","span_trace","","","","","","common","disco","handshake","relay","streams","ClientAuth","ClientToRelayDatagram","ClientToRelayDatagramBatch","FrameType","FrameTypeError","Health","NodeGone","Ping","Pong","RelayToClientDatagram","RelayToClientDatagramBatch","Restarting","ServerChallenge","ServerConfirmsAuth","ServerDeniesAuth","UnexpectedEnd","UnknownFrameType","__clone_box","and","","as_error_source","backtrace","borrow","","borrow_mut","","cause","clone","clone_into","clone_to_uninit","compat","","compat_mut","","compat_ref","","deref","","deref_mut","","description","drop","","eq","equivalent","","","","fmt","","","from","","in_current_span","init","","into","","or","","source","to_owned","to_string","try_from","","","try_from_primitive","try_into","","try_to_string","type_id","","vzip","","backtrace","","span_trace","","tag","MAGIC","looks_like_disco_wrapper","ClientAuthHeaderInvalid","DeserializationError","Error","FrameTypeError","ServerDeniedAuth","UnexpectedEnd","UnexpectedFrameType","Websocket","and","as_error_source","backtrace","borrow","borrow_mut","cause","compat","compat_mut","compat_ref","deref","deref_mut","description","drop","fmt","","from","","","in_current_span","init","into","or","source","to_string","try_from","try_into","try_to_string","type_id","vzip","backtrace","","","","","","","expected_types","frame_type","","reason","source","","","span_trace","","","","","","","value","ClientToRelayMsg","Datagrams","","","Error","FrameTooLarge","FrameTypeError","Health","InvalidFrame","InvalidFrameType","InvalidProtocolMessageEncoding","InvalidPublicKey","MAX_PACKET_SIZE","NodeGone","Ping","","Pong","","RelayToClientMsg","Restarting","SerDe","TooSmall","UnexpectedFrame","__clone_box","","","and","","","","as_error_source","backtrace","borrow","","","","borrow_mut","","","","cause","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","compat_mut","","","","compat_ref","","","","contents","deref","","","","deref_mut","","","","description","drop","","","","ecn","eq","","","equivalent","","","","","","","","","","","","fmt","","","","","from","","","","","","","in_current_span","init","","","","into","","","","or","","","","segment_size","source","take_segments","to_owned","","","to_string","try_from","","","","try_into","","","","try_to_string","typ","type_id","","","","vzip","","","","datagrams","dst_node_id","backtrace","","","","","","","","","expected","frame_len","frame_type","got","source","","","","span_trace","","","","","","","","","datagrams","problem","reconnect_in","remote_node_id","try_for","ALPN_QUIC_ADDR_DISC","Connect","Connection","Error","QUIC_ADDR_DISC_CLOSE_CODE","QUIC_ADDR_DISC_CLOSE_REASON","QuicClient","WatchRecv","__clone_box","and","","as_error_source","backtrace","borrow","","borrow_mut","","cause","clone","clone_into","clone_to_uninit","compat","","compat_mut","","compat_ref","","create_conn","deref","","deref_mut","","description","drop","","fmt","","","from","","","","","in_current_span","init","","into","","new","or","","source","to_owned","to_string","try_from","","try_into","","try_to_string","type_id","","vzip","","backtrace","","","source","","","span_trace","","","Access","AccessConfig","AcmeEventStreamFinished","Allow","BindTcpListener","BindTlsListener","CertConfig","ClientRateLimit","DEFAULT_CERT_RELOAD_INTERVAL","Deny","Everyone","JoinError","LetsEncrypt","Limits","LocalAddr","Manual","Metrics","","NoLocalAddr","NoRelayServicesEnabled","QuicConfig","QuicSpawn","RelayConfig","RelayMetrics","Reloading","ReloadingResolver","Restricted","Server","ServerConfig","SpawnError","SupervisorError","TaskCancelled","TlsConfig","TlsHeaderParse","__clone_box","","","accept_conn_burst","accept_conn_limit","accepts","access","and","","","","","","","","","","","","","","","as_error_source","","as_iterable","backtrace","","bind_addr","borrow","","","","","","","","","","","","","","","borrow_mut","","","","","","","","","","","","","","","bytes_per_second","bytes_recv","bytes_rx_ratelimited_total","bytes_sent","cause","","cert","certificates","client_rx","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","","","","","","","","","","","","compat_mut","","","","","","","","","","","","","","","compat_ref","","","","","","","","","","","","","","","conns_rx_ratelimited_total","default","","","","deref","","","","","","","","","","","","","","","","deref_mut","","","","","","","","","","","","","","","description","","disco_packets_dropped","disco_packets_recv","disco_packets_sent","disconnects","drop","","","","","","","","","","","","","","","eq","equivalent","","","","field_count","field_ref","fmt","","","","","","","","","","","","","","","","","from","","","","","","","","","","","","","","","","got_ping","groups","groups_cloned","http_addr","http_bind_addr","http_url","https_addr","https_bind_addr","https_url","in_current_span","","init","","","","","","","","","","","","","","","","into","","","","","","","","","","","","","","","is_allowed","key_cache_capacity","limits","max_burst_bytes","metrics","metrics_addr","name","","or","","","","","","","","","","","","","","","other_packets_dropped","other_packets_recv","other_packets_sent","quic","quic_addr","quic_bind_addr","relay","reload","resolve","send_packets_dropped","send_packets_recv","send_packets_sent","sent_pong","server","server_config","","shutdown","","source","","spawn","task_handle","testing","tls","to_owned","","","to_string","","try_from","","","","","","","","","","","","","","","try_into","","","","","","","","","","","","","","","try_to_string","","type_id","","","","","","","","","","","","","","","unique_client_keys","unknown_frames","vzip","","","","","","","","","","","","","","","certs","state","addr","backtrace","","","","","","source","","","","","span_trace","","","","","","backtrace","","","","","source","","span_trace","","","","","quic_config","relay_config","self_signed_tls_certs_and_config","server_config","tls_config"],"q":[[0,"iroh_relay"],[153,"iroh_relay::client"],[401,"iroh_relay::client::ConnectError"],[429,"iroh_relay::client::DialError"],[457,"iroh_relay::client::RecvError"],[463,"iroh_relay::client::SendError"],[471,"iroh_relay::defaults"],[476,"iroh_relay::dns"],[639,"iroh_relay::dns::DnsError"],[655,"iroh_relay::http"],[659,"iroh_relay::node_info"],[946,"iroh_relay::node_info::DecodingError"],[955,"iroh_relay::node_info::EncodingError"],[961,"iroh_relay::node_info::LookupError"],[970,"iroh_relay::node_info::ParseError"],[988,"iroh_relay::protos"],[993,"iroh_relay::protos::common"],[1067,"iroh_relay::protos::common::FrameTypeError"],[1072,"iroh_relay::protos::disco"],[1074,"iroh_relay::protos::handshake"],[1111,"iroh_relay::protos::handshake::Error"],[1133,"iroh_relay::protos::relay"],[1275,"iroh_relay::protos::relay::ClientToRelayMsg"],[1277,"iroh_relay::protos::relay::Error"],[1303,"iroh_relay::protos::relay::RelayToClientMsg"],[1308,"iroh_relay::quic"],[1371,"iroh_relay::quic::Error"],[1380,"iroh_relay::server"],[1790,"iroh_relay::server::CertConfig"],[1792,"iroh_relay::server::SpawnError"],[1810,"iroh_relay::server::SupervisorError"],[1822,"iroh_relay::server::testing"],[1827,"dyn_clone::sealed"],[1828,"tower_http::follow_redirect::policy::and"],[1829,"tower_http::follow_redirect::policy"],[1830,"iroh_relay::relay_map"],[1831,"core::cmp"],[1832,"async_compat"],[1833,"iroh_base::relay_url"],[1834,"iroh_relay::ping_tracker"],[1835,"core::time"],[1836,"core::result"],[1837,"serde_core::de"],[1838,"core::fmt"],[1839,"core::iter::traits::collect"],[1840,"alloc::sync"],[1841,"core::option"],[1842,"core::iter::traits::iterator"],[1843,"tower_http::follow_redirect::policy::or"],[1844,"serde_core::ser"],[1845,"alloc::string"],[1846,"alloc::collections"],[1847,"core::any"],[1848,"core::ops::function"],[1849,"core::marker"],[1850,"core::error"],[1851,"iroh_relay::client::conn"],[1852,"backtrace::capture"],[1853,"tokio_websockets::error"],[1854,"tokio::time::error"],[1855,"std::io::error"],[1856,"core::net::socket_addr"],[1857,"rustls::client::client_conn"],[1858,"iroh_base::key"],[1859,"core::convert"],[1860,"core::pin"],[1861,"core::task::wake"],[1862,"core::task::poll"],[1863,"url"],[1864,"http::status"],[1865,"hyper::error"],[1866,"n0_snafu::spantrace"],[1867,"hickory_resolver::error"],[1868,"hickory_resolver::resolver"],[1869,"hickory_resolver::lookup"],[1870,"core::net::ip_addr"],[1871,"reqwest::dns::resolve"],[1872,"alloc::boxed"],[1873,"http::header::name"],[1874,"alloc::collections::btree::set"],[1875,"pkarr::signed_packet"],[1876,"iroh_base::node_addr"],[1877,"core::hash"],[1878,"alloc::vec"],[1879,"z32"],[1880,"ed25519_dalek::errors"],[1881,"simple_dns::simple_dns_error"],[1882,"hickory_proto::error"],[1883,"core::str::error"],[1884,"num_enum"],[1885,"iroh_quinn_proto::varint"],[1886,"postcard::error"],[1887,"http::header::value"],[1888,"bytes::bytes"],[1889,"iroh_quinn::connection"],[1890,"iroh_quinn_proto::endpoint"],[1891,"iroh_quinn_proto::connection"],[1892,"tokio::sync::watch::error"],[1893,"iroh_quinn::endpoint"],[1894,"iroh_relay::server::metrics"],[1895,"iroh_metrics::metrics"],[1896,"iroh_metrics::iterable"],[1897,"core::num::nonzero"],[1898,"rustls_pki_types"],[1899,"core::default"],[1900,"iroh_relay::server::resolver"],[1901,"iroh_metrics::base"],[1902,"tokio::runtime::task::error"],[1903,"rustls::crypto::signer"],[1904,"reloadable_core"],[1905,"rustls::server::server_conn"],[1906,"tokio_util::task::abort_on_drop"],[1907,"tokio_rustls_acme::state"]],"i":"`````nA`AbAn32103210321`32132132121210321032103213010`0321032121`032133213333222211110332210333221333`032103213300`303212101``221`03213203210321320321230321`````Ef`EhE`022121212Ed22222``1023333Dd021430EjEnF`5476547654763210547632105476333547632105476321054763210354763210547632105476547632105544776632105544477776666321054765476321035476321030`35476321021212021354762213547654763210547632102054765476321054763210HdHfHhHjHlHnI`IbIdIf476530987654321098InJ`JbJdJfJhJjJlJnK`138762987654321045KbKd1010KfKhKj12210```````Fh0``000``0`GdLbLd3Kl3214040403214032140332132132140321403214032134032140321404032144003211444033221404032140321233333333333340321333403214014032140321401140321403213N`NbNdNfNhNj3351543210````Oh`0`Ob`OdMf112`0O`````44`14`4Nn1Md15412Of147650473650476523014765230147650472231231231336523014765230147652301471265230114765230114765047265230147231222233331111665523300144776652230114771131A@h476158763412587634125823227634125843337615823422764158207634412587634125876415876341258376341258323232A@jA@lA@n120210AAdAAf1010AAjAAlAAn210210ABbABdABfABhABjABl413520543210`````ACb00``0000000000AC`0110001010011110101010100101111110010010101001011011001010ACfACh100``Ff0`0000000000000000000000000000000000AClACnAD`ADbADdADfADh110253065432106``ADnHb`Fd020000`22121`200021AE`13201113201320132032032013201320132001320132011320032033332222000011320111320011320132013200103201132013201313201320AEf0AEhAEjAElAEnAF`AFbAFdAFfAFh87286541876543210AFjAFlAFn20`AG`0````0AGb101110101000101010010101101101111011010010101101011010AGnAH`AHb210210``AIbAJdAI`0```1AHl3AIl`20`424`2``0`1````4`2AJb4AIfAHd0AHfAHj14AJjAJf28:AIdAIj679AIn<><>6<>269435;=2178:0<>69435;=2178:0<>8666<>1079=89=89=869435;=2178:0<>69435;=2178:0<>69435;=2178:0<>66937694435;=2178:0<>69435;=2178:0<><>666669435;=2178:0<>=====6669435;=2178:0<<>>69435;=2178:0<>>699050010<>694435;=2178:0<>69435;=2178:0<>;558036969435;=2178:0<>666301344666692140<>00`59=8<>69435;=2178:0<>69435;=2178:0<><>69435;=2178:0<>6669435;=2178:0<>AKnAL`ALdALfALhALjALlALn543210432105AMbAMdAMfAMhAMj4243210`````","f":"`````{{bd}f}00{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}000{b{{b{c}}}{}}000{{{b{l}}}{{b{lc}}}{}}000`{{{b{n}}}n}{{{b{A`}}}A`}{{{b{Ab}}}Ab}{{b{b{lc}}}f{}}00{{bAd}f}00{{{b{A`}}{b{A`}}}Af}{{{b{Ab}}{b{Ab}}}Af}{{b{b{c}}}Af{}}0{{}{{Ah{c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Kh}{{Cb{{C`{AKd}}}}}{{AKf{}{{AKb{AKd}}}}DjKn}}3333{AJbC`}{AIdAKj}{AIjAKj}{{{AJj{c}}}f{Dj{AKf{}{{AKb{AKd}}}}}}{AIn{{Bd{fAIb}}}}{{{b{AI`}}}{{Cb{{b{Dn}}}}}}{{{b{AIb}}}{{Cb{{b{Dn}}}}}}{{{AJf{ce}}}{{Bd{AInAI`}}}KnKn}{{{b{lAIn}}}{{b{l{AKl{{Bd{fAIb}}}}}}}}`{AHjCb}{bc{}}00{bCn}0{c{{Bd{e}}}{}{}}00000000000000{{}{{Bd{c}}}{}}00000000000000{b{{Bd{CnD`}}}}0{bDb}00000000000000{AHfAHh}0{{}c{}}00000000000000{AKnA@f}{AL`ALb}{ALdFn}{ALfCb}{ALhCb}{ALjCb}{ALlCb}{ALnCb}{ALdCb}{ALfFl}`{ALjAM`}{ALlFl}{ALnFl}{ALfIl}{ALhIl}{ALjIl}{ALlIl}{ALnIl}{ALdIl}{AMbCb}{AMdCb}{AMfCb}{AMhCb}{AMjCb}{AMbFl}{AMfAJn}{AMbIl}{AMdIl}{AMfIl}{AMhIl}{AMjIl}{{}AId}{{}{{AHj{f}}}}{{}{{H`{{A@f{AJ`}}AKj}}}}{{}{{AJf{f}}}}{{}{{AIj{f}}}}","D":"BNf","p":[[1,"reference",null,null,1],[5,"Private",1827],[1,"unit"],[5,"And",1828],[10,"Policy",1829],[0,"mut"],[5,"RelayMap",0,1830],[5,"RelayNode",0,1830],[5,"RelayQuicConfig",0,1830],[1,"u8"],[6,"Ordering",1831],[5,"Compat",1832],[5,"RelayUrl",1833],[1,"bool"],[5,"PingTracker",0,1834],[5,"Duration",1835],[1,"usize"],[6,"Result",1836,null,1],[10,"Deserializer",1837],[5,"Formatter",1838],[8,"Result",1838],[17,"Item"],[10,"IntoIterator",1839],[5,"Arc",1840,null,1],[6,"Option",1841,null,1],[1,"array"],[10,"Iterator",1842],[5,"Or",1843],[1,"u16"],[10,"Serializer",1844],[5,"String",1845],[5,"TryReserveError",1846],[5,"TypeId",1847],[5,"ClientBuilder",153],[17,"Output"],[10,"Fn",1848],[10,"Send",1849],[10,"Sync",1849],[10,"Error",1850],[6,"SendError",153,1851],[5,"Backtrace",1852],[6,"RecvError",153,1851],[6,"ConnectError",153],[6,"DialError",153],[5,"Client",153],[1,"str"],[5,"ClientSink",153],[5,"ClientStream",153],[6,"Error",1853],[6,"Error",1133],[6,"Error",1074],[6,"DnsError",476],[5,"Elapsed",1854],[5,"Error",1855],[6,"SocketAddr",1856],[5,"ClientConfig",1857],[5,"SecretKey",1858],[5,"DnsResolver",476],[10,"Into",1859,null,1],[5,"Pin",1860],[5,"Context",1861],[6,"Poll",1862],[5,"Url",1863],[1,"tuple",null,null,1],[6,"ClientToRelayMsg",1133],[15,"InvalidWebsocketUrl",401],[15,"InvalidRelayUrl",401],[15,"Websocket",401],[15,"Handshake",401],[15,"Dial",401],[15,"UnexpectedUpgradeStatus",401],[15,"Upgrade",401],[15,"InvalidTlsServername",401],[15,"NoLocalAddr",401],[15,"Tls",401],[5,"StatusCode",1864],[5,"Error",1865],[5,"SpanTrace",1866],[15,"InvalidTargetPort",429],[15,"Dns",429],[15,"Timeout",429],[15,"Io",429],[15,"InvalidUrl",429],[15,"ProxyConnectInvalidStatus",429],[15,"ProxyInvalidUrl",429],[15,"ProxyConnect",429],[15,"ProxyInvalidTlsServername",429],[15,"ProxyInvalidTargetPort",429],[15,"Protocol",457],[15,"StreamError",457],[15,"StreamError",463],[15,"ExceedsMaxPacketSize",463],[15,"EmptyPacket",463],[5,"StaggeredError",476],[10,"Debug",1838],[10,"Display",1838],[5,"TxtLookup",476],[5,"TXT",476],[5,"ResolveError",1867],[8,"TokioResolver",1868],[5,"TxtLookup",1869],[6,"IpAddr",1870],[10,"ToString",1845],[1,"u64"],[1,"slice"],[5,"NodeInfo",659],[6,"LookupError",659],[8,"NodeId",1858],[5,"Name",1871],[8,"Resolving",1871],[5,"Box",1872,null,1],[15,"Timeout",639],[15,"NoResponse",639],[15,"ResolveBoth",639],[15,"MissingHost",639],[15,"Resolve",639],[15,"InvalidResponse",639],[5,"HeaderName",1873],[5,"NodeData",659],[5,"UserData",659],[6,"EncodingError",659],[6,"DecodingError",659],[5,"MaxLengthExceededError",659],[6,"ParseError",659],[5,"BTreeSet",1874],[6,"SignedPacketBuildError",1875],[5,"NodeAddr",1876],[5,"SignedPacket",1875],[10,"Hasher",1877],[1,"u32"],[5,"Vec",1878],[10,"NodeIdExt",659],[15,"InvalidEncodingZ32",946],[15,"InvalidLength",946],[15,"InvalidSignature",946],[6,"Z32Error",1879],[8,"SignatureError",1880],[15,"FailedBuildingPacket",955],[15,"InvalidTxtEntry",955],[6,"SimpleDnsError",1881],[15,"ParseError",961],[15,"LookupFailed",961],[15,"InvalidLabel",961],[5,"ProtoError",1882],[15,"UnexpectedFormat",970],[15,"AttrFromString",970],[15,"NumLabels",970],[15,"Utf8",970],[15,"NotAnIrohRecord",970],[15,"DecodingError",970],[5,"Utf8Error",1883],[6,"FrameTypeError",993],[6,"FrameType",993],[5,"TryFromPrimitiveError",1884],[15,"UnexpectedEnd",1067],[15,"UnknownFrameType",1067],[5,"VarInt",1885],[15,"ClientAuthHeaderInvalid",1111],[15,"Websocket",1111],[15,"UnexpectedEnd",1111],[15,"FrameTypeError",1111],[15,"ServerDeniedAuth",1111],[15,"UnexpectedFrameType",1111],[15,"DeserializationError",1111],[6,"Error",1886],[5,"HeaderValue",1887],[6,"RelayToClientMsg",1133],[5,"Datagrams",1133],[5,"Bytes",1888],[10,"AsRef",1859],[15,"Datagrams",1275],[15,"UnexpectedFrame",1277],[15,"FrameTooLarge",1277],[15,"SerDe",1277],[15,"FrameTypeError",1277],[15,"InvalidPublicKey",1277],[15,"InvalidFrame",1277],[15,"InvalidFrameType",1277],[15,"InvalidProtocolMessageEncoding",1277],[15,"TooSmall",1277],[15,"Datagrams",1303],[15,"Health",1303],[15,"Restarting",1303],[6,"Error",1308],[5,"QuicClient",1308],[5,"Connection",1889],[6,"ConnectError",1890],[6,"ConnectionError",1891],[5,"RecvError",1892],[5,"Endpoint",1893],[15,"Connect",1371],[15,"Connection",1371],[15,"WatchRecv",1371],[5,"Limits",1380],[5,"Metrics",1380,1894],[5,"Counter",1895],[5,"RelayConfig",1380],[6,"AccessConfig",1380],[10,"Iterable",1896],[6,"SpawnError",1380],[6,"SupervisorError",1380],[5,"QuicConfig",1380],[5,"ClientRateLimit",1380],[8,"NonZeroU32",1897],[5,"TlsConfig",1380],[6,"CertConfig",1380],[5,"Server",1380],[5,"CertificateDer",1898],[5,"RelayMetrics",1380,1894],[6,"Access",1380],[5,"ServerConfig",1380],[10,"Default",1899],[5,"ReloadingResolver",1380,1900],[5,"MetricItem",1901],[5,"JoinError",1902],[10,"MetricsGroup",1901],[17,"Value"],[5,"CertifiedKey",1903],[10,"Loader",1904],[5,"ClientHello",1905],[5,"ServerConfig",1905],[5,"AbortOnDropHandle",1906],[15,"Manual",1790],[15,"LetsEncrypt",1790],[5,"AcmeState",1907],[15,"BindTcpListener",1792],[15,"LocalAddr",1792],[15,"QuicSpawn",1792],[15,"TlsHeaderParse",1792],[15,"BindTlsListener",1792],[15,"NoLocalAddr",1792],[5,"InvalidHeaderValue",1887],[15,"Metrics",1810],[15,"AcmeEventStreamFinished",1810],[15,"JoinError",1810],[15,"NoRelayServicesEnabled",1810],[15,"TaskCancelled",1810]],"r":[[0,1133],[1,1834],[2,1830],[3,1830],[4,1830],[5,1830],[6,1830],[7,1830],[8,1834],[9,1830],[10,1830],[11,1830],[12,1834],[13,1830],[14,1830],[15,1830],[16,1834],[17,1830],[18,1830],[19,1830],[21,1830],[22,1830],[23,1830],[24,1830],[25,1830],[26,1830],[27,1830],[28,1830],[29,1830],[30,1830],[31,1830],[32,1830],[33,1830],[34,1834],[35,1830],[36,1830],[37,1830],[38,1834],[39,1830],[40,1830],[41,1830],[42,1834],[43,1830],[44,1830],[45,1830],[46,1830],[47,1834],[48,1830],[49,1834],[51,1834],[52,1830],[53,1830],[54,1830],[55,1834],[56,1830],[57,1830],[58,1830],[59,1830],[60,1830],[62,1834],[63,1830],[64,1830],[65,1830],[66,1830],[67,1830],[68,1830],[69,1830],[70,1830],[71,1830],[72,1830],[73,1830],[74,1830],[75,1830],[76,1830],[77,1830],[78,1830],[79,1830],[80,1830],[81,1830],[82,1834],[83,1830],[84,1830],[85,1830],[86,1830],[87,1830],[88,1834],[89,1830],[90,1830],[91,1830],[92,1830],[93,1830],[94,1830],[95,1830],[96,1830],[97,1830],[99,1834],[100,1830],[101,1830],[102,1830],[103,1834],[104,1830],[105,1830],[106,1830],[107,1830],[108,1830],[109,1834],[110,1834],[112,1830],[113,1834],[114,1830],[115,1830],[116,1830],[117,1830],[118,1830],[119,1834],[120,1830],[123,1830],[124,1830],[125,1830],[127,1834],[128,1830],[129,1830],[130,1830],[131,1830],[132,1830],[133,1834],[134,1830],[135,1830],[136,1830],[137,1834],[138,1830],[139,1830],[140,1830],[141,1830],[142,1830],[143,1834],[144,1830],[145,1830],[146,1830],[147,1830],[148,1830],[149,1834],[150,1830],[151,1830],[152,1830],[161,1851],[162,1851],[171,1851],[177,1851],[178,1851],[179,1851],[180,1851],[188,1851],[189,1851],[196,1851],[197,1851],[200,1851],[201,1851],[204,1851],[205,1851],[212,1851],[213,1851],[220,1851],[221,1851],[227,1851],[228,1851],[235,1851],[236,1851],[243,1851],[244,1851],[252,1851],[253,1851],[260,1851],[261,1851],[268,1851],[269,1851],[272,1851],[273,1851],[280,1851],[281,1851],[282,1851],[283,1851],[292,1851],[293,1851],[294,1851],[295,1851],[296,1851],[309,1851],[310,1851],[313,1851],[314,1851],[322,1851],[323,1851],[334,1851],[335,1851],[351,1851],[352,1851],[359,1851],[360,1851],[363,1851],[364,1851],[371,1851],[372,1851],[381,1851],[382,1851],[385,1851],[386,1851],[393,1851],[394,1851],[1388,1900],[1396,1894],[1403,1894],[1405,1900],[1414,1894],[1419,1894],[1421,1894],[1422,1894],[1423,1900],[1438,1894],[1442,1894],[1443,1894],[1444,1900],[1457,1894],[1458,1894],[1459,1900],[1473,1894],[1474,1894],[1475,1894],[1481,1894],[1484,1894],[1487,1894],[1490,1894],[1491,1894],[1492,1900],[1505,1894],[1506,1894],[1507,1900],[1520,1894],[1521,1894],[1522,1900],[1535,1894],[1536,1894],[1537,1894],[1540,1894],[1541,1894],[1542,1900],[1543,1900],[1556,1894],[1557,1894],[1558,1900],[1573,1894],[1574,1894],[1575,1894],[1576,1894],[1577,1894],[1578,1894],[1579,1900],[1597,1894],[1598,1894],[1599,1894],[1600,1894],[1601,1900],[1616,1894],[1617,1894],[1618,1900],[1632,1894],[1633,1894],[1634,1894],[1643,1894],[1644,1894],[1645,1900],[1646,1900],[1659,1894],[1660,1894],[1661,1900],[1680,1894],[1681,1894],[1682,1894],[1683,1894],[1684,1900],[1697,1894],[1698,1894],[1699,1894],[1704,1900],[1705,1900],[1706,1894],[1707,1894],[1708,1894],[1709,1894],[1710,1894],[1713,1900],[1721,1894],[1726,1894],[1727,1894],[1728,1900],[1741,1894],[1742,1894],[1743,1900],[1758,1894],[1759,1894],[1760,1900],[1773,1894],[1774,1894],[1775,1894],[1776,1894],[1777,1900]],"b":[[83,"impl-Display-for-RelayMap"],[84,"impl-Debug-for-RelayMap"],[85,"impl-Display-for-RelayNode"],[86,"impl-Debug-for-RelayNode"],[89,"impl-From%3CRelayNode%3E-for-RelayMap"],[91,"impl-From%3CRelayUrl%3E-for-RelayMap"],[95,"impl-FromIterator%3CRelayUrl%3E-for-RelayMap"],[96,"impl-FromIterator%3CRelayNode%3E-for-RelayMap"],[280,"impl-Display-for-SendError"],[281,"impl-Debug-for-SendError"],[282,"impl-Debug-for-RecvError"],[283,"impl-Display-for-RecvError"],[284,"impl-Display-for-ConnectError"],[285,"impl-Debug-for-ConnectError"],[286,"impl-Display-for-DialError"],[287,"impl-Debug-for-DialError"],[295,"impl-From%3CError%3E-for-RecvError"],[296,"impl-From%3CError%3E-for-RecvError"],[298,"impl-From%3CError%3E-for-ConnectError"],[299,"impl-From%3CError%3E-for-ConnectError"],[300,"impl-From%3CDialError%3E-for-ConnectError"],[302,"impl-From%3CDnsError%3E-for-DialError"],[303,"impl-From%3CElapsed%3E-for-DialError"],[304,"impl-From%3CError%3E-for-DialError"],[556,"impl-Debug-for-DnsError"],[557,"impl-Display-for-DnsError"],[558,"impl-Debug-for-StaggeredError%3CE%3E"],[559,"impl-Display-for-StaggeredError%3CE%3E"],[562,"impl-Display-for-TXT"],[563,"impl-Debug-for-TXT"],[564,"impl-From%3CElapsed%3E-for-DnsError"],[566,"impl-From%3CResolveError%3E-for-DnsError"],[813,"impl-Display-for-EncodingError"],[814,"impl-Debug-for-EncodingError"],[815,"impl-Debug-for-DecodingError"],[816,"impl-Display-for-DecodingError"],[818,"impl-Display-for-UserData"],[819,"impl-Debug-for-UserData"],[820,"impl-Debug-for-MaxLengthExceededError"],[821,"impl-Display-for-MaxLengthExceededError"],[823,"impl-Display-for-LookupError"],[824,"impl-Debug-for-LookupError"],[825,"impl-Display-for-ParseError"],[826,"impl-Debug-for-ParseError"],[1042,"impl-Display-for-FrameTypeError"],[1043,"impl-Debug-for-FrameTypeError"],[1095,"impl-Display-for-Error"],[1096,"impl-Debug-for-Error"],[1097,"impl-From%3CFrameTypeError%3E-for-Error"],[1098,"impl-From%3CError%3E-for-Error"],[1225,"impl-Display-for-Error"],[1226,"impl-Debug-for-Error"],[1230,"impl-From%3CError%3E-for-Error"],[1231,"impl-From%3CFrameTypeError%3E-for-Error"],[1343,"impl-Debug-for-Error"],[1344,"impl-Display-for-Error"],[1346,"impl-From%3CConnectError%3E-for-Error"],[1348,"impl-From%3CConnectionError%3E-for-Error"],[1349,"impl-From%3CRecvError%3E-for-Error"],[1612,"impl-Display-for-SpawnError"],[1613,"impl-Debug-for-SpawnError"],[1614,"impl-Debug-for-SupervisorError"],[1615,"impl-Display-for-SupervisorError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAALAFdgABAAAABgAOABYAGAAwAAEANAAJAD8AAwBEABQAWgAAAF4AAABhAAAAZAADAHIABQB9AAEAgQAMAJAAAwCWAAMAnwAAAKEAEAC0AAcAvQA+AP0AKAAoAQEAKwECAC8BAgA2AQsATwEPAGABAwBlARgAggFVAN8BAQDjAQIA6AEAAOoBFwADAjIANwIAADoCAQA+AgYASgIAAFcCBABdAgAAXwIRAHUCCQCAAg8AlAIEAJoCBgCmAgQArAIDALECJwDaAiIA/gIXABcDJAA9AwAAPwMAAEQDAABHAwAASgMAAE0DDQBnAwgAcwMEAHkDAgB9AwUAhQMQAJwDBwClAwcAswMpAOYDAADxAyMAFwQCABwECgAoBAgANAQXAE0EAQBQBAQAVgQXAHMEAQB2BAMAggQpAK0EDAC7BBUA1AQAANYEBADfBAMA5AQAAOYECwD0BAcA/gQZAB4FAQAkBRMAOQUKAEUFAQBIBQIATgUIAFgFDABnBQAAaQUBAHAFAABzBQAAdgUCAHoFAACEBQAAhgUDAI4FEwCjBR0AxQUBAMoFNQABBiQAKgYmAF8GAABiBgEAagYEAHAGCwCRBhAAqgYAALQGAQC6BiIA3wYOAPAGDgABBx0A","P":[[8,"B,E,P,T"],[12,"T"],[21,""],[24,"T"],[27,""],[32,"K"],[34,"T"],[46,""],[51,"T"],[59,"__D"],[62,""],[70,"K"],[82,""],[88,"T"],[89,""],[90,"T"],[91,""],[92,"T"],[93,""],[94,"T"],[97,""],[103,"U"],[107,""],[113,"B,E,P,T"],[117,""],[124,"__S"],[127,""],[128,"T"],[131,""],[133,"U,T"],[137,"U"],[141,""],[149,"V"],[186,""],[187,"S"],[188,"B,E,P,T"],[196,""],[204,"T"],[220,""],[225,"T"],[226,""],[227,"T"],[251,""],[252,"T"],[268,""],[293,"T"],[295,""],[297,"T"],[298,""],[301,"T"],[302,""],[305,"T"],[309,""],[322,"U"],[330,""],[333,""],[334,"B,E,P,T"],[342,"Sink::Error"],[346,"Stream::Item"],[348,"Sink::Error"],[350,""],[356,"Sink::Error"],[358,"T"],[359,""],[363,"U,T"],[371,"U"],[379,"S"],[381,""],[393,"V"],[401,""],[492,"B,E,P,T"],[497,""],[500,"E"],[501,"T"],[511,""],[512,"E"],[513,""],[517,"T"],[520,""],[523,"T"],[538,""],[539,"T"],[549,""],[550,"E"],[551,""],[558,"E"],[560,""],[565,"T"],[566,""],[567,"T"],[569,""],[571,"T"],[573,""],[580,"U"],[585,"IntoIterator::IntoIter"],[586,"T"],[588,""],[590,"T"],[591,""],[592,""],[596,"T"],[597,""],[598,"B,E,P,T"],[603,""],[607,"E"],[608,"T"],[611,""],[614,"U,T"],[619,"U"],[624,""],[633,"V"],[638,""],[687,""],[688,"B,E,P,T"],[696,""],[707,"T"],[723,""],[732,"T"],[735,""],[739,"K"],[740,"T"],[764,""],[766,"T"],[772,"Deref::Target"],[773,"T"],[780,"Deref::Target"],[781,"T"],[784,""],[801,"K"],[813,""],[827,"T"],[828,""],[829,"T"],[830,""],[831,"T"],[835,""],[836,"T"],[838,""],[841,"FromStr::Err"],[842,""],[844,"__H"],[845,""],[858,"U"],[866,""],[870,"B,E,P,T"],[878,""],[888,"T"],[891,""],[900,"U,T"],[904,"TryFrom::Error"],[905,"U,T"],[909,"U"],[917,""],[932,"V"],[940,""],[1011,"B,E,P,T"],[1013,""],[1015,"T"],[1019,""],[1021,"T"],[1022,""],[1023,"T"],[1033,""],[1037,"K"],[1041,""],[1044,"T"],[1046,""],[1049,"U"],[1051,"B,E,P,T"],[1053,""],[1054,"T"],[1055,""],[1057,"U,T"],[1059,"TryFromPrimitive::Primitive"],[1060,"U"],[1062,""],[1065,"V"],[1067,""],[1082,"B,E,P,T"],[1083,""],[1085,"T"],[1087,""],[1088,"T"],[1093,""],[1099,"T"],[1100,""],[1102,"U"],[1103,"B,E,P,T"],[1104,""],[1106,"U,T"],[1107,"U"],[1108,""],[1110,"V"],[1111,""],[1159,"B,E,P,T"],[1163,""],[1165,"T"],[1173,""],[1177,"T"],[1180,""],[1183,"T"],[1195,""],[1196,"T"],[1204,""],[1213,"K"],[1225,""],[1232,"T"],[1237,""],[1242,"U"],[1246,"B,E,P,T"],[1250,""],[1253,"T"],[1256,""],[1257,"U,T"],[1261,"U"],[1265,""],[1271,"V"],[1275,""],[1317,"B,E,P,T"],[1319,""],[1321,"T"],[1325,""],[1327,"T"],[1328,""],[1329,"T"],[1335,""],[1336,"T"],[1340,""],[1347,"T"],[1348,""],[1350,"T"],[1351,""],[1354,"U"],[1356,""],[1357,"B,E,P,T"],[1359,""],[1360,"T"],[1361,""],[1362,"U,T"],[1364,"U"],[1366,""],[1369,"V"],[1371,""],[1421,"B,E,P,T"],[1436,""],[1442,"T"],[1472,""],[1484,"T"],[1487,""],[1490,"T"],[1535,""],[1538,"EC,EA"],[1539,""],[1540,"T"],[1543,"Loader,Deref::Target"],[1544,"T"],[1571,""],[1593,"K"],[1597,""],[1601,"Loader"],[1602,"EC,EA"],[1604,""],[1607,"EC,EA"],[1608,""],[1610,"EC,EA"],[1611,""],[1616,"T"],[1630,""],[1631,"T"],[1632,""],[1646,"Loader"],[1647,""],[1659,"U"],[1674,""],[1682,"B,E,P,T"],[1697,""],[1704,"Loader"],[1706,""],[1713,"Loader"],[1714,""],[1717,"EC,EA"],[1718,""],[1721,"T"],[1724,""],[1726,"U,T"],[1741,"U"],[1756,""],[1775,"V"],[1790,""]]}]]')); +var searchIndex = new Map(JSON.parse('[["bulk",{"t":"HHHHH","n":["collect_and_print","main","run_iroh","run_quinn","run_s2n"],"q":[[0,"bulk"],[5,"iroh_metrics::base"],[6,"iroh_bench"],[7,"n0_snafu::error"],[8,"iroh_bench::s2n"]],"i":"`````","f":"{{{d{b}}{d{f}}}h}{{}h}{j{{l{h}}}}0{n{{l{h}}}}","D":"`","p":[[1,"str"],[1,"reference",null,null,1],[10,"MetricsGroup",5],[1,"unit"],[5,"Opt",6],[8,"Result",7],[5,"Opt",8]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAAUAAQAAAAUA","P":[]}],["iroh",{"t":"PPEPGTFIFFEFFFFRKNNNNNN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","KeyParsingError","LENGTH","NodeAddr","NodeId","PublicKey","RelayMap","RelayMode","RelayNode","RelayUrl","RelayUrlParseError","SecretKey","Value","Watcher","__clone_box","","","","","","and","","","","","","","","as_bytes","as_error_source","","as_ref","backtrace","","borrow","","","","","","","","","borrow_mut","","","","","","","","cause","","clone","","","","","","clone_into","","","","","","clone_to_uninit","","","","","","cmp","","","","compare","","","","compat","","","","","","","","compat_mut","","","","","","","","compat_ref","","","","","","","","contains_node","defaults","deref","","","","","","","","","","deref_mut","","","","","","","","description","","deserialize","","","","","direct_addresses","","discovery","dns","drop","","","","","","","","empty","endpoint","eq","","","","","equivalent","","","","","","","","","","","","","","","","","","","","fmt","","","","","","","","","","","","","","fmt_short","from","","","","","","","","","","","","","","","","","","","","","","from_bytes","","from_iter","","from_parts","from_ref","","","","","","from_str","","","from_z32","generate","get","get_node","hash","","","in_current_span","","init","","","","","","","","initialized","into","","","","","","","","is_connected","is_empty","","len","map","metrics","net_report","new","node_id","node_info","nodes","or","","","","","","","","","partial_cmp","","","","poll_updated","protocol","public","","quic","relay_url","","secret","serialize","","","","","sign","source","","stream","stream_updates_only","test_utils","to_bytes","to_owned","","","","","","to_string","","","","","","to_z32","try_from","","","","","","","","","","","try_into","","","","","","","","try_to_string","","","","","","type_id","","","","","","","","updated","url","urls","verify","vzip","","","","","","","","with_direct_addresses","with_relay_url","backtrace","","","source","","span_trace","","","DEFAULT_HTTPS_PORT","DEFAULT_HTTP_PORT","DEFAULT_METRICS_PORT","DEFAULT_RELAY_QUIC_PORT","prod","staging","AP_RELAY_HOSTNAME","EU_RELAY_HOSTNAME","NA_RELAY_HOSTNAME","default_ap_relay_node","default_eu_relay_node","default_na_relay_node","default_relay_map","EU_RELAY_HOSTNAME","NA_RELAY_HOSTNAME","default_eu_relay_node","default_na_relay_node","default_relay_map","AttrFromString","ConcurrentDiscovery","DecodingError","Discovered","Discovery","DiscoveryContext","DiscoveryError","DiscoveryEvent","DiscoveryItem","Expired","IntoDiscovery","IntoDiscoveryError","Lagged","MAX_LENGTH","NoResults","NoServiceConfigured","NodeData","NodeInfo","NotAnIrohRecord","NumLabels","ParseError","UnexpectedFormat","User","","UserData","Utf8","__clone_box","","","","","add","add_direct_addresses","and","","","","","","","","","","","as_error_source","","","","as_ref","backtrace","","","","borrow","","","","","","","","","","","borrow_mut","","","","","","","","","","","cause","","","","clear_direct_addresses","clone","","","","","clone_into","","","","","clone_to_uninit","","","","","cmp","compare","compat","","","","","","","","","","","compat_mut","","","","","","","","","","","compat_ref","","","","","","","","","","","data","default","","deref","","","","","","","","","","","","","deref_mut","","","","","","","","","","","","description","","","","direct_addresses","dns","dns_resolver","drop","","","","","","","","","","","empty","eq","","","","","equivalent","","","","","","","","","","","","","","","","","","","","fmt","","","","","","","","","","","","","","","","from","","","","","","","","","","","","","","","","","","","from_err","","from_err_box","","from_parts","from_pkarr_signed_packet","from_ref","","","","","from_services","from_str","from_txt_lookup","hash","in_current_span","","","","init","","","","","","","","","","","into","","","","","","","","","","","into_discovery","","into_node_addr","","last_updated","mdns","new","","","node_id","","","node_info","or","","","","","","","","","","","partial_cmp","pkarr","provenance","publish","","relay_url","resolve","","secret_key","set_relay_url","set_user_data","source","","","","static_provider","subscribe","","to_node_addr","","to_owned","","","","","to_pkarr_signed_packet","to_string","","","","","to_txt_strings","try_from","","","","","","","","","","","","try_into","","","","","","","","","","","try_to_string","","","","","type_id","","","","","","","","","","","user_data","","val","vzip","","","","","","","","","","","with_direct_addresses","","with_relay_url","","with_user_data","","backtrace","","","node_id","provenance","source","span_trace","","","backtrace","provenance","source","span_trace","backtrace","","","","","","key","label","num_labels","s","source","","span_trace","","","","","","DnsDiscovery","DnsDiscoveryBuilder","N0_DNS_NODE_ORIGIN_PROD","N0_DNS_NODE_ORIGIN_STAGING","and","","borrow","","borrow_mut","","build","builder","compat","","compat_mut","","compat_ref","","deref","","deref_mut","","dns_resolver","drop","","fmt","","from","","init","","into","","into_discovery","","n0_dns","or","","resolve","try_from","","try_into","","type_id","","vzip","","MdnsDiscovery","MdnsDiscoveryBuilder","NAME","advertise","and","","borrow","","borrow_mut","","build","builder","compat","","compat_mut","","compat_ref","","default","deref","","deref_mut","","drop","","fmt","","from","","init","","into","","into_discovery","","new","","or","","publish","resolve","subscribe","try_from","","try_into","","type_id","","vzip","","DEFAULT_PKARR_TTL","DEFAULT_REPUBLISH_INTERVAL","Encoding","HttpPayload","HttpRequest","HttpSend","InvalidRelayUrl","N0_DNS_PKARR_RELAY_PROD","N0_DNS_PKARR_RELAY_STAGING","PkarrError","PkarrPublisher","PkarrPublisherBuilder","PkarrRelayClient","PkarrResolver","PkarrResolverBuilder","PublicKey","Verify","__clone_box","","","and","","","","","","as_error_source","backtrace","borrow","","","","","","borrow_mut","","","","","","build","","builder","","cause","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","","","compat_mut","","","","","","compat_ref","","","","","","deref","","","","","","deref_mut","","","","","","description","dht","dns_resolver","","drop","","","","","","fmt","","","","","","","from","","","","","","from_ref","","","in_current_span","init","","","","","","into","","","","","","into_discovery","","","","n0_dns","","new","or","","","","","","publish","","republish_interval","resolve","","source","to_owned","","","to_string","try_from","","","","","","try_into","","","","","","try_to_string","ttl","type_id","","","","","","update_node_data","vzip","","","","","","with_dns_resolver","source","","","","","status","url","Builder","DhtDiscovery","__clone_box","and","","borrow","","borrow_mut","","build","builder","client","clone","clone_into","clone_to_uninit","compat","","compat_mut","","compat_ref","","default","","deref","","deref_mut","","dht","drop","","fmt","","from","","from_ref","include_direct_addresses","init","","into","","into_discovery","","n0_dns_pkarr_relay","no_publish","or","","pkarr_relay","publish","republish_delay","resolve","secret_key","to_owned","try_from","","try_into","","ttl","type_id","","vzip","","PROVENANCE","StaticProvider","__clone_box","add_node_info","and","borrow","borrow_mut","clone","clone_into","clone_to_uninit","compat","compat_mut","compat_ref","default","deref","deref_mut","drop","fmt","from","from_node_info","from_ref","get_node_info","init","into","into_discovery","new","or","publish","remove_node_info","resolve","set_node_info","to_owned","try_from","try_into","type_id","vzip","DnsResolver","N0_DNS_NODE_ORIGIN_PROD","N0_DNS_NODE_ORIGIN_STAGING","__clone_box","and","borrow","borrow_mut","clear_cache","clone","clone_into","clone_to_uninit","compat","compat_mut","compat_ref","default","deref","deref_mut","drop","fmt","from","","from_ref","init","into","lookup_ipv4","lookup_ipv4_ipv6","lookup_ipv4_ipv6_staggered","lookup_ipv4_staggered","lookup_ipv6","lookup_ipv6_staggered","lookup_node_by_domain_name","lookup_node_by_domain_name_staggered","lookup_node_by_id","lookup_node_by_id_staggered","lookup_txt","new","or","reset","resolve","resolve_host","to_owned","try_from","try_into","type_id","vzip","with_nameserver","AEAD_LIMIT_REACHED","APPLICATION_ERROR","Accept","AcceptBi","AcceptUni","AckFrequencyConfig","AddNodeAddr","AddNodeAddrError","AeadKey","All","AlpnError","App","ApplicationClose","ApplicationClosed","BindError","Builder","CONNECTION_ID_LIMIT_ERROR","CONNECTION_REFUSED","CRYPTO_BUFFER_EXCEEDED","CallMeMaybe","Chunk","CidsExhausted","ClosedStream","","","Connect","ConnectError","ConnectOptions","ConnectWithOptsError","Connecting","Connection","","ConnectionClose","ConnectionClosed","ConnectionError","","ConnectionLost","","","","","ConnectionStats","ConnectionType","ControlMsg","Controller","ControllerFactory","CryptoError","CryptoServerConfig","Custom","Default","Direct","DirectAddr","DirectAddrInfo","DirectAddrType","Disabled","","Discover","Discovery","","DiscoveryStart","ENV_FORCE_STAGING_RELAYS","Empty","EmptyPruned","Endpoint","ExportKeyingMaterialError","FINAL_SIZE_ERROR","FLOW_CONTROL_ERROR","FRAME_ENCODING_ERROR","FinishedEarly","FrameStats","GetMappingAddressError","HandshakeTokenKey","INTERNAL_ERROR","INVALID_TOKEN","IllegalOrderedRead","Incoming","IncomingFuture","KEY_UPDATE_ERROR","Local","LocallyClosed","MAX","MAX_SIZE","MagicSpawn","Mixed","MtuDiscoveryConfig","NO_ERROR","NO_VIABLE_PATH","NamedApp","NoAddress","","None","OpenBi","OpenUni","OwnAddress","PROTOCOL_VIOLATION","PathSelection","PathStats","Ping","Pong","Portmapped","Qad","Qad4LocalPort","Quinn","Read","ReadDatagram","ReadError","","ReadExactError","ReadToEndError","RecvStream","Relay","","RelayMode","RelayOnly","RemoteInfo","RemoteNodeIdError","Reset","","ResetError","RetryError","STREAM_LIMIT_ERROR","STREAM_STATE_ERROR","Saved","SelfConnect","SendDatagramError","SendStream","ServerConfig","Source","Staging","Stopped","StoppedError","StreamId","TRANSPORT_PARAMETER_ERROR","TimedOut","TooLarge","TooLong","TransportConfig","TransportError","","TransportErrorCode","Udp","UdpStats","Unavailable","Unknown","UnknownHandshake","UnsupportedByPeer","UnsupportedVersion","VarInt","VersionMismatch","WeakConnectionHandle","WriteError","Written","ZeroRttAccepted","ZeroRttRejected","","","","__clone_box","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","accept","","accept_bi","accept_uni","accept_with","ack_eliciting_threshold","ack_frequency","ack_frequency_config","acks","add_discovery","add_node_addr","add_node_addr_with_source","addr","","addrs","aead_from_hkdf","allow_spin","alpn","","alpns","and","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","as_error_source","","","","","","","","","","","","","","","","","","backtrace","","","","","","","bind","bind_addr_v4","bind_addr_v6","black_hole_cooldown","black_holes_detected","borrow","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","borrow_mut","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","bound_sockets","build","builder","bytes","","","cause","","","","","","","chunks","clear_discovery","clone","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","clone_box","clone_into","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","clone_to_uninit","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","close","","close_reason","closed","cmp","","","","code","compare","","","","compat","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","compat_mut","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","compat_ref","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","congestion_controller_factory","congestion_events","congestion_state","conn_type","","connect","connect_with_opts","connection_close","crypto","","","crypto_buffer_size","current_mtu","cwnd","data_blocked","datagram","datagram_receive_buffer_size","datagram_send_buffer_size","datagram_send_buffer_space","datagrams","decode","","","default","","","","","","","","","","","","","","default_relay_mode","deref","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","deref_mut","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","description","","","","","","","deserialize","","","","","dir","direct_addresses","discovery","","discovery_dht","discovery_local_network","discovery_n0","discovery_stream","dns_resolver","","drop","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","enable_segmentation_offload","encode","","","eq","","","","","","","","","","","","","","","","","","","","","","","","","","","equivalent","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","error_code","","export_keying_material","finish","fmt","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","force_staging_infra","frame","frame_rx","frame_tx","frame_type","from","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","from_ref","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","from_u32","from_u64","from_u64_unchecked","handshake_data","","handshake_done","has_send_address","hash","","","","","home_relay","id","","ignore","immediate_ack","in_current_span","","","","","","","","","","","","","","","","","","incoming_buffer_size","incoming_buffer_size_total","index","init","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","initial_keys","initial_mtu","initial_rtt","initial_window","initiator","insecure_skip_relay_cert_verify","interval","into","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","into_0rtt","into_any","into_future","","","","","","","","","","into_incoming","into_inner","ios","is_0rtt","is_alive","is_closed","keep_alive_interval","keylog","known_nodes","last_alive","last_control","last_payload","last_received","last_used","latency","","local_ip","lost_bytes","lost_packets","lost_plpmtud_probes","max_ack_delay","max_concurrent_bidi_streams","max_concurrent_uni_streams","max_data","max_datagram_size","max_idle_timeout","max_incoming","max_stream_data","max_streams_bidi","max_streams_uni","max_tls_tickets","metrics","migration","min_mtu","minimum_change","mtu_discovery_config","network_change","network_path_changed","new","","","new_connection_id","new_token","node_addr","node_id","","observed_addr","offset","on_ack","on_congestion_event","on_end_acks","on_mtu_update","on_sent","open","open_bi","open_uni","or","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","packet_threshold","partial_cmp","","","","path","path_challenge","path_response","path_selection","peer_identity","persistent_congestion_threshold","ping","poll","","","","","","","","","poll_flush","poll_read","","poll_shutdown","poll_write","","preferred_address_v4","preferred_address_v6","priority","proxy_from_env","proxy_url","read","read_chunk","read_chunks","read_datagram","read_exact","read_to_end","reason","","","receive_observed_address_reports","receive_window","received_reset","refuse","relay_map","relay_mode","relay_url","remote_address","remote_address_validated","remote_info","remote_info_iter","remote_node_id","reordering_threshold","reset","reset_stream","retire_connection_id","retry","retry_tag","retry_token_lifetime","rtt","","saturating_add","seal","secret_key","","send_datagram","send_fairness","send_observed_address_reports","send_window","sent_packets","sent_plpmtud_probes","serialize","","","","","set_alpns","set_max_concurrent_bi_streams","set_max_concurrent_uni_streams","set_priority","set_receive_window","set_user_data_for_discovery","source","","","","","","","","","","","","","","","sources","","stable_id","start_session","stats","stop","stop_sending","stopped","stream","stream_data_blocked","stream_receive_window","streams_blocked_bidi","streams_blocked_uni","time_source","time_threshold","to_owned","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","to_string","","","","","","","","","","","","","","","","","","","","","","","","","","","token_key","transport","transport_config","","try_from","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","try_into","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","try_poll","","","","","","","try_to_string","","","","","","","","","","","","","","","","","","","","","","","","","","","typ","type_id","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","udp_rx","udp_tx","upper_bound","user_data_for_discovery","validation_token","validation_token_config","vzip","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","window","with_additional_alpns","with_crypto","with_single_cert","with_transport_config","write","write_all","write_all_chunks","write_chunk","write_chunks","backtrace","","","pruned","span_trace","","","backtrace","","","source","span_trace","","","backtrace","","source","","span_trace","","backtrace","","source","","span_trace","","backtrace","","","","source","","","span_trace","","","","backtrace","","","source","","span_trace","","","name","","EndpointMetrics","MagicsockMetrics","NetReportMetrics","PortmapMetrics","RelayMetrics","__clone_box","accepts","actor_link_change","actor_tick_direct_addr_heartbeat","actor_tick_main","actor_tick_msg","actor_tick_other","actor_tick_portmap_changed","actor_tick_re_stun","and","","","","as_iterable","","","borrow","","","","borrow_mut","","","","bytes_recv","bytes_rx_ratelimited_total","bytes_sent","clone","clone_into","clone_to_uninit","compat","","","","compat_mut","","","","compat_ref","","","","connection_became_direct","connection_handshake_success","conns_rx_ratelimited_total","default","","","","deref","","","","deref_mut","","","","deserialize","","","disco_packets_dropped","disco_packets_recv","disco_packets_sent","disconnects","drop","","","","external_address_updated","field_count","","","field_ref","","","fmt","","","","from","","","","from_ref","got_ping","groups","groups_cloned","init","","","","into","","","","local_port_updates","magicsock","mapping_attempts","mapping_failures","name","","","","net_report","nodes_contacted","nodes_contacted_directly","num_direct_conns_added","num_direct_conns_removed","num_relay_conns_added","num_relay_conns_removed","or","","","","other_packets_dropped","other_packets_recv","other_packets_sent","pcp_available","pcp_probes","portmapper","probes_started","recv_data_ipv4","recv_data_ipv6","recv_data_relay","recv_datagrams","recv_disco_bad_key","recv_disco_bad_parse","recv_disco_call_me_maybe","recv_disco_call_me_maybe_bad_disco","recv_disco_ping","recv_disco_pong","recv_disco_relay","recv_disco_udp","recv_gro_datagrams","relay_home_change","send_data","send_data_network_down","send_disco_relay","send_disco_udp","send_ipv4","send_ipv6","send_packets_dropped","send_packets_recv","send_packets_sent","send_relay","send_relay_error","sent_disco_call_me_maybe","sent_disco_ping","sent_disco_pong","sent_disco_relay","sent_disco_udp","sent_pong","serialize","","","to_owned","try_from","","","","try_into","","","","type_id","","","","unique_client_keys","unknown_frames","update_direct_addrs","upnp_available","upnp_gateway_updated","upnp_probes","upnp_probes_failed","vzip","","","","Https","Metrics","Options","Probe","QadIpv4","QadIpv6","QuicConfig","RelayLatencies","Report","__clone_box","","","","","and","","","","","","as_iterable","as_protocols","borrow","","","","","","borrow_mut","","","","","","captive_portal","client_config","clone","","","","","clone_into","","","","","clone_to_uninit","","","","","cmp","compare","compat","","","","","","compat_mut","","","","","","compat_ref","","","","","","default","","","","deref","","","","","","deref_mut","","","","","","deserialize","","","disabled","drop","","","","","","ep","eq","","","equivalent","","","","","","","","","","","","field_count","field_ref","fmt","","","","","","","","from","","","","","","from_ref","","","","","global_v4","global_v6","has_udp","https","init","","","","","","insecure_skip_relay_cert_verify","into","","","","","","ipv4","ipv6","iter","mapping_varies_by_dest","mapping_varies_by_dest_ipv4","mapping_varies_by_dest_ipv6","name","or","","","","","","partial_cmp","preferred_relay","quic_config","relay_latency","reports","reports_full","serialize","","","to_owned","","","","","to_string","","try_from","","","","","","try_into","","","","","","try_to_string","","type_id","","","","","","udp_v4","udp_v6","vzip","","","","","","AttrFromString","DecodingError","","EncodingError","FailedBuildingPacket","IROH_TXT_NAME","InvalidEncodingZ32","InvalidLabel","InvalidLength","InvalidSignature","InvalidTxtEntry","LookupError","LookupFailed","MaxLengthExceededError","NodeData","NodeIdExt","NodeInfo","NotAnIrohRecord","NumLabels","ParseError","","UnexpectedFormat","UserData","Utf8","and","","","","as_error_source","","","","backtrace","","","","borrow","","","","borrow_mut","","","","cause","","","","compat","","","","compat_mut","","","","compat_ref","","","","data","deref","","","","deref_mut","","","","description","","","","drop","","","","fmt","","","","","","","","from","","","","","from_z32","in_current_span","","","","init","","","","into","","","","node_id","or","","","","source","","","","to_string","","","","to_z32","try_from","","","","try_into","","","","try_to_string","","","","type_id","","","","vzip","","","","backtrace","","","len","source","","span_trace","","","backtrace","","source","","span_trace","","backtrace","","","source","","","span_trace","","","backtrace","","","","","","key","label","num_labels","s","source","","span_trace","","","","","","AcceptError","AccessLimit","Connection","DynProtocolHandler","MissingRemoteNodeId","NotAllowed","ProtocolHandler","Router","RouterBuilder","User","__clone_box","","accept","","","","","and","","","","as_error_source","backtrace","borrow","","","","borrow_mut","","","","builder","cause","clone","","clone_into","","clone_to_uninit","","compat","","","","compat_mut","","","","compat_ref","","","","deref","","","","deref_mut","","","","description","drop","","","","endpoint","","fmt","","","","","from","","","","","","","","","from_err","from_ref","","in_current_span","init","","","","into","","","","is_shutdown","new","","on_connecting","","","","or","","","","shutdown","","","","","source","spawn","to_owned","","to_string","try_from","","","","try_into","","","","try_to_string","type_id","","","","vzip","","","","backtrace","source","","","span_trace","CleanupDropGuard","DnsPkarrServer","and","","borrow","","borrow_mut","","compat","","compat_mut","","compat_ref","","deref","","deref_mut","","discovery","dns_resolver","drop","","fmt","","from","","init","","into","","nameserver","node_origin","on_node","or","","pkarr_url","run","run_relay_server","run_relay_server_with","run_with_origin","try_from","","try_into","","type_id","","vzip",""],"q":[[0,"iroh"],[353,"iroh::KeyParsingError"],[361,"iroh::defaults"],[367,"iroh::defaults::prod"],[374,"iroh::defaults::staging"],[379,"iroh::discovery"],[772,"iroh::discovery::DiscoveryError"],[781,"iroh::discovery::IntoDiscoveryError"],[785,"iroh::discovery::ParseError"],[803,"iroh::discovery::dns"],[850,"iroh::discovery::mdns"],[900,"iroh::discovery::pkarr"],[1074,"iroh::discovery::pkarr::PkarrError"],[1081,"iroh::discovery::pkarr::dht"],[1142,"iroh::discovery::static_provider"],[1178,"iroh::dns"],[1224,"iroh::endpoint"],[3358,"iroh::endpoint::AddNodeAddrError"],[3365,"iroh::endpoint::AlpnError"],[3372,"iroh::endpoint::BindError"],[3378,"iroh::endpoint::ConnectError"],[3384,"iroh::endpoint::ConnectWithOptsError"],[3395,"iroh::endpoint::GetMappingAddressError"],[3403,"iroh::endpoint::Source"],[3405,"iroh::metrics"],[3589,"iroh::net_report"],[3797,"iroh::discovery"],[3798,"iroh::node_info"],[3799,"iroh::discovery"],[3800,"iroh::node_info"],[3814,"iroh::discovery"],[3816,"iroh::node_info"],[3818,"iroh::discovery"],[3819,"iroh::node_info"],[3820,"iroh::discovery"],[3821,"iroh::node_info"],[3857,"iroh::discovery"],[3858,"iroh::node_info"],[3900,"iroh::discovery"],[3901,"iroh::node_info"],[3934,"iroh::node_info::DecodingError"],[3943,"iroh::node_info::EncodingError"],[3949,"iroh::node_info::LookupError"],[3958,"iroh::discovery::ParseError"],[3976,"iroh::protocol"],[4106,"iroh::protocol::AcceptError"],[4111,"iroh::test_utils"],[4159,"dyn_clone::sealed"],[4160,"tower_http::follow_redirect::policy::and"],[4161,"tower_http::follow_redirect::policy"],[4162,"iroh_base::key"],[4163,"core::error"],[4164,"backtrace::capture"],[4165,"core::option"],[4166,"iroh_base::relay_url"],[4167,"iroh_base::node_addr"],[4168,"iroh_relay::relay_map"],[4169,"core::cmp"],[4170,"async_compat"],[4171,"core::result"],[4172,"serde_core::de"],[4173,"core::net::socket_addr"],[4174,"core::iter::traits::iterator"],[4175,"alloc::collections::btree::set"],[4176,"core::fmt"],[4177,"ed25519_dalek::verifying"],[4178,"data_encoding"],[4179,"signature::error"],[4180,"ed25519_dalek::signing"],[4181,"iroh_relay::node_info"],[4182,"iroh_base::ticket::node"],[4183,"iroh::magicsock::node_map::node_state"],[4184,"url"],[4185,"core::iter::traits::collect"],[4186,"rand_core"],[4187,"core::marker"],[4188,"n0_watcher"],[4189,"core::clone"],[4190,"alloc::sync"],[4191,"core::hash"],[4192,"core::ops::function"],[4193,"tower_http::follow_redirect::policy::or"],[4194,"core::task::wake"],[4195,"core::task::poll"],[4196,"serde_core::ser"],[4197,"ed25519"],[4198,"alloc::string"],[4199,"alloc::collections"],[4200,"core::any"],[4201,"n0_snafu::spantrace"],[4202,"iroh_relay::dns"],[4203,"alloc::boxed"],[4204,"pkarr::signed_packet"],[4205,"alloc::vec"],[4206,"futures_lite::stream"],[4207,"core::str::error"],[4208,"core::time"],[4209,"pkarr::keys"],[4210,"reqwest::error"],[4211,"http::status"],[4212,"pkarr::client"],[4213,"core::convert"],[4214,"hickory_proto::runtime::tokio_runtime"],[4215,"hickory_resolver::name_server::connection_provider"],[4216,"hickory_resolver::resolver"],[4217,"core::net::ip_addr"],[4218,"reqwest::dns::resolve"],[4219,"core::future::future"],[4220,"core::pin"],[4221,"iroh_quinn_proto::connection"],[4222,"iroh_quinn::connection"],[4223,"iroh_quinn_proto::config"],[4224,"iroh_quinn_proto::config::transport"],[4225,"iroh_quinn_proto::varint"],[4226,"iroh_quinn_proto::connection::stats"],[4227,"iroh::magicsock"],[4228,"iroh_quinn_proto::crypto"],[4229,"iroh_quinn_proto::congestion"],[4230,"std::time"],[4231,"iroh_quinn_proto::connection::assembler"],[4232,"bytes::bytes"],[4233,"iroh_quinn_proto::connection::streams::send"],[4234,"iroh_quinn::recv_stream"],[4235,"iroh_quinn::send_stream"],[4236,"iroh_quinn_proto::connection::streams"],[4237,"iroh::magicsock::node_map"],[4238,"iroh_quinn_proto::frame"],[4239,"iroh_quinn_proto"],[4240,"iroh_quinn_proto::coding"],[4241,"bytes::buf::buf_impl"],[4242,"futures_core::stream"],[4243,"bytes::buf::buf_mut"],[4244,"iroh_quinn::incoming"],[4245,"iroh_quinn_proto::connection::streams::recv"],[4246,"iroh_relay::protos::common"],[4247,"ring::error::unspecified"],[4248,"iroh_quinn_proto::transport_parameters"],[4249,"iroh_quinn_proto::shared"],[4250,"iroh_quinn_proto::connection::paths"],[4251,"std::io::error"],[4252,"tokio::io::read_buf"],[4253,"std::collections::hash::map"],[4254,"rustls_pki_types"],[4255,"rustls::error"],[4256,"iroh_quinn_proto::endpoint"],[4257,"iroh_metrics::metrics"],[4258,"iroh_metrics::iterable"],[4259,"iroh_metrics::base"],[4260,"iroh::net_report::options::imp"],[4261,"iroh::net_report::probes"],[4262,"iroh::net_report::report"],[4263,"iroh::net_report::reportgen"],[4264,"rustls::client::client_conn"],[4265,"iroh::net_report::metrics"],[4266,"iroh_quinn::endpoint"],[4267,"z32"],[4268,"simple_dns::simple_dns_error"],[4269,"hickory_proto::error"],[4270,"tokio::runtime::task::error"],[4271,"iroh::test_utils::dns_and_pkarr_servers"],[4272,"iroh_relay::server"],[4273,"iroh_relay"],[4274,"iroh_relay::defaults"]],"i":"Af0`0`l`````````Fb`1B`BbBdBfBh67432Al217807807785430217854302180754321754321754321743174317854302178543021785430212`778543302178543021807543144``785430212`74321777744443333222211117788543300221177788855544444433022211752247543217537562743807854302167854302164226``44`267854302174316`7514457543158066`5754321783021777785543021785430217830217854302161277854302144I`IbId21210``````````````````Jb`0Jj`````0```J`Jf0``33`3Jd1`4In3Dn5JlIj33628Jn56821Jh:6708:670584:1679320584:1679320:670558493584935849388584:1679320584:1679320584:16793204525844:167933205844:1679320:6705`1584:1679320258493555588884444999933335884::166779320055844444::167793220676744584932848:670584:1679320584:1679320Lb3544`6542454695;278:4319`4Il4704377<892`04657:6;56:<89267::6<389;5427:6<389;542:<8927:6<389;5427527:6<389;542767676LnM`Mb100210Md000MfMhMjMlMnN`413520543210````NfNd10100110101010100101010101010110110101010```NhNj101011001010110101010101010101010100001010101``Kh0000````````00O`OdOf3Nn3Ob3255514032514032104354324324325140325140325140325140325140325`1051403255140325140324325514032514032140343251403242132543255140325140325151403245140322OhOlA@`A@dA@fA@hA@l``AA`0A@n10100101111010101010100101010101010100010010101101001010AAd`0000000000000000000000000000000000```K`000000000000000000000000000000000000000000AId0````AEf``AIj`AHl`ACf``444AHf`1`AGjAH`AEh`````0`4`AEdAGf4AGl4AHb```````AIn0AHh```41AEl40;AGbADdAFfAHdAGd=ADlEdAHhAHjAHlACfAD`AFdACnAHnAI`AIbAIdAIfADnAIhAIjABnAIlAChAIn3ACb220?ADdADf1ADh77ADl;EdAE`4ACd94AN`AMnAClACjANbAKbAGfAKdAJjAGhAGjAGlAGnAJlAH`AHbADfADbAFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAK`AKfAKhAHnAI`ADjAIbAIdAIfADnAIhAIjADhABnAEfAEhAEjAElAIlAC`ACbAKjACdAEdAKlAChAEnAInAGfAKdAGhAGjAGlAGnAH`AHbAHjACfADjAIbAEfAEhAEjAElAEdAEn7543210ADh00AFdAFfAN`AMnAClACjANbAKbAGfAKdAJjAGhAGjAGlAGnAJlAH`AHbADfADbAFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAK`AKfAKhAHnAI`ADjAIbAIdAIfADnAIhAIjADhABnAEfAEhAEjAElAIlAC`ACbAKjACdAEdAKlAChAEnAInAN`AMnAClACjANbAKbAGfAKdAJjAGhAGjAGlAGnAJlAH`AHbADfADbAFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAK`AKfAKhAHnAI`ADjAIbAIdAIfADnAIhAIjADhABnAEfAEhAEjAElAIlAC`ACbAKjACdAEdAKlAChAEnAIn>AFh?AFnAGbAGdADjAEfAEhAEjAEl=:5ADhAGfAGhAGjAGlAGnAH`AHbADb?ADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAHnAI`AIbAIdAIfADnAIhAIjABnAIlAChAInAFlAGfAGhAGjAGlAGnAH`AHbADbAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAHnAI`AIbAIdAIfADnAIhAIjABnAIlAChAInAGfAGhAGjAGlAGnAH`AHbADbAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAHnAI`AIbAIdAIfADnAIhAIjABnAIlAChAIn3111ADb876:0876AN`AMnAClACjANbAKbAGfAKdAJjAGhAGjAGlAGnAJlAH`AHbADfADbAFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAK`AKfAKhAHnAI`ADjAIbAIdAIfADnAIhAIjADhABnAEfAEhAEjAElAIlAC`ACbAKjACdAEdAKlAChAEnAInAN`AMnAClACjANbAKbAGfAKdAJjAGhAGjAGlAGnAJlAH`AHbADfADbAFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAK`AKfAKhAHnAI`ADjAIbAIdAIfADnAIhAIjADhABnAEfAEhAEjAElAIlAC`ACbAKjACdAEdAKlAChAEnAInAN`AMnAClACjANbAKbAGfAKdAJjAGhAGjAGlAGnAJlAH`AHbADfADbAFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAK`AKfAKhAHnAI`ADjAIbAIdAIfADnAIhAIjADhABnAEfAEhAEjAElAIlAC`ACbAKjACdAEdAKlAChAEnAInADfAFf4ABnEd11ADdAId1ACn65522669AGbADb3AIf91258AHdAGdAHhAHjAD`AFdAIjADhAIl`AN`AMnAClACjANbAKbAGfAKdAJjAGhAGjAGlAGnAJlAH`AHbADfADbAFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAK`AKfAKhAHnAI`ADjAIbAIdAIfADnAIhAIjADhABnAEfAEhAEjAElAIlAC`ACbAKjACdAEdAKlAChAEnAInAN`AMnAClACjANbAKbAGfAKdAJjAGhAGjAGlAGnAJlAH`AHbADfADbAFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAK`AKfAKhAHnAI`ADjAIbAIdAIfADnAIhAIjADhABnAEfAEhAEjAElAIlAC`ACbAKjACdAEdAKlAChAEnAInADj>=<;52AHfADlEdAHhAHlAIfABnADh1000101AN`AMnAClACjANbAKbAGfAKdAJj0AGhAGjAGlAGnAJl0AH`AHbADfADbAFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACfAD`AFdACnAK`AKfAKhAHnAI`ADjAIbAIdAIfADnAIhAIjADhABnAEfAEhAEjAElAIlAC`ACbAKjACdAEdAKlAChAEnAInADfADbAIdAIfAGfAGhAGjAGlAGnAH`AHb9AFnAGdAHfADlEdAHhAHjAHlACfAK`AHnAI`AIbAIdAIfADnAIhAIjAInAGf000AGh000AGj000AGl000AGn000AH`000AHb000ADb000AFn000AGd000AHf000ADl000Ed000AHh000AHj000AHl000ACf000AK`000AHn000AI`000AIb000AId000AIf000ADn000AIh000AIj000AIn00087AChAJlAKbAGf0AKd0AJjAGh0AGj0AGl0AGn08AH`0AHb0ADfADb0AFnAGbADdAFfAHdAGdAHf0ADlEdAHh0AHj0AHl0ACf0AD`AFdACnAK`AKfAKhAHn0AI`0ADj0AIb0AId0AIf0ADnAIh0AIjADhABnAEf0AEh0AEj0AEl0AIlAC`ACbAKjACdAEd0AKlAChAEn0AIn`AIbAHd0AHnAN`AMnAClACjANbAKbAGf0AKdAJjAGh0AGj000AGl0AGn0AJlAH`000AHb0ADfADb00000AFnAGbADdAFfAHdAGdAHfADlEdAHhAHjAHlACf00AD`AFdACnAK`AKf0AKhAHn0AI`ADjAIb000AIdAIf0ADnAIhAIjADhABnAEf0AEh00AEj0AElAIlAC`ACbAKjACdAEd0AKlAChAEnAInAGfAGhAGjAGlAGnAH`AHbADbA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{{{b{K`}}ABh}{{ABl{{Kj{ABj}}}}}}{{{b{K`}}{b{Ef}}BnNl}{{Cd{AAnAB`}}}}{bc{}}{c{{Cd{e}}}{}{}}{{}{{Cd{c}}}{}}{bHl}{{}c{}}{CjK`}````````````````````````````````````````````````````````````{{}b}````````````````````````````````````````````````````````````````````````````````````````````````{{bd}f}0000000000000000000000000000000000{{{b{ABn}}}AC`}{ACb{{Cd{ACdACf}}}}{{{b{ACh}}}ACj}{{{b{ACh}}}ACl}{{ACb{Fh{ACn}}}{{Cd{ACdACf}}}}{{{b{AnAD`}}ADb}{{b{AnAD`}}}}{ADdLd}{{{b{AnADf}}{Aj{AD`}}}{{b{AnADf}}}}1{{ADhc}ADhLb}{{{b{ABn}}Bb}{{Cd{fADj}}}}{{{b{ABn}}Bb{b{Cb}}}{{Cd{fADj}}}}{ADlCj}{ADnCj}{EdKn}{{{b{AE`}}{b{{Ad{n}}}}}{{Kj{AEb}}}}{{{b{AnADf}}Bn}{{b{AnADf}}}}{{{b{AnACd}}}{{Cd{{Kn{n}}AEd}}}}{{{b{ACh}}}{{Aj{{Kn{n}}}}}}{{ADh{Kn{{Kn{n}}}}}ADh}{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}0000000000000000000000000000000000000000000000000000000000000{b{{b{Ab}}}}00000000000000000{{{b{ADj}}}{{Aj{{b{Ah}}}}}}{{{b{AEf}}}{{Aj{{b{Ah}}}}}}{{{b{AEh}}}{{Aj{{b{Ah}}}}}}{{{b{AEj}}}{{Aj{{b{Ah}}}}}}{{{b{AEl}}}{{Aj{{b{Ah}}}}}}{{{b{AEd}}}{{Aj{{b{Ah}}}}}}{{{b{AEn}}}{{Aj{{b{Ah}}}}}}{ADh{{Cd{ABnAEj}}}}{{ADhAF`}ADh}{{ADhAFb}ADh}{{{b{AnAFd}}Nl}{{b{AnAFd}}}}{AFfLd}{b{{b{c}}}{}}0000000000000000000000000000000000000000000000000000000000000{{{b{An}}}{{b{Anc}}}{}}0000000000000000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}}}Bj}{{{b{ADn}}{b{ADn}}}Bj}{{{b{AIh}}{b{AIh}}}Bj}{AIbAId}{{b{b{c}}}Bj{}}000{{}{{Bl{c}}}{}}0000000000000000000000000000000000000000000000000000000000000{{{b{An}}}{{Bl{{b{Anc}}}}}{}}0000000000000000000000000000000000000000000000000000000000000{b{{Bl{{b{c}}}}}{}}0000000000000000000000000000000000000000000000000000000000000{{{b{AnADf}}{Fh{AFh}}}{{b{AnADf}}}}{AFfLd}{{{b{ACh}}}{{Kj{AFl}}}}{{{b{ABn}}Lf}{{Aj{{AJ`{AHh}}}}}}{EdAHh}{{{b{ABn}}c{b{{Ad{n}}}}}{{Cd{AChAEh}}}{{AAf{Bb}}}}{{{b{ABn}}c{b{{Ad{n}}}}AIl}{{Cd{ACdAEf}}}{{AAf{Bb}}}}{ADdLd}{nAId}1{ACnFh}{{{b{AnADf}}C`}{{b{AnADf}}}}{AFfIh}:44{{{b{AnADf}}{Aj{C`}}}{{b{AnADf}}}}2{{{b{ACh}}}C`}{AGbLd}{{{b{Anc}}}{{Cd{ADbAJb}}}AJd}{{{b{Anc}}}{{Cd{AIdAJb}}}AJd}{{{b{Anc}}}{{Cd{AIfAJb}}}AJd}{{}ADf}{{}ADb}{{}AGb}{{}ADd}{{}AFf}{{}AHd}{{}AGd}{{}AHh}{{}AHj}{{}AD`}{{}AFd}{{}AIj}{{}ADh}{{}AIl}{{}AIn}{C`{{b{c}}}{}}0000000000000000000000000000000000000000000000000000000000000{C`{{b{Anc}}}{}}0000000000000000000000000000000000000000000000000000000000000{{{b{ADj}}}{{b{Cb}}}}{{{b{AEf}}}{{b{Cb}}}}{{{b{AEh}}}{{b{Cb}}}}{{{b{AEj}}}{{b{Cb}}}}{{{b{AEl}}}{{b{Cb}}}}{{{b{AEd}}}{{b{Cb}}}}{{{b{AEn}}}{{b{Cb}}}}{c{{Cd{AHf}}}Cf}{c{{Cd{ADl}}}Cf}{c{{Cd{Ed}}}Cf}{c{{Cd{AHh}}}Cf}{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7{ADbAIf}8888888{ADjAEf}{AEfAEh}{ACfAEh};{JdAEj}<<<<<<<<{ACfAEd}===={{{b{c}}}c{}}0000000000000000000000000000000000{LjADb}{Ld{{Cd{ADbALj}}}}{LdADb}{{{b{AnACd}}}{{Cd{{Kj{ALl}}ACf}}}}{{{b{ACh}}}{{Aj{{Kj{ALl}}}}}}{ADdn}{{{b{Ed}}}Bn}{{{b{ADb}}{b{Anc}}}fFj}{{{b{AHl}}{b{Anc}}}fFj}{{{b{AIf}}{b{Anc}}}fFj}{{{b{ADn}}{b{Anc}}}fFj}{{{b{AIh}}{b{Anc}}}fFj}{{{b{ABn}}}{{`{{Fb{}{{F`{{Kn{Bd}}}}}}}}}}{{{b{AJj}}}AIf}{{{b{AJl}}}AIf}{ACbf}{ADdLd}{{}}00000000000000000{{{b{AnACn}}Ld}{{b{AnACn}}}}0{AIfLd}{{}C`}0000000000000000000000000000000000000000000000000000000000000{{{b{ALn}}Lj{b{AM`}}}{{Cd{AMbAKh}}}}{{{b{AnADf}}Ih}{{b{AnADf}}}}{{{b{AnADf}}Nl}{{b{AnADf}}}}{{{b{AFl}}}Ld}{AIfAMd}{{ADhBn}ADh}{{{b{AnAFd}}Nl}{{b{AnAFd}}}}{{}c{}}0000000000000000000000000000000000000000000000000000000000000{ACd{{Cd{{E`{AChAKl}}ACd}}}}{{{Kj{AFl}}}{{Kj{ALl}}}}======{ACbc{}}>>>{AKdAMf}{ADbLd}{AGbLd}{{{b{AJj}}}Bn}{{{b{AKb}}}Bn}{{{b{ABn}}}Bn}{{{b{AnADf}}{Aj{Nl}}}{{b{AnADf}}}}<{{ADh{Kn{Bb}}}ADh}{ADlAj}00{{{b{Ed}}}{{Aj{Nl}}}}{EdAj}20{{{b{ACb}}}{{Aj{AAn}}}}{AFfLd}00{{{b{AnAD`}}{Aj{Nl}}}{{b{AnAD`}}}}{{{b{AnADf}}ADb}{{b{AnADf}}}}0{ADdLd}{{{b{ACh}}}{{Aj{C`}}}}{{{b{AnADf}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{Ab}}}}}}{{{b{Ed}}}{{Kn{{E`{AHlNl}}}}}}{ADlANj}{{{b{ACh}}}C`}{{{Fh{ALn}}Lj{b{ANl}}}{{Kj{ANn}}}}{{{b{ACh}}}AHd}{{{b{AnAJj}}ADb}{{Cd{fAHj}}}}{ADdLd}{{{b{AnAJl}}}{{Cd{{Aj{ADb}}AHb}}}}11{{{b{AnADf}}ADb}{{b{AnADf}}}}22{{{b{AnACn}}{Fh{AO`}}}{{b{AnACn}}}}{{{b{AnADf}}AOb}{{b{AnADf}}}}{bc{}}0000000000000000000000000000000000{bHh}00000000000000000000000000{{{b{AnACn}}{Fh{AE`}}}{{b{AnACn}}}}{ACnFh}{{{b{AnACn}}{Fh{ADf}}}{{b{AnACn}}}}{{ADhADf}ADh}{c{{Cd{e}}}{}{}}0000000000000000{AOd{{Cd{ADbALj}}}}{Ld{{Cd{ADbALj}}}}2{C`{{Cd{ADbALj}}}}33333333333333333333333333333333333333333333{{}{{Cd{c}}}{}}0000000000000000000000000000000000000000000000000000000000000{{{ABl{{b{Anc}}}}{b{AnGn}}}H`{}}000000{b{{Cd{HhHj}}}}00000000000000000000000000{ADnAIh}{bHl}0000000000000000000000000000000000000000000000000000000000000{AHdAGb}0{{{b{AnAFd}}Ih}{{b{AnAFd}}}}{{ADhJ`}ADh}{ACnAOf}{{{b{AnACn}}AOf}{{b{AnACn}}}}{{}c{}}0000000000000000000000000000000000000000000000000000000000000{{{b{AFl}}}Ld}{{AIl{Kn{{Kn{n}}}}}AIl}{{{Fh{ALn}}}ACn}{{{Kn{AOh}}AOj}{{Cd{ACnAOl}}}}{{AIl{Fh{ADf}}}AIl}{{{b{AnAJl}}{b{{Ad{n}}}}}{{Cd{C`AH`}}}}{{{b{AnAJl}}{b{{Ad{n}}}}}{{Cd{fAH`}}}}{{{b{AnAJl}}{b{An{Ad{AG`}}}}}{{Cd{fAH`}}}}{{{b{AnAJl}}AG`}{{Cd{fAH`}}}}{{{b{AnAJl}}{b{An{Ad{AG`}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{Cd{e}}}{}{}}000{{}{{Cd{c}}}{}}000{b{{Cd{HhHj}}}}{bHl}000{{}c{}}000{BGbAj}{BGbACf}{BGdAEn}{BGfKj}{BGbIf}``{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}0{b{{b{c}}}{}}0{{{b{An}}}{{b{Anc}}}{}}0{{}{{Bl{c}}}{}}0{{{b{An}}}{{Bl{{b{Anc}}}}}{}}0{b{{Bl{{b{c}}}}}{}}0{C`{{b{c}}}{}}0{C`{{b{Anc}}}{}}0{{{b{BGh}}B`}Ij}{{{b{BGh}}}K`}{C`f}0{{{b{BGj}}{b{AnD`}}}Kb}{{{b{BGh}}{b{AnD`}}}Kb}{cc{}}0{{}C`}0{{}c{}}0{BGhCj}{BGhHh}{{{b{BGh}}{b{Lf}}Nl}{{BGl{f}}}}{g{{Gl{ig}}}{}{}{{j{ce}}}{{j{ce}}}}0{BGhEf}{{}{{BGl{BGh}}}}{{}{{Cd{{E`{BfBdBGn}}BH`}}}}{Bn{{Cd{{E`{BfBdBGn}}BH`}}}}{Hh{{BGl{BGh}}}}{c{{Cd{e}}}{}{}}0{{}{{Cd{c}}}{}}0{bHl}0{{}c{}}0","D":"GM`","p":[[1,"reference",null,null,1],[5,"Private",4159],[1,"unit"],[5,"And",4160],[10,"Policy",4161],[5,"PublicKey",0,4162],[1,"u8"],[1,"array"],[10,"Error",4163],[1,"slice"],[6,"KeyParsingError",0,4162],[5,"Backtrace",4164],[6,"Option",4165,null,1],[5,"RelayUrlParseError",0,4166],[0,"mut"],[5,"SecretKey",0,4162],[5,"NodeAddr",0,4167],[5,"RelayUrl",0,4166],[5,"RelayMap",0,4168],[5,"RelayNode",0,4168],[6,"Ordering",4169],[5,"Compat",4170],[1,"bool"],[1,"usize"],[1,"str"],[6,"Result",4171,null,1],[10,"Deserializer",4172],[17,"Item"],[6,"SocketAddr",4173],[10,"Iterator",4174],[5,"BTreeSet",4175],[5,"Formatter",4176],[5,"Error",4176],[10,"Display",4176],[5,"VerifyingKey",4177],[5,"DecodeError",4178],[5,"Error",4179],[5,"SigningKey",4180],[5,"NodeInfo",3900,4181],[1,"tuple",null,null,1],[5,"NodeTicket",4182],[5,"RemoteInfo",1224,4183],[5,"Url",4184],[10,"IntoIterator",4185],[6,"DecodingError",3901,4181],[10,"CryptoRng",4186],[10,"Sized",4187],[17,"Value"],[10,"Watcher",0,4188],[10,"Clone",4189],[10,"Eq",4169],[5,"Arc",4190,null,1],[10,"Hasher",4191],[5,"InitializedFut",4188],[10,"Nullable",4188],[5,"Map",4188],[5,"Disconnected",4188],[17,"Output"],[10,"Fn",4192],[10,"Send",4187],[10,"Sync",4187],[5,"Or",4193],[5,"Context",4194],[6,"Poll",4195],[10,"Serializer",4196],[5,"Signature",4197],[5,"Stream",4188],[5,"String",4198],[5,"TryReserveError",4199],[5,"TypeId",4200],[5,"NextFut",4188],[15,"Decode",353],[15,"Key",353],[15,"DecodeInvalidLength",353],[5,"SpanTrace",4201],[1,"u16"],[5,"ConcurrentDiscovery",3900],[10,"Discovery",3900],[5,"NodeData",3900,4181],[5,"UserData",3900,4181],[6,"ParseError",3900,4181],[6,"IntoDiscoveryError",3900],[6,"DiscoveryError",3900],[5,"Lagged",3900],[6,"DiscoveryEvent",3900],[5,"DiscoveryItem",3900],[5,"DiscoveryContext",3900],[5,"DnsResolver",1178,4202],[8,"Result",4176],[6,"IrohAttr",4181],[5,"TxtAttrs",4181],[6,"PkarrError",900],[5,"Box",4203,null,1],[5,"SignedPacket",4204],[5,"Vec",4205],[5,"TxtLookup",4202],[10,"IntoDiscovery",3900],[1,"u64"],[8,"NodeId",0,4162],[8,"Boxed",4206],[1,"u32"],[6,"EncodingError",3901,4181],[15,"NoServiceConfigured",772],[15,"NoResults",772],[15,"User",772],[15,"User",781],[15,"UnexpectedFormat",3958],[15,"AttrFromString",3958],[15,"NumLabels",3958],[15,"Utf8",3958],[15,"NotAnIrohRecord",3958],[15,"DecodingError",3958],[5,"Utf8Error",4207],[5,"DnsDiscoveryBuilder",803],[5,"DnsDiscovery",803],[5,"MdnsDiscoveryBuilder",850],[5,"MdnsDiscovery",850],[5,"Duration",4208],[5,"PkarrPublisherBuilder",900],[5,"PkarrPublisher",900],[5,"PkarrResolverBuilder",900],[5,"PkarrResolver",900],[5,"PkarrRelayClient",900],[15,"PublicKey",1074],[6,"PublicKeyError",4209],[15,"Verify",1074],[6,"SignedPacketVerifyError",4204],[15,"HttpSend",1074],[5,"Error",4210],[15,"HttpPayload",1074],[15,"Encoding",1074],[15,"HttpRequest",1074],[5,"StatusCode",4211],[15,"InvalidRelayUrl",1074],[5,"Builder",1081],[5,"DhtDiscovery",1081],[5,"Client",4212],[5,"StaticProvider",1142],[10,"Into",4213,null,1],[5,"TokioRuntimeProvider",4214],[5,"GenericConnector",4215],[5,"Resolver",4216],[6,"IpAddr",4217],[6,"DnsError",4202],[10,"ToString",4198],[5,"StaggeredError",4202],[6,"LookupError",3901,4181],[5,"Name",4218],[10,"Future",4219,null,1],[5,"Pin",4220],[5,"Endpoint",1224],[5,"Accept",1224],[5,"Incoming",1224],[5,"Connecting",1224],[6,"ConnectionError",1224,4221],[5,"Connection",1224],[5,"AcceptBi",1224,4222],[5,"AcceptUni",1224,4222],[5,"ServerConfig",1224,4223],[5,"AckFrequencyConfig",1224,4224],[5,"VarInt",1224,4225],[5,"FrameStats",1224,4226],[5,"TransportConfig",1224,4224],[5,"Builder",1224],[6,"AddNodeAddrError",1224,4227],[5,"DirectAddrInfo",1224,4183],[5,"DirectAddr",1224,4227],[10,"HandshakeTokenKey",1224,4228],[10,"AeadKey",1224,4228],[6,"AlpnError",1224],[6,"ConnectWithOptsError",1224],[6,"ConnectError",1224],[6,"BindError",1224],[6,"GetMappingAddressError",1224],[5,"RemoteNodeIdError",1224],[5,"SocketAddrV4",4173],[5,"SocketAddrV6",4173],[5,"MtuDiscoveryConfig",1224,4224],[5,"PathStats",1224,4226],[10,"ControllerFactory",1224,4229],[5,"Instant",4230],[10,"Controller",1224,4229],[5,"Chunk",1224,4231],[5,"Bytes",4232],[5,"UdpStats",1224,4226],[5,"Written",1224,4233],[6,"SendDatagramError",1224,4222],[6,"ReadToEndError",1224,4234],[6,"ReadError",1224,4234],[6,"ResetError",1224,4234],[6,"ReadExactError",1224,4234],[6,"WriteError",1224,4235],[6,"StoppedError",1224,4235],[5,"ConnectionStats",1224,4226],[6,"ControlMsg",1224,4183],[6,"ConnectionType",1224,4183],[5,"ClosedStream",1224,4236],[6,"Source",1224,4237],[5,"ConnectionClose",1224,4238],[5,"ApplicationClose",1224,4238],[5,"TransportError",1224],[5,"TransportErrorCode",1224],[5,"StreamId",1224,4239],[6,"DirectAddrType",1224,4227],[6,"PathSelection",1224],[5,"ConnectOptions",1224],[6,"RelayMode",1224],[5,"Direct",4188],[5,"UnexpectedEnd",4240],[10,"Buf",4241],[6,"Dir",4239],[10,"Stream",4242],[5,"RecvStream",1224,4234],[5,"SendStream",1224,4235],[10,"BufMut",4243],[5,"ExportKeyingMaterialError",1224,4228],[5,"WeakConnectionHandle",1224,4222],[5,"RetryError",1224,4244],[5,"CryptoError",1224,4228],[5,"UnsupportedVersion",1224,4228],[5,"IncomingFuture",1224],[5,"ZeroRttAccepted",1224],[6,"ReadableError",4245],[6,"FrameType",4246],[6,"Close",4238],[5,"Unspecified",4247],[5,"InvalidFrame",4238],[6,"Error",4248],[5,"VarIntBoundsExceeded",4225],[10,"Any",4200],[10,"CryptoServerConfig",1224],[5,"ConnectionId",4249],[5,"Keys",4228],[6,"Side",4239],[5,"Incoming",4244],[5,"IdleTimeout",4224],[5,"EndpointMetrics",3405],[5,"RttEstimator",4250],[5,"OpenBi",1224,4222],[5,"OpenUni",1224,4222],[5,"ReadDatagram",1224,4222],[5,"Error",4251],[5,"ReadBuf",4252],[1,"i32"],[5,"HashMap",4253],[5,"TransportParameters",4248],[10,"Session",4228],[10,"TimeSource",4223],[1,"f32"],[1,"u128"],[5,"ValidationTokenConfig",4223],[5,"CertificateDer",4254],[6,"PrivateKeyDer",4254],[6,"Error",4255],[15,"Empty",3358],[15,"EmptyPruned",3358],[15,"OwnAddress",3358],[15,"ConnectionError",3365],[15,"Unavailable",3365],[15,"UnknownHandshake",3365],[15,"MagicSpawn",3372],[15,"Discovery",3372],[15,"Connect",3378],[15,"Connection",3378],[15,"AddNodeAddr",3384],[15,"SelfConnect",3384],[15,"NoAddress",3384],[15,"Quinn",3384],[6,"ConnectError",4256],[15,"DiscoveryStart",3395],[15,"Discover",3395],[15,"NoAddress",3395],[15,"Discovery",3403],[15,"NamedApp",3403],[5,"RelayMetrics",3405],[5,"Counter",4257],[5,"MagicsockMetrics",3405],[10,"Iterable",4258],[5,"PortmapMetrics",3405],[5,"MetricItem",4259],[10,"MetricsGroup",4259],[5,"Options",3589,4260],[6,"Probe",3589,4261],[5,"Report",3589,4262],[5,"QuicConfig",3589,4263],[5,"ClientConfig",4264],[5,"RelayLatencies",3589,4262],[5,"Metrics",3589,4265],[5,"Endpoint",4266],[5,"MaxLengthExceededError",3901,4181],[6,"SignedPacketBuildError",4204],[10,"NodeIdExt",3901,4181],[15,"InvalidEncodingZ32",3934],[15,"InvalidLength",3934],[15,"InvalidSignature",3934],[6,"Z32Error",4267],[15,"FailedBuildingPacket",3943],[15,"InvalidTxtEntry",3943],[6,"SimpleDnsError",4268],[15,"ParseError",3949],[15,"LookupFailed",3949],[15,"InvalidLabel",3949],[5,"ProtoError",4269],[10,"ProtocolHandler",3976],[6,"AcceptError",3976],[10,"DynProtocolHandler",3976],[5,"RouterBuilder",3976],[10,"AsRef",4213],[5,"AccessLimit",3976],[5,"Router",3976],[10,"Debug",4176],[5,"JoinError",4270],[15,"Connection",4106],[15,"MissingRemoteNodeId",4106],[15,"User",4106],[5,"DnsPkarrServer",4111,4271],[5,"CleanupDropGuard",4111],[8,"Result",4251],[5,"Server",4272],[6,"SpawnError",4272]],"r":[[0,4162],[1,4162],[2,1224],[3,4162],[4,4162],[5,4162],[6,4167],[7,4162],[8,4162],[9,4168],[10,1224],[11,4168],[12,4166],[13,4166],[14,4162],[15,4188],[16,4188],[17,4162],[18,4162],[19,4167],[20,4166],[21,4168],[22,4168],[23,4162],[24,4162],[25,4162],[26,4167],[27,4166],[28,4166],[29,4168],[30,4168],[31,4162],[32,4162],[33,4166],[34,4162],[35,4162],[36,4166],[37,4162],[38,4162],[39,4162],[40,4162],[41,4167],[42,4166],[43,4166],[44,4168],[45,4168],[46,4162],[47,4162],[48,4162],[49,4167],[50,4166],[51,4166],[52,4168],[53,4168],[54,4162],[55,4166],[56,4162],[57,4162],[58,4167],[59,4166],[60,4168],[61,4168],[62,4162],[63,4162],[64,4167],[65,4166],[66,4168],[67,4168],[68,4162],[69,4162],[70,4167],[71,4166],[72,4168],[73,4168],[74,4162],[75,4167],[76,4166],[77,4168],[78,4162],[79,4167],[80,4166],[81,4168],[82,4162],[83,4162],[84,4162],[85,4167],[86,4166],[87,4166],[88,4168],[89,4168],[90,4162],[91,4162],[92,4162],[93,4167],[94,4166],[95,4166],[96,4168],[97,4168],[98,4162],[99,4162],[100,4162],[101,4167],[102,4166],[103,4166],[104,4168],[105,4168],[106,4168],[108,4162],[109,4162],[110,4162],[111,4162],[112,4167],[113,4166],[114,4166],[115,4166],[116,4168],[117,4168],[118,4162],[119,4162],[120,4162],[121,4167],[122,4166],[123,4166],[124,4168],[125,4168],[126,4162],[127,4166],[128,4162],[129,4162],[130,4167],[131,4166],[132,4168],[133,4167],[134,4167],[137,4162],[138,4162],[139,4162],[140,4167],[141,4166],[142,4166],[143,4168],[144,4168],[145,4168],[147,4162],[148,4167],[149,4166],[150,4168],[151,4168],[152,4162],[153,4162],[154,4162],[155,4162],[156,4167],[157,4167],[158,4167],[159,4167],[160,4166],[161,4166],[162,4166],[163,4166],[164,4168],[165,4168],[166,4168],[167,4168],[168,4168],[169,4168],[170,4168],[171,4168],[172,4162],[173,4162],[174,4162],[175,4162],[176,4162],[177,4167],[178,4166],[179,4166],[180,4166],[181,4166],[182,4168],[183,4168],[184,4168],[185,4168],[186,4162],[187,4162],[188,4162],[189,4162],[190,4162],[191,4162],[192,4162],[193,4162],[194,4162],[195,4167],[196,4167],[197,4167],[198,4167],[199,4167],[200,4167],[201,4166],[202,4166],[203,4166],[204,4168],[205,4168],[206,4168],[207,4168],[208,4168],[209,4162],[210,4162],[211,4168],[212,4168],[213,4167],[214,4162],[215,4162],[216,4167],[217,4166],[218,4168],[219,4168],[220,4162],[221,4162],[222,4166],[223,4162],[224,4162],[225,4188],[226,4168],[227,4162],[228,4167],[229,4166],[230,4162],[231,4166],[232,4162],[233,4162],[234,4162],[235,4167],[236,4166],[237,4166],[238,4168],[239,4168],[240,4188],[241,4162],[242,4162],[243,4162],[244,4167],[245,4166],[246,4166],[247,4168],[248,4168],[249,4188],[250,4167],[251,4168],[252,4168],[253,4188],[256,4167],[257,4167],[258,4273],[259,4168],[260,4188],[261,4162],[262,4162],[263,4162],[264,4167],[265,4166],[266,4166],[267,4168],[268,4168],[269,4162],[270,4167],[271,4166],[272,4168],[273,4188],[275,4162],[276,4162],[277,4168],[278,4167],[279,4167],[280,4162],[281,4162],[282,4162],[283,4167],[284,4166],[285,4168],[286,4162],[287,4162],[288,4166],[289,4188],[290,4188],[292,4162],[293,4162],[294,4162],[295,4167],[296,4166],[297,4168],[298,4168],[299,4162],[300,4162],[301,4166],[302,4166],[303,4168],[304,4168],[305,4162],[306,4162],[307,4162],[308,4162],[309,4162],[310,4162],[311,4162],[312,4167],[313,4166],[314,4166],[315,4168],[316,4168],[317,4162],[318,4162],[319,4162],[320,4167],[321,4166],[322,4166],[323,4168],[324,4168],[325,4162],[326,4162],[327,4166],[328,4166],[329,4168],[330,4168],[331,4162],[332,4162],[333,4162],[334,4167],[335,4166],[336,4166],[337,4168],[338,4168],[339,4188],[340,4168],[341,4168],[342,4162],[343,4162],[344,4162],[345,4162],[346,4167],[347,4166],[348,4166],[349,4168],[350,4168],[351,4167],[352,4167],[364,4274],[379,4181],[381,4181],[392,4181],[395,4181],[396,4181],[397,4181],[398,4181],[399,4181],[400,4181],[403,4181],[404,4181],[405,4181],[406,4181],[407,4181],[411,4181],[412,4181],[413,4181],[414,4181],[415,4181],[423,4181],[427,4181],[428,4181],[432,4181],[433,4181],[434,4181],[435,4181],[443,4181],[444,4181],[445,4181],[446,4181],[454,4181],[458,4181],[459,4181],[460,4181],[461,4181],[464,4181],[465,4181],[466,4181],[469,4181],[470,4181],[471,4181],[474,4181],[475,4181],[476,4181],[477,4181],[478,4181],[479,4181],[487,4181],[488,4181],[489,4181],[490,4181],[498,4181],[499,4181],[500,4181],[501,4181],[509,4181],[510,4181],[512,4181],[513,4181],[514,4181],[515,4181],[516,4181],[525,4181],[526,4181],[527,4181],[528,4181],[529,4181],[537,4181],[541,4181],[544,4181],[545,4181],[546,4181],[547,4181],[556,4181],[557,4181],[558,4181],[561,4181],[562,4181],[563,4181],[564,4181],[565,4181],[566,4181],[567,4181],[568,4181],[569,4181],[570,4181],[571,4181],[572,4181],[581,4181],[582,4181],[583,4181],[584,4181],[585,4181],[586,4181],[597,4181],[598,4181],[599,4181],[600,4181],[601,4181],[602,4181],[603,4181],[604,4181],[605,4181],[606,4181],[620,4181],[621,4181],[622,4181],[623,4181],[624,4181],[628,4181],[629,4181],[630,4181],[631,4181],[635,4181],[636,4181],[637,4181],[638,4181],[646,4181],[647,4181],[648,4181],[649,4181],[659,4181],[663,4181],[664,4181],[668,4181],[670,4181],[671,4181],[672,4181],[673,4181],[681,4181],[686,4181],[690,4181],[691,4181],[692,4181],[699,4181],[701,4181],[702,4181],[703,4181],[706,4181],[707,4181],[708,4181],[712,4181],[713,4181],[714,4181],[715,4181],[716,4181],[717,4181],[725,4181],[726,4181],[727,4181],[728,4181],[736,4181],[737,4181],[741,4181],[742,4181],[743,4181],[744,4181],[752,4181],[755,4181],[756,4181],[757,4181],[758,4181],[766,4181],[767,4181],[768,4181],[769,4181],[770,4181],[771,4181],[805,4202],[806,4202],[1178,4202],[1179,4202],[1180,4202],[1181,4202],[1182,4202],[1183,4202],[1184,4202],[1185,4202],[1186,4202],[1187,4202],[1188,4202],[1189,4202],[1190,4202],[1191,4202],[1192,4202],[1193,4202],[1194,4202],[1195,4202],[1196,4202],[1197,4202],[1198,4202],[1199,4202],[1200,4202],[1201,4202],[1202,4202],[1203,4202],[1204,4202],[1205,4202],[1206,4202],[1207,4202],[1208,4202],[1209,4202],[1210,4202],[1211,4202],[1212,4202],[1213,4202],[1214,4202],[1215,4202],[1216,4202],[1217,4202],[1218,4202],[1219,4202],[1220,4202],[1221,4202],[1222,4202],[1223,4202],[1227,4222],[1228,4222],[1229,4224],[1231,4227],[1232,4228],[1235,4237],[1236,4238],[1237,4221],[1243,4183],[1244,4231],[1245,4221],[1246,4236],[1247,4234],[1248,4235],[1256,4238],[1257,4221],[1258,4221],[1260,4222],[1261,4234],[1262,4234],[1263,4235],[1264,4235],[1265,4226],[1266,4183],[1267,4183],[1268,4229],[1269,4229],[1270,4228],[1274,4183],[1275,4227],[1276,4183],[1277,4227],[1278,4222],[1281,4237],[1285,4227],[1286,4227],[1288,4228],[1292,4234],[1293,4226],[1295,4228],[1298,4234],[1302,4227],[1303,4221],[1304,4225],[1305,4225],[1307,4183],[1308,4224],[1311,4237],[1314,4183],[1315,4222],[1316,4222],[1317,4227],[1320,4226],[1321,4183],[1322,4183],[1323,4227],[1324,4227],[1325,4227],[1327,4234],[1328,4222],[1329,4234],[1330,4234],[1331,4234],[1332,4234],[1333,4234],[1334,4183],[1335,4237],[1338,4183],[1340,4234],[1341,4221],[1342,4234],[1343,4244],[1346,4237],[1348,4222],[1349,4235],[1350,4223],[1351,4237],[1353,4235],[1354,4235],[1355,4239],[1357,4221],[1358,4222],[1359,4234],[1360,4224],[1362,4221],[1364,4237],[1365,4226],[1367,4227],[1369,4222],[1370,4228],[1371,4225],[1372,4221],[1373,4222],[1374,4235],[1375,4233],[1377,4234],[1378,4234],[1379,4235],[1380,4235],[1381,4222],[1382,4234],[1383,4234],[1384,4234],[1385,4234],[1386,4235],[1387,4235],[1388,4225],[1389,4226],[1390,4226],[1391,4226],[1392,4226],[1393,4233],[1394,4183],[1395,4183],[1396,4183],[1397,4183],[1398,4236],[1399,4237],[1400,4221],[1401,4224],[1402,4224],[1403,4223],[1404,4238],[1405,4238],[1408,4239],[1409,4227],[1410,4227],[1421,4224],[1422,4226],[1423,4224],[1424,4226],[1428,4183],[1429,4227],[1430,4183],[1431,4228],[1432,4224],[1436,4222],[1437,4222],[1438,4222],[1439,4222],[1440,4222],[1441,4222],[1442,4222],[1443,4244],[1444,4234],[1445,4234],[1446,4234],[1447,4234],[1448,4234],[1449,4235],[1450,4235],[1451,4235],[1452,4224],[1453,4225],[1454,4231],[1455,4226],[1456,4226],[1457,4226],[1458,4226],[1459,4233],[1460,4183],[1461,4183],[1462,4183],[1463,4183],[1464,4236],[1465,4237],[1466,4221],[1467,4224],[1468,4224],[1469,4223],[1470,4228],[1471,4228],[1472,4228],[1473,4238],[1474,4238],[1475,4227],[1478,4239],[1479,4227],[1480,4227],[1498,4222],[1499,4244],[1500,4234],[1501,4234],[1502,4234],[1503,4234],[1504,4235],[1505,4235],[1506,4236],[1507,4221],[1508,4227],[1516,4227],[1526,4224],[1527,4226],[1528,4222],[1529,4222],[1530,4222],[1531,4222],[1532,4222],[1533,4222],[1534,4222],[1535,4244],[1536,4234],[1537,4234],[1538,4234],[1539,4234],[1540,4234],[1541,4235],[1542,4235],[1543,4235],[1544,4224],[1545,4225],[1546,4231],[1547,4226],[1548,4226],[1549,4226],[1550,4226],[1551,4233],[1552,4183],[1553,4183],[1554,4183],[1555,4183],[1556,4236],[1557,4237],[1558,4221],[1559,4224],[1560,4224],[1561,4223],[1562,4228],[1563,4228],[1564,4228],[1565,4238],[1566,4238],[1567,4227],[1570,4239],[1571,4227],[1572,4227],[1590,4222],[1591,4222],[1592,4222],[1593,4222],[1594,4222],[1595,4222],[1596,4222],[1597,4244],[1598,4234],[1599,4234],[1600,4234],[1601,4234],[1602,4234],[1603,4235],[1604,4235],[1605,4235],[1606,4224],[1607,4225],[1608,4231],[1609,4226],[1610,4226],[1611,4226],[1612,4226],[1613,4233],[1614,4183],[1615,4183],[1616,4183],[1617,4183],[1618,4236],[1619,4237],[1620,4221],[1621,4224],[1622,4224],[1623,4223],[1624,4228],[1625,4228],[1626,4228],[1627,4238],[1628,4238],[1629,4227],[1632,4239],[1633,4227],[1634,4227],[1653,4229],[1655,4231],[1656,4226],[1657,4233],[1658,4227],[1665,4233],[1667,4222],[1668,4234],[1669,4234],[1670,4234],[1671,4234],[1672,4235],[1673,4235],[1674,4225],[1675,4226],[1676,4226],[1677,4226],[1678,4226],[1679,4233],[1680,4183],[1681,4183],[1682,4183],[1683,4183],[1684,4236],[1685,4237],[1686,4221],[1687,4224],[1688,4224],[1689,4223],[1690,4238],[1691,4238],[1694,4239],[1695,4227],[1696,4227],[1702,4229],[1703,4222],[1704,4234],[1705,4234],[1706,4234],[1707,4234],[1708,4235],[1709,4235],[1710,4225],[1711,4226],[1712,4226],[1713,4226],[1714,4226],[1715,4233],[1716,4183],[1717,4183],[1718,4183],[1719,4183],[1720,4236],[1721,4237],[1722,4221],[1723,4224],[1724,4224],[1725,4223],[1726,4238],[1727,4238],[1730,4239],[1731,4227],[1732,4227],[1738,4222],[1739,4234],[1740,4234],[1741,4234],[1742,4234],[1743,4235],[1744,4235],[1745,4225],[1746,4226],[1747,4226],[1748,4226],[1749,4226],[1750,4233],[1751,4183],[1752,4183],[1753,4183],[1754,4183],[1755,4236],[1756,4237],[1757,4221],[1758,4224],[1759,4224],[1760,4223],[1761,4238],[1762,4238],[1765,4239],[1766,4227],[1767,4227],[1777,4225],[1778,4239],[1779,4227],[1780,4227],[1782,4225],[1783,4239],[1784,4227],[1785,4227],[1786,4222],[1787,4222],[1788,4222],[1789,4222],[1790,4222],[1791,4222],[1792,4222],[1793,4244],[1794,4234],[1795,4234],[1796,4234],[1797,4234],[1798,4234],[1799,4235],[1800,4235],[1801,4235],[1802,4224],[1803,4225],[1804,4231],[1805,4226],[1806,4226],[1807,4226],[1808,4226],[1809,4233],[1810,4183],[1811,4183],[1812,4183],[1813,4183],[1814,4236],[1815,4237],[1816,4221],[1817,4224],[1818,4224],[1819,4223],[1820,4228],[1821,4228],[1822,4228],[1823,4238],[1824,4238],[1825,4227],[1828,4239],[1829,4227],[1830,4227],[1848,4222],[1849,4222],[1850,4222],[1851,4222],[1852,4222],[1853,4222],[1854,4222],[1855,4244],[1856,4234],[1857,4234],[1858,4234],[1859,4234],[1860,4234],[1861,4235],[1862,4235],[1863,4235],[1864,4224],[1865,4225],[1866,4231],[1867,4226],[1868,4226],[1869,4226],[1870,4226],[1871,4233],[1872,4183],[1873,4183],[1874,4183],[1875,4183],[1876,4236],[1877,4237],[1878,4221],[1879,4224],[1880,4224],[1881,4223],[1882,4228],[1883,4228],[1884,4228],[1885,4238],[1886,4238],[1887,4227],[1890,4239],[1891,4227],[1892,4227],[1910,4222],[1911,4222],[1912,4222],[1913,4222],[1914,4222],[1915,4222],[1916,4222],[1917,4244],[1918,4234],[1919,4234],[1920,4234],[1921,4234],[1922,4234],[1923,4235],[1924,4235],[1925,4235],[1926,4224],[1927,4225],[1928,4231],[1929,4226],[1930,4226],[1931,4226],[1932,4226],[1933,4233],[1934,4183],[1935,4183],[1936,4183],[1937,4183],[1938,4236],[1939,4237],[1940,4221],[1941,4224],[1942,4224],[1943,4223],[1944,4228],[1945,4228],[1946,4228],[1947,4238],[1948,4238],[1949,4227],[1952,4239],[1953,4227],[1954,4227],[1972,4224],[1973,4226],[1976,4183],[1979,4226],[1981,4226],[1982,4223],[1983,4224],[1984,4226],[1985,4226],[1986,4226],[1987,4226],[1988,4224],[1989,4224],[1991,4226],[1992,4225],[1994,4239],[1995,4224],[1996,4225],[1997,4226],[1998,4226],[1999,4226],[2000,4226],[2001,4233],[2002,4183],[2003,4236],[2004,4224],[2005,4224],[2010,4222],[2011,4222],[2012,4222],[2013,4222],[2014,4222],[2015,4222],[2016,4222],[2017,4244],[2018,4234],[2019,4234],[2020,4234],[2021,4234],[2022,4234],[2023,4235],[2024,4235],[2025,4235],[2026,4224],[2027,4225],[2028,4231],[2029,4226],[2030,4226],[2031,4226],[2032,4226],[2033,4233],[2034,4183],[2035,4183],[2036,4183],[2037,4183],[2038,4236],[2039,4237],[2040,4221],[2041,4224],[2042,4224],[2043,4223],[2044,4228],[2045,4228],[2046,4228],[2047,4238],[2048,4238],[2049,4227],[2052,4239],[2053,4227],[2054,4227],[2072,4222],[2073,4222],[2074,4222],[2075,4222],[2076,4222],[2077,4222],[2078,4222],[2079,4244],[2080,4234],[2081,4234],[2082,4234],[2083,4234],[2084,4234],[2085,4235],[2086,4235],[2087,4235],[2088,4224],[2089,4225],[2090,4231],[2091,4226],[2092,4226],[2093,4226],[2094,4226],[2095,4233],[2096,4183],[2097,4183],[2098,4183],[2099,4183],[2100,4236],[2101,4237],[2102,4221],[2103,4224],[2104,4224],[2105,4223],[2106,4228],[2107,4228],[2108,4228],[2109,4238],[2110,4238],[2111,4227],[2114,4239],[2115,4227],[2116,4227],[2134,4227],[2141,4183],[2142,4183],[2143,4183],[2144,4183],[2145,4237],[2146,4239],[2156,4222],[2157,4222],[2158,4222],[2159,4222],[2160,4222],[2161,4222],[2162,4222],[2163,4244],[2164,4234],[2165,4234],[2166,4234],[2167,4234],[2168,4234],[2169,4234],[2170,4235],[2171,4235],[2172,4235],[2173,4235],[2174,4224],[2175,4225],[2176,4231],[2177,4226],[2178,4226],[2179,4226],[2180,4226],[2181,4233],[2182,4183],[2183,4183],[2184,4183],[2185,4183],[2186,4236],[2187,4237],[2188,4221],[2189,4224],[2190,4224],[2191,4223],[2192,4228],[2193,4228],[2194,4228],[2195,4238],[2196,4238],[2197,4227],[2200,4239],[2201,4227],[2202,4227],[2220,4224],[2221,4225],[2223,4239],[2224,4222],[2225,4234],[2226,4234],[2227,4234],[2228,4234],[2229,4235],[2230,4235],[2231,4225],[2232,4231],[2233,4233],[2234,4183],[2235,4183],[2236,4183],[2237,4183],[2238,4236],[2239,4237],[2240,4221],[2241,4228],[2242,4238],[2243,4238],[2246,4239],[2247,4227],[2248,4227],[2251,4222],[2252,4222],[2253,4222],[2254,4222],[2255,4234],[2256,4234],[2257,4234],[2258,4234],[2259,4234],[2260,4234],[2261,4234],[2262,4234],[2263,4234],[2264,4234],[2265,4234],[2266,4234],[2267,4234],[2268,4234],[2269,4234],[2270,4234],[2271,4235],[2272,4235],[2273,4235],[2274,4235],[2275,4235],[2276,4235],[2277,4235],[2278,4235],[2279,4225],[2280,4225],[2281,4225],[2282,4225],[2283,4231],[2284,4231],[2285,4231],[2286,4231],[2287,4233],[2288,4233],[2289,4233],[2290,4233],[2291,4183],[2292,4183],[2293,4183],[2294,4183],[2295,4183],[2296,4183],[2297,4183],[2298,4183],[2299,4183],[2300,4183],[2301,4183],[2302,4183],[2303,4183],[2304,4183],[2305,4183],[2306,4183],[2307,4236],[2308,4236],[2309,4236],[2310,4236],[2311,4237],[2312,4237],[2313,4237],[2314,4237],[2315,4221],[2316,4221],[2317,4221],[2318,4221],[2319,4228],[2320,4228],[2321,4228],[2322,4228],[2323,4238],[2324,4238],[2325,4238],[2326,4238],[2327,4238],[2328,4238],[2329,4238],[2330,4238],[2339,4239],[2340,4239],[2341,4239],[2342,4239],[2343,4227],[2344,4227],[2345,4227],[2346,4227],[2347,4227],[2348,4227],[2349,4227],[2350,4227],[2359,4238],[2360,4238],[2362,4235],[2363,4222],[2364,4222],[2365,4222],[2366,4244],[2367,4244],[2368,4234],[2369,4234],[2370,4234],[2371,4234],[2372,4234],[2373,4234],[2374,4234],[2375,4234],[2376,4234],[2377,4235],[2378,4235],[2379,4235],[2380,4235],[2381,4235],[2382,4224],[2383,4225],[2384,4225],[2385,4231],[2386,4226],[2387,4226],[2388,4226],[2389,4226],[2390,4233],[2391,4183],[2392,4183],[2393,4183],[2394,4183],[2395,4183],[2396,4183],[2397,4236],[2398,4236],[2399,4237],[2400,4237],[2401,4221],[2402,4221],[2403,4224],[2404,4224],[2405,4223],[2406,4228],[2407,4228],[2408,4228],[2409,4238],[2410,4238],[2411,4238],[2412,4238],[2413,4227],[2414,4227],[2419,4239],[2420,4239],[2421,4227],[2422,4227],[2423,4227],[2449,4226],[2450,4226],[2451,4238],[2452,4222],[2453,4222],[2454,4222],[2455,4222],[2456,4222],[2457,4222],[2458,4222],[2459,4222],[2460,4244],[2461,4234],[2462,4234],[2463,4234],[2464,4234],[2465,4234],[2466,4234],[2467,4234],[2468,4234],[2469,4234],[2470,4234],[2471,4234],[2472,4235],[2473,4235],[2474,4235],[2475,4235],[2476,4235],[2477,4235],[2478,4235],[2479,4224],[2480,4225],[2481,4225],[2482,4225],[2483,4225],[2484,4225],[2485,4225],[2486,4231],[2487,4226],[2488,4226],[2489,4226],[2490,4226],[2491,4233],[2492,4183],[2493,4183],[2494,4183],[2495,4183],[2496,4236],[2497,4237],[2498,4221],[2499,4221],[2500,4221],[2501,4224],[2502,4224],[2503,4223],[2504,4228],[2505,4228],[2506,4228],[2507,4228],[2508,4238],[2509,4238],[2510,4238],[2511,4227],[2517,4239],[2518,4239],[2519,4227],[2520,4227],[2543,4222],[2544,4234],[2545,4234],[2546,4234],[2547,4234],[2548,4235],[2549,4235],[2550,4225],[2551,4226],[2552,4226],[2553,4226],[2554,4226],[2555,4233],[2556,4183],[2557,4183],[2558,4183],[2559,4183],[2560,4236],[2561,4237],[2562,4221],[2563,4224],[2564,4224],[2565,4223],[2566,4238],[2567,4238],[2570,4239],[2571,4227],[2572,4227],[2578,4225],[2579,4225],[2580,4225],[2583,4226],[2584,4183],[2585,4225],[2586,4237],[2587,4239],[2588,4227],[2589,4227],[2591,4234],[2592,4235],[2594,4226],[2595,4222],[2596,4244],[2597,4234],[2598,4234],[2599,4234],[2600,4234],[2601,4235],[2602,4235],[2603,4236],[2604,4221],[2605,4227],[2613,4223],[2614,4223],[2615,4239],[2616,4222],[2617,4222],[2618,4222],[2619,4222],[2620,4222],[2621,4222],[2622,4222],[2623,4244],[2624,4234],[2625,4234],[2626,4234],[2627,4234],[2628,4234],[2629,4235],[2630,4235],[2631,4235],[2632,4224],[2633,4225],[2634,4231],[2635,4226],[2636,4226],[2637,4226],[2638,4226],[2639,4233],[2640,4183],[2641,4183],[2642,4183],[2643,4183],[2644,4236],[2645,4237],[2646,4221],[2647,4224],[2648,4224],[2649,4223],[2650,4228],[2651,4228],[2652,4228],[2653,4238],[2654,4238],[2655,4227],[2658,4239],[2659,4227],[2660,4227],[2679,4224],[2680,4224],[2681,4229],[2682,4239],[2684,4224],[2685,4222],[2686,4222],[2687,4222],[2688,4222],[2689,4222],[2690,4222],[2691,4222],[2692,4244],[2693,4234],[2694,4234],[2695,4234],[2696,4234],[2697,4234],[2698,4235],[2699,4235],[2700,4235],[2701,4224],[2702,4225],[2703,4231],[2704,4226],[2705,4226],[2706,4226],[2707,4226],[2708,4233],[2709,4183],[2710,4183],[2711,4183],[2712,4183],[2713,4236],[2714,4237],[2715,4221],[2716,4224],[2717,4224],[2718,4223],[2719,4228],[2720,4228],[2721,4228],[2722,4238],[2723,4238],[2724,4227],[2727,4239],[2728,4227],[2729,4227],[2748,4229],[2749,4222],[2750,4222],[2751,4222],[2752,4222],[2753,4222],[2759,4244],[2760,4225],[2761,4226],[2762,4234],[2763,4222],[2765,4224],[2768,4183],[2769,4183],[2770,4183],[2771,4183],[2772,4183],[2773,4183],[2774,4183],[2776,4226],[2777,4226],[2778,4226],[2779,4224],[2780,4224],[2781,4224],[2782,4226],[2784,4224],[2785,4223],[2786,4226],[2787,4226],[2788,4226],[2791,4223],[2792,4224],[2793,4224],[2794,4224],[2796,4222],[2797,4223],[2798,4239],[2800,4226],[2801,4226],[2804,4183],[2805,4226],[2806,4231],[2807,4229],[2808,4229],[2809,4229],[2810,4229],[2811,4229],[2812,4228],[2815,4222],[2816,4222],[2817,4222],[2818,4222],[2819,4222],[2820,4222],[2821,4222],[2822,4244],[2823,4234],[2824,4234],[2825,4234],[2826,4234],[2827,4234],[2828,4235],[2829,4235],[2830,4235],[2831,4224],[2832,4225],[2833,4231],[2834,4226],[2835,4226],[2836,4226],[2837,4226],[2838,4233],[2839,4183],[2840,4183],[2841,4183],[2842,4183],[2843,4236],[2844,4237],[2845,4221],[2846,4224],[2847,4224],[2848,4223],[2849,4228],[2850,4228],[2851,4228],[2852,4238],[2853,4238],[2854,4227],[2857,4239],[2858,4227],[2859,4227],[2877,4224],[2878,4225],[2879,4239],[2880,4227],[2881,4227],[2882,4226],[2883,4226],[2884,4226],[2887,4224],[2888,4226],[2889,4222],[2890,4222],[2891,4222],[2892,4222],[2893,4222],[2898,4235],[2899,4234],[2900,4234],[2901,4235],[2902,4235],[2903,4235],[2904,4223],[2905,4223],[2906,4235],[2909,4234],[2910,4234],[2911,4234],[2913,4234],[2914,4234],[2915,4238],[2916,4238],[2918,4224],[2919,4224],[2920,4234],[2924,4183],[2930,4224],[2931,4235],[2932,4226],[2933,4226],[2936,4223],[2938,4226],[2939,4225],[2940,4228],[2944,4224],[2945,4224],[2946,4224],[2947,4226],[2948,4226],[2949,4183],[2950,4183],[2951,4183],[2952,4183],[2953,4237],[2957,4235],[2960,4222],[2961,4234],[2962,4234],[2963,4234],[2964,4234],[2965,4235],[2966,4235],[2967,4221],[2968,4227],[2975,4183],[2976,4183],[2980,4234],[2981,4226],[2982,4235],[2983,4226],[2984,4226],[2985,4224],[2986,4226],[2987,4226],[2988,4223],[2989,4224],[2990,4222],[2991,4234],[2992,4234],[2993,4234],[2994,4234],[2995,4235],[2996,4235],[2997,4225],[2998,4226],[2999,4226],[3000,4226],[3001,4226],[3002,4233],[3003,4183],[3004,4183],[3005,4183],[3006,4183],[3007,4236],[3008,4237],[3009,4221],[3010,4224],[3011,4224],[3012,4223],[3013,4238],[3014,4238],[3017,4239],[3018,4227],[3019,4227],[3025,4222],[3026,4244],[3027,4234],[3028,4234],[3029,4234],[3030,4234],[3031,4235],[3032,4235],[3033,4225],[3034,4183],[3035,4183],[3036,4236],[3037,4237],[3038,4221],[3039,4238],[3040,4238],[3041,4227],[3044,4239],[3045,4227],[3052,4223],[3053,4223],[3054,4223],[3056,4222],[3057,4222],[3058,4222],[3059,4222],[3060,4222],[3061,4222],[3062,4222],[3063,4244],[3064,4234],[3065,4234],[3066,4234],[3067,4234],[3068,4234],[3069,4235],[3070,4235],[3071,4235],[3072,4224],[3073,4225],[3074,4225],[3075,4225],[3076,4225],[3077,4231],[3078,4226],[3079,4226],[3080,4226],[3081,4226],[3082,4233],[3083,4183],[3084,4183],[3085,4183],[3086,4183],[3087,4236],[3088,4237],[3089,4221],[3090,4224],[3091,4224],[3092,4223],[3093,4228],[3094,4228],[3095,4228],[3096,4238],[3097,4238],[3098,4227],[3101,4239],[3102,4227],[3103,4227],[3121,4222],[3122,4222],[3123,4222],[3124,4222],[3125,4222],[3126,4222],[3127,4222],[3128,4244],[3129,4234],[3130,4234],[3131,4234],[3132,4234],[3133,4234],[3134,4235],[3135,4235],[3136,4235],[3137,4224],[3138,4225],[3139,4231],[3140,4226],[3141,4226],[3142,4226],[3143,4226],[3144,4233],[3145,4183],[3146,4183],[3147,4183],[3148,4183],[3149,4236],[3150,4237],[3151,4221],[3152,4224],[3153,4224],[3154,4223],[3155,4228],[3156,4228],[3157,4228],[3158,4238],[3159,4238],[3160,4227],[3163,4239],[3164,4227],[3165,4227],[3183,4222],[3184,4222],[3185,4222],[3186,4222],[3187,4222],[3190,4222],[3191,4244],[3192,4234],[3193,4234],[3194,4234],[3195,4234],[3196,4235],[3197,4235],[3198,4225],[3199,4183],[3200,4183],[3201,4236],[3202,4237],[3203,4221],[3204,4238],[3205,4238],[3206,4227],[3209,4239],[3210,4227],[3217,4227],[3218,4222],[3219,4222],[3220,4222],[3221,4222],[3222,4222],[3223,4222],[3224,4222],[3225,4244],[3226,4234],[3227,4234],[3228,4234],[3229,4234],[3230,4234],[3231,4235],[3232,4235],[3233,4235],[3234,4224],[3235,4225],[3236,4231],[3237,4226],[3238,4226],[3239,4226],[3240,4226],[3241,4233],[3242,4183],[3243,4183],[3244,4183],[3245,4183],[3246,4236],[3247,4237],[3248,4221],[3249,4224],[3250,4224],[3251,4223],[3252,4228],[3253,4228],[3254,4228],[3255,4238],[3256,4238],[3257,4227],[3260,4239],[3261,4227],[3262,4227],[3280,4226],[3281,4226],[3282,4224],[3284,4223],[3285,4223],[3286,4222],[3287,4222],[3288,4222],[3289,4222],[3290,4222],[3291,4222],[3292,4222],[3293,4244],[3294,4234],[3295,4234],[3296,4234],[3297,4234],[3298,4234],[3299,4235],[3300,4235],[3301,4235],[3302,4224],[3303,4225],[3304,4231],[3305,4226],[3306,4226],[3307,4226],[3308,4226],[3309,4233],[3310,4183],[3311,4183],[3312,4183],[3313,4183],[3314,4236],[3315,4237],[3316,4221],[3317,4224],[3318,4224],[3319,4223],[3320,4228],[3321,4228],[3322,4228],[3323,4238],[3324,4238],[3325,4227],[3328,4239],[3329,4227],[3330,4227],[3348,4229],[3350,4223],[3351,4223],[3353,4235],[3354,4235],[3355,4235],[3356,4235],[3357,4235],[3589,4261],[3590,4265],[3591,4260],[3592,4261],[3593,4261],[3594,4261],[3595,4263],[3596,4262],[3597,4262],[3598,4261],[3599,4262],[3600,4262],[3601,4263],[3602,4260],[3603,4265],[3604,4261],[3605,4262],[3606,4262],[3607,4263],[3608,4260],[3609,4265],[3610,4260],[3611,4265],[3612,4261],[3613,4262],[3614,4262],[3615,4263],[3616,4260],[3617,4265],[3618,4261],[3619,4262],[3620,4262],[3621,4263],[3622,4260],[3623,4262],[3624,4263],[3625,4261],[3626,4262],[3627,4262],[3628,4263],[3629,4260],[3630,4261],[3631,4262],[3632,4262],[3633,4263],[3634,4260],[3635,4261],[3636,4262],[3637,4262],[3638,4263],[3639,4260],[3640,4261],[3641,4261],[3642,4265],[3643,4261],[3644,4262],[3645,4262],[3646,4263],[3647,4260],[3648,4265],[3649,4261],[3650,4262],[3651,4262],[3652,4263],[3653,4260],[3654,4265],[3655,4261],[3656,4262],[3657,4262],[3658,4263],[3659,4260],[3660,4265],[3661,4262],[3662,4262],[3663,4260],[3664,4265],[3665,4261],[3666,4262],[3667,4262],[3668,4263],[3669,4260],[3670,4265],[3671,4261],[3672,4262],[3673,4262],[3674,4263],[3675,4260],[3676,4265],[3677,4262],[3678,4262],[3679,4260],[3680,4265],[3681,4261],[3682,4262],[3683,4262],[3684,4263],[3685,4260],[3686,4263],[3687,4261],[3688,4262],[3689,4262],[3690,4261],[3691,4261],[3692,4261],[3693,4261],[3694,4262],[3695,4262],[3696,4262],[3697,4262],[3698,4262],[3699,4262],[3700,4262],[3701,4262],[3702,4265],[3703,4265],[3704,4265],[3705,4261],[3706,4261],[3707,4262],[3708,4262],[3709,4262],[3710,4263],[3711,4260],[3712,4265],[3713,4261],[3714,4262],[3715,4262],[3716,4263],[3717,4260],[3718,4261],[3719,4262],[3720,4262],[3721,4263],[3722,4260],[3723,4262],[3724,4262],[3725,4262],[3726,4260],[3727,4265],[3728,4261],[3729,4262],[3730,4262],[3731,4263],[3732,4260],[3733,4260],[3734,4265],[3735,4261],[3736,4262],[3737,4262],[3738,4263],[3739,4260],[3740,4263],[3741,4263],[3742,4262],[3743,4262],[3744,4262],[3745,4262],[3746,4265],[3747,4265],[3748,4261],[3749,4262],[3750,4262],[3751,4263],[3752,4260],[3753,4261],[3754,4262],[3755,4260],[3756,4262],[3757,4265],[3758,4265],[3759,4265],[3760,4262],[3761,4262],[3762,4261],[3763,4262],[3764,4262],[3765,4263],[3766,4260],[3767,4261],[3768,4262],[3769,4265],[3770,4261],[3771,4262],[3772,4262],[3773,4263],[3774,4260],[3775,4265],[3776,4261],[3777,4262],[3778,4262],[3779,4263],[3780,4260],[3781,4261],[3782,4262],[3783,4265],[3784,4261],[3785,4262],[3786,4262],[3787,4263],[3788,4260],[3789,4262],[3790,4262],[3791,4265],[3792,4261],[3793,4262],[3794,4262],[3795,4263],[3796,4260],[3797,4181],[3798,4181],[3799,4181],[3800,4181],[3801,4181],[3802,4181],[3803,4181],[3804,4181],[3805,4181],[3806,4181],[3807,4181],[3808,4181],[3809,4181],[3810,4181],[3811,4181],[3812,4181],[3813,4181],[3814,4181],[3815,4181],[3816,4181],[3817,4181],[3818,4181],[3819,4181],[3820,4181],[3821,4181],[3822,4181],[3823,4181],[3824,4181],[3825,4181],[3826,4181],[3827,4181],[3828,4181],[3829,4181],[3830,4181],[3831,4181],[3832,4181],[3833,4181],[3834,4181],[3835,4181],[3836,4181],[3837,4181],[3838,4181],[3839,4181],[3840,4181],[3841,4181],[3842,4181],[3843,4181],[3844,4181],[3845,4181],[3846,4181],[3847,4181],[3848,4181],[3849,4181],[3850,4181],[3851,4181],[3852,4181],[3853,4181],[3854,4181],[3855,4181],[3856,4181],[3857,4181],[3858,4181],[3859,4181],[3860,4181],[3861,4181],[3862,4181],[3863,4181],[3864,4181],[3865,4181],[3866,4181],[3867,4181],[3868,4181],[3869,4181],[3870,4181],[3871,4181],[3872,4181],[3873,4181],[3874,4181],[3875,4181],[3876,4181],[3877,4181],[3878,4181],[3879,4181],[3880,4181],[3881,4181],[3882,4181],[3883,4181],[3884,4181],[3885,4181],[3886,4181],[3887,4181],[3888,4181],[3889,4181],[3890,4181],[3891,4181],[3892,4181],[3893,4181],[3894,4181],[3895,4181],[3896,4181],[3897,4181],[3898,4181],[3899,4181],[3900,4181],[3901,4181],[3902,4181],[3903,4181],[3904,4181],[3905,4181],[3906,4181],[3907,4181],[3908,4181],[3909,4181],[3910,4181],[3911,4181],[3912,4181],[3913,4181],[3914,4181],[3915,4181],[3916,4181],[3917,4181],[3918,4181],[3919,4181],[3920,4181],[3921,4181],[3922,4181],[3923,4181],[3924,4181],[3925,4181],[3926,4181],[3927,4181],[3928,4181],[3929,4181],[3930,4181],[3931,4181],[3932,4181],[3933,4181],[4112,4271],[4114,4271],[4116,4271],[4118,4271],[4120,4271],[4122,4271],[4124,4271],[4126,4271],[4128,4271],[4129,4271],[4130,4271],[4132,4271],[4134,4271],[4136,4271],[4138,4271],[4140,4271],[4141,4271],[4142,4271],[4143,4271],[4145,4271],[4146,4271],[4147,4271],[4150,4271],[4152,4271],[4154,4271],[4156,4271],[4158,4271]],"b":[[172,"impl-Debug-for-PublicKey"],[173,"impl-Display-for-PublicKey"],[174,"impl-Debug-for-KeyParsingError"],[175,"impl-Display-for-KeyParsingError"],[178,"impl-Debug-for-RelayUrl"],[179,"impl-Display-for-RelayUrl"],[180,"impl-Debug-for-RelayUrlParseError"],[181,"impl-Display-for-RelayUrlParseError"],[182,"impl-Debug-for-RelayMap"],[183,"impl-Display-for-RelayMap"],[184,"impl-Debug-for-RelayNode"],[185,"impl-Display-for-RelayNode"],[189,"impl-From%3CDecodeError%3E-for-KeyParsingError"],[191,"impl-From%3CError%3E-for-KeyParsingError"],[192,"impl-From%3C%5Bu8;+32%5D%3E-for-SecretKey"],[194,"impl-From%3CSigningKey%3E-for-SecretKey"],[195,"impl-From%3CPublicKey%3E-for-NodeAddr"],[197,"impl-From%3CNodeInfo%3E-for-NodeAddr"],[198,"impl-From%3C(PublicKey,+Option%3CRelayUrl%3E,+%26%5BSocketAddr%5D)%3E-for-NodeAddr"],[199,"impl-From%3CNodeTicket%3E-for-NodeAddr"],[200,"impl-From%3CRemoteInfo%3E-for-NodeAddr"],[204,"impl-From%3CRelayUrl%3E-for-RelayMap"],[206,"impl-From%3CRelayNode%3E-for-RelayMap"],[211,"impl-FromIterator%3CRelayNode%3E-for-RelayMap"],[212,"impl-FromIterator%3CRelayUrl%3E-for-RelayMap"],[306,"impl-TryFrom%3C%26%5Bu8;+32%5D%3E-for-PublicKey"],[307,"impl-TryFrom%3C%26%5Bu8%5D%3E-for-PublicKey"],[582,"impl-Display-for-UserData"],[583,"impl-Debug-for-UserData"],[585,"impl-Debug-for-ParseError"],[586,"impl-Display-for-ParseError"],[588,"impl-Debug-for-IntoDiscoveryError"],[589,"impl-Display-for-IntoDiscoveryError"],[590,"impl-Debug-for-DiscoveryError"],[591,"impl-Display-for-DiscoveryError"],[595,"impl-Debug-for-Lagged"],[596,"impl-Display-for-Lagged"],[600,"impl-From%3C%26TxtAttrs%3CIrohAttr%3E%3E-for-NodeInfo"],[602,"impl-From%3CDiscoveryItem%3E-for-NodeInfo"],[603,"impl-From%3CTxtAttrs%3CIrohAttr%3E%3E-for-NodeInfo"],[604,"impl-From%3CNodeAddr%3E-for-NodeInfo"],[994,"impl-Display-for-PkarrError"],[995,"impl-Debug-for-PkarrError"],[2364,"impl-Display-for-SendDatagramError"],[2365,"impl-Debug-for-SendDatagramError"],[2366,"impl-Debug-for-RetryError"],[2367,"impl-Display-for-RetryError"],[2369,"impl-Debug-for-ReadToEndError"],[2370,"impl-Display-for-ReadToEndError"],[2371,"impl-Debug-for-ReadError"],[2372,"impl-Display-for-ReadError"],[2373,"impl-Debug-for-ResetError"],[2374,"impl-Display-for-ResetError"],[2375,"impl-Display-for-ReadExactError"],[2376,"impl-Debug-for-ReadExactError"],[2378,"impl-Debug-for-WriteError"],[2379,"impl-Display-for-WriteError"],[2380,"impl-Display-for-StoppedError"],[2381,"impl-Debug-for-StoppedError"],[2383,"impl-Debug-for-VarInt"],[2384,"impl-Display-for-VarInt"],[2391,"impl-Display-for-ControlMsg"],[2392,"impl-Debug-for-ControlMsg"],[2395,"impl-Debug-for-ConnectionType"],[2396,"impl-Display-for-ConnectionType"],[2397,"impl-Display-for-ClosedStream"],[2398,"impl-Debug-for-ClosedStream"],[2399,"impl-Display-for-Source"],[2400,"impl-Debug-for-Source"],[2401,"impl-Display-for-ConnectionError"],[2402,"impl-Debug-for-ConnectionError"],[2409,"impl-Debug-for-ConnectionClose"],[2410,"impl-Display-for-ConnectionClose"],[2411,"impl-Debug-for-ApplicationClose"],[2412,"impl-Display-for-ApplicationClose"],[2413,"impl-Display-for-AddNodeAddrError"],[2414,"impl-Debug-for-AddNodeAddrError"],[2415,"impl-Debug-for-TransportError"],[2416,"impl-Display-for-TransportError"],[2417,"impl-Debug-for-TransportErrorCode"],[2418,"impl-Display-for-TransportErrorCode"],[2419,"impl-Debug-for-StreamId"],[2420,"impl-Display-for-StreamId"],[2422,"impl-Debug-for-DirectAddrType"],[2423,"impl-Display-for-DirectAddrType"],[2427,"impl-Display-for-ConnectWithOptsError"],[2428,"impl-Debug-for-ConnectWithOptsError"],[2429,"impl-Debug-for-ConnectError"],[2430,"impl-Display-for-ConnectError"],[2431,"impl-Display-for-BindError"],[2432,"impl-Debug-for-BindError"],[2433,"impl-Display-for-GetMappingAddressError"],[2434,"impl-Debug-for-GetMappingAddressError"],[2440,"impl-Display-for-AlpnError"],[2441,"impl-Debug-for-AlpnError"],[2444,"impl-Display-for-RemoteNodeIdError"],[2445,"impl-Debug-for-RemoteNodeIdError"],[2464,"impl-From%3CConnectionError%3E-for-ReadError"],[2465,"impl-From%3CResetError%3E-for-ReadError"],[2466,"impl-From%3CReadableError%3E-for-ReadError"],[2473,"impl-From%3CStoppedError%3E-for-WriteError"],[2474,"impl-From%3CConnectionError%3E-for-WriteError"],[2476,"impl-From%3CClosedStream%3E-for-WriteError"],[2481,"impl-From%3Cu32%3E-for-VarInt"],[2482,"impl-From%3Cu16%3E-for-VarInt"],[2483,"impl-From%3Cu8%3E-for-VarInt"],[2484,"impl-From%3CFrameType%3E-for-VarInt"],[2485,"impl-From%3CStreamId%3E-for-VarInt"],[2499,"impl-From%3CTransportError%3E-for-ConnectionError"],[2500,"impl-From%3CClose%3E-for-ConnectionError"],[2512,"impl-From%3CTransportErrorCode%3E-for-TransportError"],[2513,"impl-From%3CInvalidFrame%3E-for-TransportError"],[2515,"impl-From%3CError%3E-for-TransportError"],[2526,"impl-From%3CConnectWithOptsError%3E-for-ConnectError"],[2527,"impl-From%3CConnectionError%3E-for-ConnectError"],[2899,"impl-AsyncRead-for-RecvStream"],[2900,"impl-RecvStream"],[2902,"impl-SendStream"],[2903,"impl-AsyncWrite-for-SendStream"],[3073,"impl-TryFrom%3Cu128%3E-for-VarInt"],[3074,"impl-TryFrom%3Cu64%3E-for-VarInt"],[3076,"impl-TryFrom%3Cusize%3E-for-VarInt"],[3705,"impl-Debug-for-Probe"],[3706,"impl-Display-for-Probe"],[3707,"impl-Debug-for-Report"],[3708,"impl-Display-for-Report"],[3874,"impl-Display-for-EncodingError"],[3875,"impl-Debug-for-EncodingError"],[3876,"impl-Display-for-DecodingError"],[3877,"impl-Debug-for-DecodingError"],[3878,"impl-Display-for-MaxLengthExceededError"],[3879,"impl-Debug-for-MaxLengthExceededError"],[3880,"impl-Display-for-LookupError"],[3881,"impl-Debug-for-LookupError"],[4044,"impl-Debug-for-AcceptError"],[4045,"impl-Display-for-AcceptError"],[4049,"impl-From%3CBox%3Cdyn+Error+%2B+Send+%2B+Sync%3E%3E-for-AcceptError"],[4050,"impl-From%3CRemoteNodeIdError%3E-for-AcceptError"],[4052,"impl-From%3CClosedStream%3E-for-AcceptError"],[4053,"impl-From%3CError%3E-for-AcceptError"],[4054,"impl-From%3CConnectionError%3E-for-AcceptError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAFcM8wADAAAACwAAABIADQAhAEkAbQAYAIoABwCUACYAvAAAAL4AAADAAAEAwwABAMYAAQDJAAAAywAAAM8AAQDUAAAA1wAJAOQADAAGAQsAGgEEACABAQAmAR8ATAEHAFgBBwBiAQcAfAEAAH4BAACKAQEAjgEFAJUBBQCdAS0AzAExAP8BHgAhAgoALQIoAFcCAABZAgAAWwICAF8CAABiAgAAZgIAAG8CBAB1AgAAdwIPAJMCAACfAgsArgIAALECAAC1AgMAuwIAAL4CBADEAgQAygIWAOYCCgD0AgoABQMeACgDBQAwAwkAOwMDAEEDAQBFAwEASAMKAFcDBQBfAw4AcAMBAHQDAQB4AwwAhwMEAI4DAACUAxgAsQMoAN0DDADwAwkAAAQDAAcEBgAQBAAAEgQQACUEBQAsBAUAMwQGADwEBgBGBA4AVgQDAFwEAABeBAEAYgQBAGYEAQBpBAAAawQAAG0EBABzBAMAeQQAAHsEDQCLBAAAjQQAAI8EAACRBAEAlAQAAJYEBACeBAMAowQKAK8EAgC/BAAAwQQAAMMEBADPBAEA0wQAANcEAADiBAEA5QQAAOgEAADsBAAAAQUAAAMFAQAGBQEADwUAABsFAAAhBQEAJgUAAC8FAAA8BQAARAUAAFcFAABZBQAAZgUiAI8FAACRBQAAnQVWAPkFewB7BgYAhAYiAKgGRQDyBgMA9wa9ALwHAAC+BwAAwwcBAMkHEADbB4cAbQg/AK4IiQA8CVMAmwkAAJ8JAAChCQIApQkAAKcJAACqCQEArQkBALIJBADECQEAygkAAM0JAADRCQEA1AkAANYJAADeCQIA4gkAAOsJAADwCSIAGAoAABoKBAAjChIAOQo9AL4KCQDfCgAA4woCAPEKAQD2CgAAAAs9AD8LAwBECwEASQsLAFYLAABYCwAAdQsBAIYLBACRCw4ApgsAAKgLAQCrCwEArws9APELEAAEDAAABgxwAJMMPQDXDD0AHw0sAFANAABTDQAAVQ0VAG4NDgCADQ4Akw0DAJgNCQCmDQAAqA0FALYNAwDBDQMAzA0CANANBwDZDQYA4w0GAOsNDwD9DQAAAg4DAA8OCwAcDgsAKg41AGEOBQBoDhgAhw4EAJAOBQCjDgcAsA4VAMgOBQDQDgoA3A4GAOcOBADtDiQAEw8YADEPBwA+DwsASw8HAFcPMgCLDwAAjQ8BAJIPAgCYDw8AqQ8fAMsPBADSDwEA1Q8CANoPBgDqDwUA8w8CAPcPCgADEAwAEhAPACQQAwAqEAEAMRABADgQBwA=","P":[[23,"B,E,P,T"],[31,""],[37,"T"],[38,""],[39,"T"],[54,""],[62,"T"],[68,""],[78,"K"],[82,"T"],[106,""],[109,"T"],[114,""],[115,"T"],[126,""],[128,"D"],[130,"__D"],[133,""],[152,"K"],[172,""],[188,"T"],[189,""],[190,"T"],[191,""],[193,"T"],[194,""],[196,"T"],[197,""],[201,"T"],[202,""],[203,"T"],[204,""],[205,"T"],[206,""],[208,"T"],[209,""],[211,"T"],[213,""],[214,"T"],[220,""],[224,"R"],[225,"Watcher::Value"],[226,""],[227,"H"],[228,"__H"],[230,""],[240,"Watcher::Value,T,W"],[241,"U"],[249,"Watcher::Value"],[250,""],[253,"Watcher::Value,T,"],[256,""],[260,"Watcher::Value,W"],[261,"B,E,P,T"],[269,""],[273,"Watcher::Value"],[275,""],[281,"S"],[283,"__S"],[286,""],[289,"Watcher::Value"],[292,""],[293,"T"],[299,""],[308,"U,T"],[311,""],[312,"U,T"],[317,"U"],[325,""],[339,"Watcher::Value"],[340,""],[343,"V"],[351,""],[352,""],[410,""],[412,"B,E,P,T"],[423,""],[432,"T"],[454,""],[464,"T"],[469,""],[475,"K"],[476,"T"],[509,""],[512,"T"],[514,""],[515,"T"],[522,"Deref::Target"],[523,"T"],[527,""],[528,"T"],[537,""],[561,"K"],[581,""],[597,"T"],[598,""],[599,"T"],[600,""],[601,"T"],[602,""],[605,"T"],[606,""],[607,"T"],[609,""],[610,"T"],[618,""],[622,"T"],[627,""],[630,"__H"],[631,""],[646,"U"],[657,""],[670,"B,E,P,T"],[681,""],[701,"T"],[706,""],[713,"U,T"],[714,""],[715,"U,T"],[725,"U"],[736,""],[755,"V"],[766,""],[807,"B,E,P,T"],[809,"T"],[813,""],[815,"T"],[825,""],[830,"T"],[832,""],[834,"U"],[836,""],[839,"B,E,P,T"],[841,""],[842,"U,T"],[844,"U"],[846,""],[848,"V"],[852,""],[854,"B,E,P,T"],[856,"T"],[860,""],[862,"T"],[868,""],[869,"T"],[873,""],[877,"T"],[879,""],[881,"U"],[883,""],[887,"B,E,P,T"],[889,""],[892,"U,T"],[894,"U"],[896,""],[898,"V"],[900,""],[920,"B,E,P,T"],[926,""],[928,"T"],[940,""],[948,"T"],[951,""],[954,"T"],[984,""],[1001,"T"],[1010,""],[1017,"U"],[1023,""],[1030,"B,E,P,T"],[1036,""],[1042,"T"],[1045,""],[1046,"U,T"],[1052,"U"],[1058,""],[1067,"V"],[1073,""],[1084,"B,E,P,T"],[1086,"T"],[1090,""],[1094,"T"],[1095,""],[1096,"T"],[1102,""],[1104,"T"],[1108,""],[1113,"T"],[1116,""],[1119,"U"],[1121,""],[1125,"B,E,P,T"],[1127,""],[1132,"T"],[1133,"U,T"],[1135,"U"],[1137,""],[1140,"V"],[1144,""],[1145,""],[1146,"B,E,P,T"],[1147,"T"],[1149,""],[1150,"T"],[1151,""],[1152,"T"],[1155,""],[1156,"T"],[1158,""],[1160,"T"],[1161,","],[1162,"T"],[1163,""],[1165,"U"],[1166,""],[1168,"B,E,P,T"],[1169,""],[1172,""],[1173,"T"],[1174,"U,T"],[1175,"U"],[1176,""],[1177,"V"],[1179,""],[1182,"B,E,P,T"],[1183,"T"],[1185,""],[1187,"T"],[1188,""],[1189,"T"],[1192,""],[1193,"T"],[1195,""],[1197,"T"],[1198,""],[1199,"T"],[1200,""],[1201,"U"],[1202,"T"],[1204,""],[1206,"T"],[1207,""],[1208,""],[1212,"T"],[1213,""],[1214,"B,E,P,T"],[1215,""],[1218,"T"],[1219,"U,T"],[1220,"U"],[1221,""],[1222,"V"],[1223,""],[1425,""],[1426,""],[1436,"B,E,P,T"],[1498,""],[1528,"T"],[1652,""],[1703,"T"],[1738,""],[1782,"K"],[1786,"T"],[1972,""],[1977,""],[1979,""],[1992,"B"],[1995,""],[2010,"T"],[2134,""],[2141,"__D"],[2146,""],[2148,""],[2149,""],[2221,"B"],[2224,""],[2251,"K"],[2359,""],[2452,"T"],[2458,""],[2459,"T"],[2462,""],[2463,"T"],[2464,""],[2467,"T"],[2468,""],[2469,"T"],[2470,""],[2471,"T"],[2473,""],[2475,"T"],[2476,""],[2478,"T"],[2481,""],[2486,"T"],[2499,""],[2501,"T"],[2505,""],[2506,"T"],[2508,""],[2509,"T"],[2512,""],[2514,"T"],[2515,""],[2516,"T"],[2517,""],[2518,"T"],[2525,""],[2528,"T"],[2529,""],[2530,"T"],[2538,""],[2539,"T"],[2578,""],[2585,"__H"],[2590,""],[2685,"U"],[2747,""],[2755,"IntoFuture::IntoFuture"],[2756,""],[2815,"B,E,P,T"],[2877,""],[2894,"Future::Output"],[2898,""],[2939,""],[2940,""],[2949,"__S"],[2954,""],[2990,"T"],[3025,""],[3056,"U,T"],[3073,""],[3075,"U,T"],[3076,""],[3077,"U,T"],[3121,"U"],[3183,"F"],[3190,""],[3286,"V"],[3348,""],[3419,"B,E,P,T"],[3423,""],[3426,"T"],[3434,""],[3438,"T"],[3439,""],[3440,"T"],[3452,""],[3459,"T"],[3467,"__D"],[3470,""],[3489,"T"],[3494,""],[3501,"U"],[3505,""],[3520,"B,E,P,T"],[3524,""],[3562,"__S"],[3565,"T"],[3566,"U,T"],[3570,"U"],[3574,""],[3585,"V"],[3598,""],[3603,"B,E,P,T"],[3609,""],[3611,"T"],[3623,""],[3630,"T"],[3635,""],[3641,"K"],[3642,"T"],[3660,""],[3664,"T"],[3676,"__D"],[3679,""],[3690,"K"],[3702,""],[3712,"T"],[3723,""],[3734,"U"],[3740,""],[3747,"B,E,P,T"],[3753,""],[3759,"__S"],[3762,"T"],[3767,""],[3769,"U,T"],[3775,"U"],[3781,""],[3791,"V"],[3802,""],[3821,"B,E,P,T"],[3825,""],[3833,"T"],[3841,""],[3845,"T"],[3857,""],[3858,"T"],[3866,""],[3883,"T"],[3887,""],[3896,"U"],[3900,""],[3901,"B,E,P,T"],[3905,""],[3914,"U,T"],[3918,"U"],[3922,""],[3930,"V"],[3934,""],[3990,","],[3991,"P"],[3992,""],[3993,"B,E,P,T"],[3997,""],[3999,"T"],[4007,""],[4010,"P"],[4011,"T"],[4013,""],[4015,"T"],[4035,""],[4046,"P"],[4047,"T"],[4049,""],[4051,"T"],[4052,""],[4055,"T"],[4059,""],[4064,"U"],[4068,""],[4070,"P,F"],[4071,""],[4073,"P"],[4074,""],[4075,"B,E,P,T"],[4079,""],[4083,"P"],[4084,""],[4086,"T"],[4088,""],[4089,"U,T"],[4093,"U"],[4097,""],[4102,"V"],[4106,""],[4113,"B,E,P,T"],[4115,"T"],[4129,""],[4135,"T"],[4137,""],[4139,"U"],[4141,""],[4144,"B,E,P,T"],[4146,""],[4151,"U,T"],[4153,"U"],[4155,""],[4157,"V"]]}],["iroh_base",{"t":"TPPPGTFIFFFFFINNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNONNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOPTPFGPKPNNNNNNNNNNNNNNNNNNNNNNNMNNNNNNNNNNMNNNNNNNNNNNNOOOOOOOOOOOO","n":["BYTE_SIZE","Decode","DecodeInvalidLength","Key","KeyParsingError","LENGTH","NodeAddr","NodeId","PublicKey","RelayUrl","RelayUrlParseError","SecretKey","Signature","SignatureError","algorithm_identifier","as_bytes","as_error_source","","as_ref","backtrace","","borrow","","","","","","","","borrow_mut","","","","","","","cause","","clone","","","","","clone_into","","","","","clone_to_uninit","","","","","cmp","","","deref","","description","","deserialize","","","","","direct_addresses","","eq","","","","fmt","","","","","","","","","","","","","","fmt_short","from","","","","","","","","","","","","","","","","","","","from_bytes","","","from_components","from_parts","from_slice","from_str","","","","generate","hash","","","in_current_span","","into","","","","","","","is_empty","new","node_id","partial_cmp","","","public","","r_bytes","relay_url","","s_bytes","secret","serialize","","","","","sign","source","","ticket","to_bitstring","to_bytes","","","to_owned","","","","","to_string","","","","","to_vec","try_from","","","","","","","","","","","try_into","","","","","","","type_id","","","","","","","verify","with_direct_addresses","with_relay_url","backtrace","","","source","","span_trace","","","Encoding","KIND","Kind","NodeTicket","ParseError","Postcard","Ticket","Verify","as_error_source","backtrace","borrow","","borrow_mut","","cause","clone","clone_into","clone_to_uninit","description","deserialize","","eq","fmt","","","","from","","","","","from_bytes","","from_str","in_current_span","into","","new","node_addr","serialize","","source","to_bytes","","to_owned","to_string","","try_from","","try_into","","type_id","","verification_failed","wrong_prefix","backtrace","","","","expected","message","source","","span_trace","","",""],"q":[[0,"iroh_base"],[193,"iroh_base::KeyParsingError"],[201,"iroh_base::ticket"],[256,"iroh_base::ticket::ParseError"],[268,"der::asn1::any::allocating"],[269,"spki::algorithm"],[270,"spki::error"],[271,"core::result"],[272,"iroh_base::key"],[273,"core::error"],[274,"backtrace::capture"],[275,"core::option"],[276,"iroh_base::relay_url"],[277,"ed25519"],[278,"iroh_base::node_addr"],[279,"core::cmp"],[280,"serde_core::de"],[281,"core::net::socket_addr"],[282,"core::iter::traits::iterator"],[283,"alloc::collections::btree::set"],[284,"core::fmt"],[285,"ed25519_dalek::signature"],[286,"ed25519_dalek::verifying"],[287,"ed25519_dalek::errors"],[288,"data_encoding"],[289,"ed25519_dalek::signing"],[290,"iroh_base::ticket::node"],[291,"url"],[292,"core::iter::traits::collect"],[293,"signature::error"],[294,"rand_core"],[295,"core::marker"],[296,"core::hash"],[297,"serde_core::ser"],[298,"der::asn1::bit_string::allocating"],[299,"der::error"],[300,"alloc::string"],[301,"alloc::vec"],[302,"core::any"],[303,"n0_snafu::spantrace"],[304,"postcard::error"]],"i":"B`Af00`l````````201Al1203112BbBdBf3645210353642106421064210410405364210116410666644552100334666644555222111100364261664202410536452103111410426116264210253`6662642106450366644452210364521036452103411FjFlFn21210GbGd1``1`111Dn20220002100002200222100202001021000202020222GhGjGlGn30213210","f":"``````````````{b{{j{{f{d}}h}}}}{{{b{l}}}{{b{{A`{n}}}}}}{b{{b{Ab}}}}0{{{b{l}}}{{b{{Ad{n}}}}}}{{{b{Af}}}{{Aj{{b{Ah}}}}}}{{{b{Al}}}{{Aj{{b{Ah}}}}}}{b{{b{c}}}{}}5000000{{{b{An}}}{{b{Anc}}}{}}000000{{{b{Af}}}{{Aj{{b{Ab}}}}}}{{{b{Al}}}{{Aj{{b{Ab}}}}}}{{{b{B`}}}B`}{{{b{l}}}l}{{{b{Bb}}}Bb}{{{b{Bd}}}Bd}{{{b{Bf}}}Bf}{{b{b{Anc}}}Bh{}}0000{{bn}Bh}0000{{{b{l}}{b{l}}}Bj}{{{b{Bd}}{b{Bd}}}Bj}{{{b{Bf}}{b{Bf}}}Bj}{{{b{l}}}{{b{c}}}{}}{{{b{Bf}}}{{b{c}}}{}}{{{b{Af}}}{{b{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{DnGb}}}}{{{b{Bl}}}{{j{Dnc}}}{}}{{}}{{}c{}}08{{{b{Dn}}}{{b{Bd}}}}{{{b{Gd}}}Fd}{{{b{Dn}}c}jEn}{{{b{Gb}}}{{Aj{{b{Ab}}}}}}{{{b{Gd}}}{{Ff{n}}}}{{{b{Dn}}}{{Ff{n}}}}{bc{}}{bFd}0{c{{j{e}}}{}{}}0{{}{{j{c}}}{}}0{bFh}0{{{b{Bl}}}Gb}0{GhAj}{GjAj}{GlAj}{GnAj}{Ghb}{Gnb}{GjGf}{GlDh}{GhG`}{GjG`}{GlG`}{GnG`}","D":"Jb","p":[[1,"reference",null,null,1],[5,"Any",268],[5,"AlgorithmIdentifier",269],[6,"Error",270],[6,"Result",271,null,1],[5,"PublicKey",0,272],[1,"u8"],[1,"array"],[10,"Error",273],[1,"slice"],[6,"KeyParsingError",0,272],[5,"Backtrace",274],[6,"Option",275,null,1],[5,"RelayUrlParseError",0,276],[0,"mut"],[5,"Signature",0,277],[5,"SecretKey",0,272],[5,"NodeAddr",0,278],[5,"RelayUrl",0,276],[1,"unit"],[6,"Ordering",279],[1,"str"],[10,"Deserializer",280],[17,"Item"],[6,"SocketAddr",281],[10,"Iterator",282],[5,"BTreeSet",283],[1,"bool"],[5,"Formatter",284],[5,"Error",284],[8,"Result",284],[10,"Display",284],[5,"InternalSignature",285],[5,"VerifyingKey",286],[8,"SignatureError",0,287],[5,"DecodeError",288],[5,"SigningKey",289],[1,"tuple",null,null,1],[5,"NodeTicket",201,290],[8,"NodeId",0,272],[5,"Url",291],[10,"IntoIterator",292],[5,"Error",293],[10,"CryptoRng",294],[10,"Sized",295],[10,"Hasher",296],[10,"Serializer",297],[5,"BitString",298],[5,"Error",299],[5,"String",300],[5,"Vec",301],[5,"TypeId",302],[15,"Decode",193],[15,"Key",193],[15,"DecodeInvalidLength",193],[5,"SpanTrace",303],[6,"ParseError",201],[10,"Ticket",201],[6,"Error",304],[15,"Kind",256],[15,"Postcard",256],[15,"Encoding",256],[15,"Verify",256]],"r":[[0,277],[1,272],[2,272],[3,272],[4,272],[5,272],[6,278],[7,272],[8,272],[9,276],[10,276],[11,272],[12,277],[13,287],[14,277],[15,272],[16,272],[17,276],[18,272],[19,272],[20,276],[21,277],[22,272],[23,272],[24,272],[25,272],[26,278],[27,276],[28,276],[29,277],[30,272],[31,272],[32,272],[33,278],[34,276],[35,276],[36,272],[37,276],[38,277],[39,272],[40,272],[41,278],[42,276],[43,277],[44,272],[45,272],[46,278],[47,276],[48,277],[49,272],[50,272],[51,278],[52,276],[53,272],[54,278],[55,276],[56,272],[57,276],[58,272],[59,276],[60,277],[61,272],[62,272],[63,278],[64,276],[65,278],[66,278],[67,277],[68,272],[69,278],[70,276],[71,277],[72,277],[73,277],[74,277],[75,272],[76,272],[77,272],[78,272],[79,272],[80,278],[81,276],[82,276],[83,276],[84,276],[85,272],[86,277],[87,277],[88,277],[89,277],[90,272],[91,272],[92,272],[93,272],[94,272],[95,272],[96,272],[97,272],[98,278],[99,278],[100,278],[101,278],[102,276],[103,276],[104,276],[105,277],[106,272],[107,272],[108,277],[109,278],[110,277],[111,277],[112,272],[113,272],[114,276],[115,272],[116,272],[117,278],[118,276],[119,272],[120,276],[121,277],[122,272],[123,272],[124,272],[125,278],[126,276],[127,276],[128,278],[129,278],[130,278],[131,272],[132,278],[133,276],[134,272],[135,272],[136,277],[137,278],[138,278],[139,277],[140,272],[141,277],[142,272],[143,272],[144,278],[145,276],[146,272],[147,272],[148,276],[150,277],[151,277],[152,277],[153,272],[154,277],[155,272],[156,272],[157,278],[158,276],[159,277],[160,272],[161,272],[162,276],[163,276],[164,277],[165,277],[166,277],[167,272],[168,272],[169,272],[170,272],[171,272],[172,272],[173,278],[174,276],[175,276],[176,277],[177,272],[178,272],[179,272],[180,278],[181,276],[182,276],[183,277],[184,272],[185,272],[186,272],[187,278],[188,276],[189,276],[190,272],[191,278],[192,278],[204,290],[211,290],[213,290],[216,290],[217,290],[218,290],[221,290],[222,290],[223,290],[224,290],[227,290],[228,290],[233,290],[234,290],[236,290],[238,290],[239,290],[241,290],[244,290],[245,290],[246,290],[248,290],[250,290],[252,290]],"b":[[71,"impl-UpperHex-for-Signature"],[72,"impl-Debug-for-Signature"],[73,"impl-Display-for-Signature"],[74,"impl-LowerHex-for-Signature"],[75,"impl-Display-for-PublicKey"],[76,"impl-Debug-for-PublicKey"],[77,"impl-Debug-for-KeyParsingError"],[78,"impl-Display-for-KeyParsingError"],[81,"impl-Debug-for-RelayUrl"],[82,"impl-Display-for-RelayUrl"],[83,"impl-Display-for-RelayUrlParseError"],[84,"impl-Debug-for-RelayUrlParseError"],[86,"impl-From%3C%26%5Bu8;+ed25519::::SignatureBytes::%7Bconstant%230%7D%5D%3E-for-Signature"],[87,"impl-From%3C%5Bu8;+ed25519::::SignatureBytes::%7Bconstant%230%7D%5D%3E-for-Signature"],[88,"impl-From%3CInternalSignature%3E-for-Signature"],[93,"impl-From%3CError%3E-for-KeyParsingError"],[94,"impl-From%3CDecodeError%3E-for-KeyParsingError"],[95,"impl-From%3C%5Bu8;+32%5D%3E-for-SecretKey"],[97,"impl-From%3CSigningKey%3E-for-SecretKey"],[98,"impl-From%3C(PublicKey,+Option%3CRelayUrl%3E,+%26%5BSocketAddr%5D)%3E-for-NodeAddr"],[99,"impl-From%3CNodeTicket%3E-for-NodeAddr"],[100,"impl-From%3CPublicKey%3E-for-NodeAddr"],[151,"impl-Signature"],[152,"impl-SignatureEncoding-for-Signature"],[168,"impl-TryFrom%3C%26%5Bu8%5D%3E-for-PublicKey"],[169,"impl-TryFrom%3C%26%5Bu8;+32%5D%3E-for-PublicKey"],[223,"impl-Debug-for-NodeTicket"],[224,"impl-Display-for-NodeTicket"],[225,"impl-Debug-for-ParseError"],[226,"impl-Display-for-ParseError"],[229,"impl-From%3CDecodeError%3E-for-ParseError"],[231,"impl-From%3CError%3E-for-ParseError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAALsAHAAPAAAAEQAwAEQAEQBXAAIAWwAAAF4AAgBiAAEAZQAAAGcAAABwAAMAdQAEAIQAAgCOAAQAlAABAJcAAACZAAAAmwAJAKYAGADCAAcA0gAKAN4ABQDmAAAA6AAAAOoAAgDyAAEA9QAJAAEBAwAGAQYA","P":[[21,"T"],[22,""],[23,"T"],[36,""],[43,"T"],[48,""],[56,"Deref::Target"],[58,""],[60,"D"],[63,"__D"],[65,""],[89,"T"],[90,""],[91,"T"],[93,""],[96,"T"],[97,""],[101,"T"],[102,""],[103,"T"],[105,""],[109,""],[110,""],[112,"FromStr::Err"],[115,"R"],[116,"H"],[117,"__H"],[119,""],[121,"U"],[128,""],[141,"S"],[144,"__S"],[146,""],[154,"T"],[159,""],[165,"U,T"],[166,""],[167,"U,T"],[168,"TryFrom::Error"],[170,"U,T"],[171,"TryFrom::Error"],[172,"U,T"],[176,"U"],[183,""],[191,""],[192,""],[211,"T"],[215,""],[217,"T"],[218,""],[221,"D"],[222,""],[228,"T"],[229,""],[230,"T"],[231,""],[234,"FromStr::Err"],[235,""],[236,"U"],[238,""],[241,"S"],[242,""],[245,"T"],[246,""],[248,"U,T"],[250,"U"],[252,""]]}],["iroh_bench",{"t":"FGGGPPPFPPPPNNNNNNNNNNNNNNNNNNNNNHONNNNNNNNNNNNNNNNNNNNNNNNNNNHNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNONNNNNCOOONNNNNNCOHCCNOONNNNNNNNNNNNNNNNNNNNNONNNNNSHHHHHHSHHHHHHFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFFFNNNONNNNNNOOOONNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNONOOOHOOONNNNNNOONNNNNN","n":["ClientStats","Commands","ConnectionSelector","EndpointSelector","Iroh","","","Opt","Quinn","","","S2n","__clone_box","","and","","","","","augment_args","augment_args_for_update","augment_subcommands","augment_subcommands_for_update","borrow","","","","","borrow_mut","","","","","client_handler","clients","clone","","clone_into","","clone_to_uninit","","close","","command","","command_for_update","","compat","","","","","compat_mut","","","","","compat_ref","","","","","configure_tracing_subscriber","default","deref","","","","","deref_mut","","","","","download_size","drop","","","","","fmt","","from","","","","","from_arg_matches","","from_arg_matches_mut","","from_ref","","group_id","has_subcommand","init","","","","","initial_mtu","into","","","","","iroh","max_streams","metrics","only_relay","or","","","","","print","quinn","read_unordered","rt","s2n","stats","","","streams","to_owned","","try_from","","","","","try_into","","","","","type_id","","","","","update_from_arg_matches","","update_from_arg_matches_mut","","upload_size","vzip","","","","","ALPN","client","connect_client","handle_client_stream","server","server_endpoint","transport_config","ALPN","client","connect_client","handle_client_stream","server","server_endpoint","transport_config","Opt","__clone_box","and","augment_args","augment_args_for_update","borrow","borrow_mut","clone","clone_into","clone_to_uninit","command","command_for_update","compat","compat_mut","compat_ref","deref","deref_mut","drop","fmt","from","from_arg_matches","from_arg_matches_mut","from_ref","group_id","init","into","or","to_owned","try_from","try_into","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","Stats","StreamStats","TransferResult","and","","","avg_chunk_size","borrow","","","borrow_mut","","","chunk_size","chunk_time","chunks","","compat","","","compat_mut","","","compat_ref","","","default","","deref","","","deref_mut","","","drop","","","duration","duration_hist","fmt","","","from","","","init","","","into","","","new","or","","","print","size","stream_finished","stream_stats","streams","throughput","throughput_bps","throughput_hist","total_duration","total_size","try_from","","","try_into","","","ttfb","ttfb_hist","type_id","","","vzip","",""],"q":[[0,"iroh_bench"],[151,"iroh_bench::iroh"],[158,"iroh_bench::quinn"],[165,"iroh_bench::s2n"],[199,"iroh_bench::stats"],[278,"dyn_clone::sealed"],[279,"tower_http::follow_redirect::policy::and"],[280,"tower_http::follow_redirect::policy"],[281,"clap_builder::builder::command"],[282,"n0_snafu::error"],[283,"async_compat"],[284,"core::fmt"],[285,"clap_builder::parser::matches::arg_matches"],[286,"clap_builder"],[287,"core::result"],[288,"clap_builder::util::id"],[289,"core::option"],[290,"tower_http::follow_redirect::policy::or"],[291,"tokio::runtime::runtime"],[292,"core::any"],[293,"iroh_base::node_addr"],[294,"iroh_base::relay_url"],[295,"iroh::endpoint"],[296,"iroh_quinn_proto::config::transport"],[297,"core::net::socket_addr"],[298,"rustls_pki_types"],[299,"iroh_quinn::endpoint"],[300,"iroh_quinn::connection"],[301,"hdrhistogram"],[302,"core::time"]],"i":"````A`AbAl`21000Ad3210Af11224321043210`1212121432121432104321043210`0432104321014321021432102121211243210143210`111432100`1```311214321043210432102121143210```````````````Ej00000000000000000000000000000000```F`ElDl0210210111021021021021210210210012102102102100210202220`12221021001210210","f":"````````````{{bd}f}0{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}0000{ll}000{b{{b{c}}}{}}0000{{{b{n}}}{{b{nc}}}{}}0000{{A`AbAd}{{Ah{Af}}}}{AdAj}{{{b{Al}}}Al}{{{b{Ad}}}Ad}{{b{b{nc}}}f{}}0{{bAn}f}0{A`f}{{{b{Ab}}B`{b{{Bb{An}}}}}f}{{}l}000{{}{{Bd{c}}}{}}0000{{{b{n}}}{{Bd{{b{nc}}}}}{}}0000{b{{Bd{{b{c}}}}}{}}0000{{}f}{{}Af}{Aj{{b{c}}}{}}0000{Aj{{b{nc}}}{}}0000{AdBf}{Ajf}0000{{{b{Al}}{b{nBh}}}Bj}{{{b{Ad}}{b{nBh}}}Bj}{cc{}}0000{{{b{Bl}}}{{C`{AlBn}}}}{{{b{Bl}}}{{C`{AdBn}}}}{{{b{nBl}}}{{C`{AlBn}}}}{{{b{nBl}}}{{C`{AdBn}}}}{{{b{c}}}c{}}0{{}{{Cd{Cb}}}}{{{b{Cf}}}Ch}{{}Aj}0000{AdCj}{{}c{}}0000`{AdAj}{AdCh}0{g{{Cl{ig}}}{}{}{{j{ce}}}{{j{ce}}}}0000{{{b{Af}}Aj}f}`2{{}Cn}``{{{b{Ab}}}f}45{bc{}}0{c{{C`{e}}}{}{}}0000{{}{{C`{c}}}{}}0000{bD`}0000{{{b{nAl}}{b{Bl}}}{{C`{fBn}}}}{{{b{nAd}}{b{Bl}}}{{C`{fBn}}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Bd{{b{nc}}}}}{}}00{b{{Bd{{b{c}}}}}{}}00{{}F`}{{}El}{Aj{{b{c}}}{}}00{Aj{{b{nc}}}{}}00{Ajf}00{DlFb}:{{{b{F`}}{b{nBh}}}Bj}{{{b{El}}{b{nBh}}}Bj}{{{b{Dl}}{b{nBh}}}Bj}{cc{}}00{{}Aj}00{{}c{}}00{{FbBfFbBf}Dl}{g{{Cl{ig}}}{}{}{{j{ce}}}{{j{ce}}}}00{{{b{F`}}{b{Cf}}}f}{DlBf}{{{b{nF`}}Dl}f}{F`El}{F`Aj}{DlFd}{{FbBf}Fd}{ElEn}{F`Fb}{F`Bf}{c{{C`{e}}}{}{}}00{{}{{C`{c}}}{}}00{DlFb}5{bD`}00{{}c{}}00","D":"Dj","p":[[1,"reference",null,null,1],[5,"Private",278],[1,"unit"],[5,"And",279],[10,"Policy",280],[5,"Command",281],[0,"mut"],[6,"EndpointSelector",0],[6,"ConnectionSelector",0],[5,"Opt",0],[5,"ClientStats",0],[8,"Result",282],[1,"usize"],[6,"Commands",0],[1,"u8"],[1,"u32"],[1,"slice"],[5,"Compat",283],[1,"u64"],[5,"Formatter",284],[8,"Result",284],[5,"ArgMatches",285],[8,"Error",286],[6,"Result",287,null,1],[5,"Id",288],[6,"Option",289,null,1],[1,"str"],[1,"bool"],[1,"u16"],[5,"Or",290],[5,"Runtime",291],[5,"TypeId",292],[5,"NodeAddr",293],[5,"RelayUrl",294],[5,"Endpoint",295],[5,"Connection",295],[1,"tuple",null,null,1],[5,"TransferResult",199],[5,"TransportConfig",296],[6,"SocketAddr",297],[5,"CertificateDer",298],[5,"Endpoint",299],[5,"Connection",300],[6,"PrivateKeyDer",298],[5,"Opt",165],[5,"StreamStats",199],[5,"Histogram",301],[5,"Stats",199],[5,"Duration",302],[1,"f64"]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAPEAEQAAACEAJAAmAEwABgBYAAwAawAAAG8ABgB3AAMAfQAUAJMABQCbAAAAngABAKIAAAClABMAugAEAMAAMQD1AAIA+wAbAA==","P":[[14,"B,E,P,T"],[19,""],[23,"T"],[33,""],[37,"T"],[39,""],[47,"T"],[62,""],[64,"T"],[74,""],[82,"T"],[87,""],[91,"T"],[93,""],[101,"U"],[107,""],[110,"B,E,P,T"],[115,""],[124,"T"],[126,"U,T"],[131,"U"],[136,""],[146,"V"],[151,""],[167,"B,E,P,T"],[168,""],[170,"T"],[172,""],[173,"T"],[174,""],[177,"T"],[182,""],[184,"T"],[185,""],[187,"T"],[188,""],[190,"U"],[191,"B,E,P,T"],[192,"T"],[193,"U,T"],[194,"U"],[195,""],[198,"V"],[202,"B,E,P,T"],[205,""],[206,"T"],[212,""],[216,"T"],[225,""],[227,"T"],[233,""],[241,"T"],[244,""],[247,"U"],[250,""],[251,"B,E,P,T"],[254,""],[264,"U,T"],[267,"U"],[270,""],[275,"V"]]}],["iroh_dns_server",{"t":"FNNNNNNNNNNCCNNNNCNNNCNNNNCCNNNNNNGFPPFFFNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONNNNNNNNNNNOONNNNNNOONNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNOFFFFNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNOOOOONNNNNNNNNNNNNNNNNNNNNNNNGPFFFPPGPPPNNNNNNNNNOONNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNFNNNNNNNNOOOOOONNNNOOOONNNOOOOOONNNNFNNNNNNNNNNHNNNNNNFNNNNNNNNNNONNNONONNNNN","n":["ZoneStore","__clone_box","and","borrow","borrow_mut","clone","clone_into","clone_to_uninit","compat","compat_mut","compat_ref","config","dns","fmt","from","from_ref","get_signed_packet","http","in_memory","insert","into","metrics","new","or","persistent","resolve","server","state","to_owned","try_from","try_into","type_id","vzip","with_mainline_fallback","BootstrapOption","Config","Custom","Default","MainlineConfig","MetricsConfig","StoreConfig","__clone_box","and","","","","","bind_addr","bootstrap","borrow","","","","","borrow_mut","","","","","clone","clone_into","clone_to_uninit","compat","","","","","compat_mut","","","","","compat_ref","","","","","data_dir","default","","","","deserialize","","","","","disabled","","dns","enabled","fmt","","","","","from","","","","","from_ref","http","https","into","","","","","load","mainline","metrics","or","","","","","pkarr_put_rate_limit","serialize","","","","","signed_packet_store_path","to_owned","try_from","","","","","try_into","","","","","type_id","","","","","vzip","","","","","zone_store","DnsConfig","DnsHandler","DnsServer","Handle","__clone_box","","","and","","","","answer_request","bind_addr","borrow","","","","borrow_mut","","","","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","compat_mut","","","","compat_ref","","","","default_soa","default_ttl","deserialize","fmt","","","from","","","","from_ref","","","handle_request","into","","","","local_addr","new","or","","","","origins","port","rr_a","rr_aaaa","rr_ns","run_until_done","send_response","serialize","shutdown","spawn","to_owned","","","try_from","","","","try_into","","","","type_id","","","","vzip","","","","CertMode","Disabled","HttpConfig","HttpServer","HttpsConfig","LetsEncrypt","Manual","RateLimitConfig","SelfSigned","Simple","Smart","__clone_box","","","","and","","","","","bind_addr","","borrow","","","","","borrow_mut","","","","","cert_mode","clone","","","","clone_into","","","","clone_to_uninit","","","","compat","","","","","compat_mut","","","","","compat_ref","","","","","default","","deserialize","","","","domains","eq","equivalent","","","","fmt","","","","","from","","","","","from_ref","","","","http_addr","https_addr","into","","","","","letsencrypt_contact","letsencrypt_prod","or","","","","","port","","run_until_done","serialize","","","","shutdown","spawn","to_owned","","","","to_string","try_from","","","","","try_into","","","","","try_to_string","type_id","","","","","vzip","","","","","Metrics","and","as_iterable","borrow","borrow_mut","compat","compat_mut","compat_ref","default","dns_lookup_error","dns_lookup_notfound","dns_lookup_success","dns_requests","dns_requests_https","dns_requests_udp","field_count","field_ref","fmt","from","http_requests","http_requests_duration_ms","http_requests_error","http_requests_success","into","name","or","pkarr_publish_noop","pkarr_publish_update","store_packets_expired","store_packets_inserted","store_packets_removed","store_packets_updated","try_from","try_into","type_id","vzip","Server","and","borrow","borrow_mut","compat","compat_mut","compat_ref","from","into","or","run_until_error","run_with_config_until_ctrl_c","shutdown","spawn","try_from","try_into","type_id","vzip","AppState","__clone_box","and","borrow","borrow_mut","clone","clone_into","clone_to_uninit","compat","compat_mut","compat_ref","dns_handler","from","from_ref","into","metrics","or","store","to_owned","try_from","try_into","type_id","vzip"],"q":[[0,"iroh_dns_server"],[34,"iroh_dns_server::config"],[146,"iroh_dns_server::dns"],[241,"iroh_dns_server::http"],[376,"iroh_dns_server::metrics"],[412,"iroh_dns_server::server"],[430,"iroh_dns_server::state"],[453,"dyn_clone::sealed"],[454,"tower_http::follow_redirect::policy::and"],[455,"tower_http::follow_redirect::policy"],[456,"iroh_dns_server::store"],[457,"async_compat"],[458,"core::fmt"],[459,"pkarr::signed_packet"],[460,"core::option"],[461,"n0_snafu::error"],[462,"alloc::sync"],[463,"tower_http::follow_redirect::policy::or"],[464,"std::path"],[465,"core::convert"],[466,"hickory_proto::rr::domain::name"],[467,"hickory_proto::rr::record_type"],[468,"hickory_proto::rr::rr_set"],[469,"core::result"],[470,"core::any"],[471,"serde_core::de"],[472,"iroh_dns_server::http::rate_limiting"],[473,"serde_core::ser"],[474,"hickory_server::server::request_handler"],[475,"bytes::bytes"],[476,"alloc::string"],[477,"core::future::future"],[478,"alloc::boxed"],[479,"core::pin"],[480,"hickory_server::server::response_handler"],[481,"core::net::socket_addr"],[482,"alloc::vec"],[483,"hickory_server::authority::message_response"],[484,"hickory_proto::rr::resource"],[485,"core::iter::traits::iterator"],[486,"core::marker"],[487,"iroh_dns_server::http::tls"],[488,"alloc::collections"],[489,"iroh_metrics::iterable"],[490,"iroh_metrics::metrics"],[491,"iroh_metrics::base"]],"i":"`n000000000``0000`000`0000``000000``Cd0```CjCn1CfCh4102310423104333231042310423104223042310411202310423104322231042222310422310423231042310423104231042````DbDhDnEl321230321032132132132103210321032133332103213212032102032133333013003210321032103210321`Dd```Gb0`01110FnG`Gf43212104321043211432143214321043210432104321444321133333433210432143210004321110432121043210043213043210432130432104321`An0000000000000000000000000000000000`Hf000000000`000000`Gh000000000000000000000","f":"`{{bd}f}{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}{b{{b{c}}}{}}{{{b{l}}}{{b{lc}}}{}}{{{b{n}}}n}{{b{b{lc}}}f{}}{{bA`}f}{{}{{Ab{c}}}{}}{{{b{l}}}{{Ab{{b{lc}}}}}{}}{b{{Ab{{b{c}}}}}{}}``{{{b{n}}{b{lAd}}}Af}{cc{}}{{{b{c}}}c{}}{{{b{n}}{b{`}}}{{Al{{Aj{Ah}}}}}}```{{}c{}}``{g{{Bd{ig}}}{}{}{{j{ce}}}{{j{ce}}}}`{{{b{n}}{b{`}}{b{Bj}}Bl}{{Al{{Aj{{B`{Bn}}}}}}}}``{bc{}}{c{{C`{e}}}{}{}}{{}{{C`{c}}}{}}{bCb}{{}c{}}{{nCd}n}```````{{bd}f}{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}0000{CfAj}{ChAj}{b{{b{c}}}{}}0000{{{b{l}}}{{b{lc}}}{}}0000{{{b{Cj}}}Cj}{{b{b{lc}}}f{}}{{bA`}f}{{}{{Ab{c}}}{}}0000{{{b{l}}}{{Ab{{b{lc}}}}}{}}0000{b{{Ab{{b{c}}}}}{}}0000{{}{{Al{Cl}}}}{{}Cn}{{}Cj}{{}Ch}{{}Cd}{c{{C`{Cn}}}D`}{c{{C`{Cj}}}D`}{c{{C`{Cf}}}D`}{c{{C`{Ch}}}D`}{c{{C`{Cd}}}D`}{{}Cf}{CfBb}{CnDb}{ChBb}{{{b{Cn}}{b{lAd}}}Af}{{{b{Cj}}{b{lAd}}}Af}{{{b{Cf}}{b{lAd}}}Af}{{{b{Ch}}{b{lAd}}}Af}{{{b{Cd}}{b{lAd}}}Af}{cc{}}0000{{{b{c}}}c{}}{CnAj}0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{}}{{{b{An}}}{{b{Hd}}}}{g{{Bd{ig}}}{}{}{{j{ce}}}{{j{ce}}}}777777{c{{C`{e}}}{}{}}{{}{{C`{c}}}{}}{bCb}{{}c{}}`{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}{b{{b{c}}}{}}{{{b{l}}}{{b{lc}}}{}}{{}{{Ab{c}}}{}}{{{b{l}}}{{Ab{{b{lc}}}}}{}}{b{{Ab{{b{c}}}}}{}}=<:{Hf{{Al{f}}}}{Cn{{Al{f}}}}1{{Cnn{B`{An}}}{{Al{Hf}}}}<;:9`{{bd}f}987{{{b{Gh}}}Gh}{{b{b{lc}}}f{}}{{bA`}f}987{GhDh}{cc{}}{{{b{c}}}c{}}{{}c{}}{GhB`}{g{{Bd{ig}}}{}{}{{j{ce}}}{{j{ce}}}}{Ghn}{bc{}}{c{{C`{e}}}{}{}}{{}{{C`{c}}}{}}{bCb}{{}c{}}","D":"AAl","p":[[1,"reference",null,null,1],[5,"Private",453],[1,"unit"],[5,"And",454],[10,"Policy",455],[0,"mut"],[5,"ZoneStore",0,456],[1,"u8"],[5,"Compat",457],[5,"Formatter",458],[8,"Result",458],[5,"SignedPacket",459],[6,"Option",460,null,1],[8,"Result",461],[5,"Metrics",376],[5,"Arc",462,null,1],[1,"bool"],[5,"Or",463],[5,"Path",464],[10,"AsRef",465],[5,"Name",466],[6,"RecordType",467],[5,"RecordSet",468],[6,"Result",469,null,1],[5,"TypeId",470],[6,"BootstrapOption",34],[5,"MetricsConfig",34],[5,"MainlineConfig",34],[5,"StoreConfig",34],[5,"PathBuf",464],[5,"Config",34],[10,"Deserializer",471],[5,"DnsConfig",146],[6,"RateLimitConfig",241,472],[10,"Serializer",473],[5,"DnsHandler",146],[5,"Request",474],[5,"Bytes",475],[5,"Handle",146],[5,"String",476],[1,"u32"],[10,"Future",477,null,1],[5,"Box",478,null,1],[5,"Pin",479],[10,"ResponseHandler",480],[5,"DnsServer",146],[6,"SocketAddr",481],[5,"Vec",482],[1,"u16"],[5,"MessageResponse",483],[17,"Item"],[5,"Record",484],[10,"Iterator",485],[10,"Send",486],[5,"HttpConfig",241],[5,"HttpsConfig",241],[6,"CertMode",241,487],[5,"Error",458],[5,"HttpServer",241],[5,"AppState",430],[5,"TryReserveError",488],[10,"Iterable",489],[5,"Counter",490],[1,"usize"],[5,"MetricItem",491],[1,"str"],[5,"Server",412]],"r":[[0,456],[1,456],[2,456],[3,456],[4,456],[5,456],[6,456],[7,456],[8,456],[9,456],[10,456],[13,456],[14,456],[15,456],[16,456],[18,456],[19,456],[20,456],[22,456],[23,456],[24,456],[25,456],[28,456],[29,456],[30,456],[31,456],[32,456],[33,456],[241,487],[242,472],[246,487],[247,487],[248,472],[249,487],[250,472],[251,472],[252,472],[253,487],[257,472],[258,487],[264,472],[265,487],[269,472],[270,487],[274,472],[275,487],[278,472],[279,487],[282,472],[283,487],[287,472],[288,487],[292,472],[293,487],[297,472],[298,487],[301,472],[302,472],[303,472],[304,487],[308,487],[309,487],[310,487],[311,487],[312,487],[313,472],[314,487],[315,487],[319,472],[320,487],[323,472],[324,487],[330,472],[331,487],[337,472],[338,487],[344,472],[345,487],[350,472],[351,487],[354,487],[356,472],[357,487],[361,472],[362,487],[365,487],[367,472],[368,487],[372,472],[373,487]],"b":[[301,"impl-Default-for-%26RateLimitConfig"],[302,"impl-Default-for-RateLimitConfig"],[314,"impl-Debug-for-CertMode"],[315,"impl-Display-for-CertMode"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAADcBKAACAAkADgAAABAAAAAYAAAAHQAEACoABQAyABsATwAIAFwABABmAAAAcQAEAHcABAB9ABQAlwAGAKAAHAC/AAMAxwADANEAAwDbAAEA3wASAP0ACAAIAQkAEwEgADUBCQBEAQMAUQEEAFkBAwBfAQ4AbwEJAHoBBwCIAQIAkQEBAJkBAwCeAQUApgEAAKsBAwCwAQkAvAEAAL8BAADBAQQA","P":[[2,"B,E,P,T"],[3,"T"],[5,""],[6,"T"],[7,""],[8,"T"],[13,""],[14,"T"],[16,""],[20,"U"],[22,""],[23,"B,E,P,T"],[24,""],[25,""],[28,"T"],[29,"U,T"],[30,"U"],[31,""],[32,"V"],[33,""],[42,"B,E,P,T"],[47,""],[49,"T"],[59,""],[60,"T"],[61,""],[62,"T"],[77,""],[82,"__D"],[87,""],[96,"T"],[102,""],[104,"U"],[109,""],[110,""],[112,"B,E,P,T"],[117,""],[118,"__S"],[123,""],[124,"T"],[125,"U,T"],[130,"U"],[135,""],[140,"V"],[145,""],[153,"B,E,P,T"],[157,""],[159,"T"],[167,""],[170,"T"],[173,""],[176,"T"],[188,""],[190,"__D"],[191,""],[194,"T"],[201,"R"],[202,"U"],[206,""],[208,"B,E,P,T"],[212,""],[218,",,,"],[219,"__S"],[220,""],[222,"T"],[225,"U,T"],[229,"U"],[233,""],[237,"V"],[252,""],[256,"B,E,P,T"],[261,""],[263,"T"],[273,""],[278,"T"],[282,""],[286,"T"],[301,""],[303,"__D"],[307,""],[309,"K"],[313,""],[318,"T"],[327,""],[329,"U"],[334,""],[336,"B,E,P,T"],[341,""],[344,"__S"],[348,""],[350,"T"],[354,""],[355,"U,T"],[360,"U"],[365,""],[371,"V"],[377,"B,E,P,T"],[378,""],[379,"T"],[384,""],[394,"T"],[395,""],[399,"U"],[400,""],[401,"B,E,P,T"],[402,""],[408,"U,T"],[409,"U"],[410,""],[411,"V"],[413,"B,E,P,T"],[414,"T"],[420,"U"],[421,"B,E,P,T"],[422,""],[426,"U,T"],[427,"U"],[428,""],[429,"V"],[431,""],[432,"B,E,P,T"],[433,"T"],[435,""],[436,"T"],[437,""],[438,"T"],[441,""],[442,"T"],[444,"U"],[445,""],[446,"B,E,P,T"],[447,""],[448,"T"],[449,"U,T"],[450,"U"],[451,""],[452,"V"]]}],["iroh_relay",{"t":"EFFFFNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNN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PPGPPPPPPPSPPPPPGPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOSPPGSSFPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOOOOOOOGGPPPPGFSPPPPFPPFPPPFPFFPFPFFGGPFPNNNOOOONNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOONNONONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNONNONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOOONONNNNNNNNNNNNNNNNNOOOONOONNOOOOOOONNNNNNCONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOHHHHH","n":["MAX_PACKET_SIZE","PingTracker","RelayMap","RelayNode","RelayQuicConfig","__clone_box","","","and","","","","borrow","","","","borrow_mut","","","","client","clone","","","clone_into","","","clone_to_uninit","","","cmp","","compare","","compat","","","","compat_mut","","","","compat_ref","","","","contains_node","default","","default_timeout","defaults","deref","","","","deref_mut","","","","deserialize","","dns","drop","","","","empty","eq","","","equivalent","","","","","","","","","","","","fmt","","","","","","from","","","","","","","from_iter","","get_node","http","init","","","","into","","","","is_empty","len","new","new_ping","node_info","nodes","or","","","","partial_cmp","","pong_received","port","protos","quic","","serialize","","server","timeout","to_owned","","","to_string","","try_from","","","","try_into","","","","try_to_string","","type_id","","","","url","urls","vzip","","","","Client","ClientBuilder","ClientSink","ClientStream","ConnectError","Dial","DialError","Dns","EmptyPacket","ExceedsMaxPacketSize","Handshake","InvalidRelayUrl","InvalidTargetPort","InvalidTlsServername","InvalidUrl","InvalidWebsocketUrl","Io","NoLocalAddr","Protocol","ProxyConnect","ProxyConnectInvalidStatus","ProxyInvalidTargetPort","ProxyInvalidTlsServername","ProxyInvalidUrl","RecvError","SendError","StreamError","","Timeout","Tls","UnexpectedUpgradeStatus","Upgrade","Websocket","__clone_box","address_family_selector","and","","","","","","","","as_error_source","","","","backtrace","","","","borrow","","","","","","","","borrow_mut","","","","","","","","cause","","","","clone","clone_into","clone_to_uninit","compat","","","","","","","","compat_mut","","","","","","","","compat_ref","","","","","","","","connect","deref","","","","","","","","deref_mut","","","","","","","","description","","","","drop","","","","","","","","fmt","","","","","","","","","","","","from","","","","","","","","","","","","","","","","","in_current_span","","","","init","","","","","","","","insecure_skip_cert_verify","into","","","","","","","","key_cache_capacity","local_addr","make_dangerous_client_config","new","or","","","","","","","","poll_close","","poll_flush","","poll_next","","poll_ready","","proxy_url","source","","","","split","start_send","","to_owned","to_string","","","","try_from","","","","","","","","try_into","","","","","","","","try_poll_next","","try_to_string","","","","type_id","","","","","","","","vzip","","","","","","","","backtrace","","","","","","","","","","code","source","","","","","span_trace","","","","","","","","","","url","","backtrace","","","","","","","","","","proxy_hostname","proxy_url","source","","","","span_trace","","","","","","","","","","status","url","backtrace","","source","","span_trace","","backtrace","","","size","source","span_trace","","","DEFAULT_HTTPS_PORT","DEFAULT_HTTP_PORT","DEFAULT_KEY_CACHE_CAPACITY","DEFAULT_METRICS_PORT","DEFAULT_RELAY_QUIC_PORT","DnsError","DnsResolver","InvalidResponse","MissingHost","N0_DNS_NODE_ORIGIN_PROD","N0_DNS_NODE_ORIGIN_STAGING","NoResponse","Resolve","ResolveBoth","StaggeredError","TXT","Timeout","TxtLookup","__clone_box","","","and","","","","","as_error_source","","backtrace","","borrow","","","","","borrow_mut","","","","","cause","","clear_cache","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","","compat_mut","","","","","compat_ref","","","","","default","deref","","","","","deref_mut","","","","","description","","drop","","","","","fmt","","","","","","","","from","","","","","","","","","in_current_span","","init","","","","","into","","","","","into_iter","lookup_ipv4","lookup_ipv4_ipv6","lookup_ipv4_ipv6_staggered","lookup_ipv4_staggered","lookup_ipv6","lookup_ipv6_staggered","lookup_node_by_domain_name","lookup_node_by_domain_name_staggered","lookup_node_by_id","lookup_node_by_id_staggered","lookup_txt","new","or","","","","","reset","resolve","resolve_host","source","","to_owned","","","to_string","","","try_from","","","","","try_into","","","","","try_to_string","","","txt_data","type_id","","","","","vzip","","","","","with_nameserver","backtrace","","","","","","ipv4","ipv6","source","","span_trace","","","","","","CLIENT_AUTH_HEADER","RELAY_PATH","RELAY_PROBE_PATH","RELAY_PROTOCOL_VERSION","AttrFromString","DecodingError","","EncodingError","FailedBuildingPacket","IROH_TXT_NAME","InvalidEncodingZ32","InvalidLabel","InvalidLength","InvalidSignature","InvalidTxtEntry","LookupError","LookupFailed","MAX_LENGTH","MaxLengthExceededError","NodeData","NodeIdExt","NodeInfo","NotAnIrohRecord","NumLabels","ParseError","","UnexpectedFormat","UserData","Utf8","__clone_box","","","add_direct_addresses","and","","","","","","","","as_error_source","","","","","as_ref","backtrace","","","","","borrow","","","","","","","","borrow_mut","","","","","","","","cause","","","","","clear_direct_addresses","clone","","","clone_into","","","clone_to_uninit","","","cmp","compare","compat","","","","","","","","compat_mut","","","","","","","","compat_ref","","","","","","","","data","default","deref","","","","","","","","","deref_mut","","","","","","","","","description","","","","","direct_addresses","drop","","","","","","","","eq","","","equivalent","","","","","","","","","","","","fmt","","","","","","","","","","","","","","from","","","","","","","","","","","","from_parts","from_pkarr_signed_packet","from_str","from_txt_lookup","from_z32","hash","in_current_span","","","","","init","","","","","","","","into","","","","","","","","into_node_addr","new","","node_id","or","","","","","","","","partial_cmp","relay_url","set_relay_url","set_user_data","source","","","","","to_node_addr","to_owned","","","to_pkarr_signed_packet","to_string","","","","","","to_txt_strings","to_z32","try_from","","","","","","","","","try_into","","","","","","","","try_to_string","","","","","","type_id","","","","","","","","user_data","vzip","","","","","","","","with_direct_addresses","","with_relay_url","","with_user_data","","backtrace","","","len","source","","span_trace","","","backtrace","","source","","span_trace","","backtrace","","","source","","","span_trace","","","backtrace","","","","","","key","label","num_labels","s","source","","span_trace","","","","","","common","disco","handshake","relay","streams","ClientAuth","ClientToRelayDatagram","ClientToRelayDatagramBatch","FrameType","FrameTypeError","Health","NodeGone","Ping","Pong","RelayToClientDatagram","RelayToClientDatagramBatch","Restarting","ServerChallenge","ServerConfirmsAuth","ServerDeniesAuth","UnexpectedEnd","UnknownFrameType","__clone_box","and","","as_error_source","backtrace","borrow","","borrow_mut","","cause","clone","clone_into","clone_to_uninit","compat","","compat_mut","","compat_ref","","deref","","deref_mut","","description","drop","","eq","equivalent","","","","fmt","","","from","","in_current_span","init","","into","","or","","source","to_owned","to_string","try_from","","","try_from_primitive","try_into","","try_to_string","type_id","","vzip","","backtrace","","span_trace","","tag","MAGIC","looks_like_disco_wrapper","ClientAuthHeaderInvalid","DeserializationError","Error","FrameTypeError","ServerDeniedAuth","UnexpectedEnd","UnexpectedFrameType","Websocket","and","as_error_source","backtrace","borrow","borrow_mut","cause","compat","compat_mut","compat_ref","deref","deref_mut","description","drop","fmt","","from","","","in_current_span","init","into","or","source","to_string","try_from","try_into","try_to_string","type_id","vzip","backtrace","","","","","","","expected_types","frame_type","","reason","source","","","span_trace","","","","","","","value","ClientToRelayMsg","Datagrams","","","Error","FrameTooLarge","FrameTypeError","Health","InvalidFrame","InvalidFrameType","InvalidProtocolMessageEncoding","InvalidPublicKey","MAX_PACKET_SIZE","NodeGone","Ping","","Pong","","RelayToClientMsg","Restarting","SerDe","TooSmall","UnexpectedFrame","__clone_box","","","and","","","","as_error_source","backtrace","borrow","","","","borrow_mut","","","","cause","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","compat_mut","","","","compat_ref","","","","contents","deref","","","","deref_mut","","","","description","drop","","","","ecn","eq","","","equivalent","","","","","","","","","","","","fmt","","","","","from","","","","","","","in_current_span","init","","","","into","","","","or","","","","segment_size","source","take_segments","to_owned","","","to_string","try_from","","","","try_into","","","","try_to_string","typ","type_id","","","","vzip","","","","datagrams","dst_node_id","backtrace","","","","","","","","","expected","frame_len","frame_type","got","source","","","","span_trace","","","","","","","","","datagrams","problem","reconnect_in","remote_node_id","try_for","ALPN_QUIC_ADDR_DISC","Connect","Connection","Error","QUIC_ADDR_DISC_CLOSE_CODE","QUIC_ADDR_DISC_CLOSE_REASON","QuicClient","WatchRecv","__clone_box","and","","as_error_source","backtrace","borrow","","borrow_mut","","cause","clone","clone_into","clone_to_uninit","compat","","compat_mut","","compat_ref","","create_conn","deref","","deref_mut","","description","drop","","fmt","","","from","","","","","in_current_span","init","","into","","new","or","","source","to_owned","to_string","try_from","","try_into","","try_to_string","type_id","","vzip","","backtrace","","","source","","","span_trace","","","Access","AccessConfig","AcmeEventStreamFinished","Allow","BindTcpListener","BindTlsListener","CertConfig","ClientRateLimit","DEFAULT_CERT_RELOAD_INTERVAL","Deny","Everyone","JoinError","LetsEncrypt","Limits","LocalAddr","Manual","Metrics","","NoLocalAddr","NoRelayServicesEnabled","QuicConfig","QuicSpawn","RelayConfig","RelayMetrics","Reloading","ReloadingResolver","Restricted","Server","ServerConfig","SpawnError","SupervisorError","TaskCancelled","TlsConfig","TlsHeaderParse","__clone_box","","","accept_conn_burst","accept_conn_limit","accepts","access","and","","","","","","","","","","","","","","","as_error_source","","as_iterable","backtrace","","bind_addr","borrow","","","","","","","","","","","","","","","borrow_mut","","","","","","","","","","","","","","","bytes_per_second","bytes_recv","bytes_rx_ratelimited_total","bytes_sent","cause","","cert","certificates","client_rx","clone","","","clone_into","","","clone_to_uninit","","","compat","","","","","","","","","","","","","","","compat_mut","","","","","","","","","","","","","","","compat_ref","","","","","","","","","","","","","","","conns_rx_ratelimited_total","default","","","","deref","","","","","","","","","","","","","","","","deref_mut","","","","","","","","","","","","","","","description","","disco_packets_dropped","disco_packets_recv","disco_packets_sent","disconnects","drop","","","","","","","","","","","","","","","eq","equivalent","","","","field_count","field_ref","fmt","","","","","","","","","","","","","","","","","from","","","","","","","","","","","","","","","","got_ping","groups","groups_cloned","http_addr","http_bind_addr","http_url","https_addr","https_bind_addr","https_url","in_current_span","","init","","","","","","","","","","","","","","","","into","","","","","","","","","","","","","","","is_allowed","key_cache_capacity","limits","max_burst_bytes","metrics","metrics_addr","name","","or","","","","","","","","","","","","","","","other_packets_dropped","other_packets_recv","other_packets_sent","quic","quic_addr","quic_bind_addr","relay","reload","resolve","send_packets_dropped","send_packets_recv","send_packets_sent","sent_pong","server","server_config","","shutdown","","source","","spawn","task_handle","testing","tls","to_owned","","","to_string","","try_from","","","","","","","","","","","","","","","try_into","","","","","","","","","","","","","","","try_to_string","","type_id","","","","","","","","","","","","","","","unique_client_keys","unknown_frames","vzip","","","","","","","","","","","","","","","certs","state","addr","backtrace","","","","","","source","","","","","span_trace","","","","","","backtrace","","","","","source","","span_trace","","","","","quic_config","relay_config","self_signed_tls_certs_and_config","server_config","tls_config"],"q":[[0,"iroh_relay"],[153,"iroh_relay::client"],[401,"iroh_relay::client::ConnectError"],[429,"iroh_relay::client::DialError"],[457,"iroh_relay::client::RecvError"],[463,"iroh_relay::client::SendError"],[471,"iroh_relay::defaults"],[476,"iroh_relay::dns"],[639,"iroh_relay::dns::DnsError"],[655,"iroh_relay::http"],[659,"iroh_relay::node_info"],[946,"iroh_relay::node_info::DecodingError"],[955,"iroh_relay::node_info::EncodingError"],[961,"iroh_relay::node_info::LookupError"],[970,"iroh_relay::node_info::ParseError"],[988,"iroh_relay::protos"],[993,"iroh_relay::protos::common"],[1067,"iroh_relay::protos::common::FrameTypeError"],[1072,"iroh_relay::protos::disco"],[1074,"iroh_relay::protos::handshake"],[1111,"iroh_relay::protos::handshake::Error"],[1133,"iroh_relay::protos::relay"],[1275,"iroh_relay::protos::relay::ClientToRelayMsg"],[1277,"iroh_relay::protos::relay::Error"],[1303,"iroh_relay::protos::relay::RelayToClientMsg"],[1308,"iroh_relay::quic"],[1371,"iroh_relay::quic::Error"],[1380,"iroh_relay::server"],[1790,"iroh_relay::server::CertConfig"],[1792,"iroh_relay::server::SpawnError"],[1810,"iroh_relay::server::SupervisorError"],[1822,"iroh_relay::server::testing"],[1827,"dyn_clone::sealed"],[1828,"tower_http::follow_redirect::policy::and"],[1829,"tower_http::follow_redirect::policy"],[1830,"iroh_relay::relay_map"],[1831,"core::cmp"],[1832,"async_compat"],[1833,"iroh_base::relay_url"],[1834,"iroh_relay::ping_tracker"],[1835,"core::time"],[1836,"core::result"],[1837,"serde_core::de"],[1838,"core::fmt"],[1839,"core::iter::traits::collect"],[1840,"alloc::sync"],[1841,"core::option"],[1842,"core::iter::traits::iterator"],[1843,"tower_http::follow_redirect::policy::or"],[1844,"serde_core::ser"],[1845,"alloc::string"],[1846,"alloc::collections"],[1847,"core::any"],[1848,"core::ops::function"],[1849,"core::marker"],[1850,"core::error"],[1851,"iroh_relay::client::conn"],[1852,"backtrace::capture"],[1853,"tokio_websockets::error"],[1854,"tokio::time::error"],[1855,"std::io::error"],[1856,"core::net::socket_addr"],[1857,"rustls::client::client_conn"],[1858,"iroh_base::key"],[1859,"core::convert"],[1860,"core::pin"],[1861,"core::task::wake"],[1862,"core::task::poll"],[1863,"url"],[1864,"http::status"],[1865,"hyper::error"],[1866,"n0_snafu::spantrace"],[1867,"hickory_resolver::error"],[1868,"hickory_resolver::resolver"],[1869,"hickory_resolver::lookup"],[1870,"core::net::ip_addr"],[1871,"reqwest::dns::resolve"],[1872,"alloc::boxed"],[1873,"http::header::name"],[1874,"alloc::collections::btree::set"],[1875,"pkarr::signed_packet"],[1876,"iroh_base::node_addr"],[1877,"core::hash"],[1878,"alloc::vec"],[1879,"z32"],[1880,"ed25519_dalek::errors"],[1881,"simple_dns::simple_dns_error"],[1882,"hickory_proto::error"],[1883,"core::str::error"],[1884,"num_enum"],[1885,"iroh_quinn_proto::varint"],[1886,"postcard::error"],[1887,"http::header::value"],[1888,"bytes::bytes"],[1889,"iroh_quinn::connection"],[1890,"iroh_quinn_proto::endpoint"],[1891,"iroh_quinn_proto::connection"],[1892,"tokio::sync::watch::error"],[1893,"iroh_quinn::endpoint"],[1894,"iroh_relay::server::metrics"],[1895,"iroh_metrics::metrics"],[1896,"iroh_metrics::iterable"],[1897,"core::num::nonzero"],[1898,"rustls_pki_types"],[1899,"core::default"],[1900,"iroh_relay::server::resolver"],[1901,"iroh_metrics::base"],[1902,"tokio::runtime::task::error"],[1903,"rustls::crypto::signer"],[1904,"reloadable_core"],[1905,"rustls::server::server_conn"],[1906,"tokio_util::task::abort_on_drop"],[1907,"tokio_rustls_acme::state"]],"i":"`````nA`AbAn32103210321`32132132121210321032103213010`0321032121`032133213333222211110332210333221333`032103213300`303212101``221`03213203210321320321230321`````Ef`EhE`022121212Ed22222``1023333Dd021430EjEnF`5476547654763210547632105476333547632105476321054763210354763210547632105476547632105544776632105544477776666321054765476321035476321030`35476321021212021354762213547654763210547632102054765476321054763210HdHfHhHjHlHnI`IbIdIf476530987654321098InJ`JbJdJfJhJjJlJnK`138762987654321045KbKd1010KfKhKj12210```````Fh0``000``0`GdLbLd3Kl3214040403214032140332132132140321403214032134032140321404032144003211444033221404032140321233333333333340321333403214014032140321401140321403213N`NbNdNfNhNj3351543210````Oh`0`Ob`OdMf112`0O`````44`14`4Nn1Md15412Of147650473650476523014765230147650472231231231336523014765230147652301471265230114765230114765047265230147231222233331111665523300144776652230114771131A@h476158763412587634125823227634125843337615823422764158207634412587634125876415876341258376341258323232A@jA@lA@n120210AAdAAf1010AAjAAlAAn210210ABbABdABfABhABjABl413520543210`````ACb00``0000000000AC`0110001010011110101010100101111110010010101001011011001010ACfACh100``Ff0`0000000000000000000000000000000000AClACnAD`ADbADdADfADh110253065432106``ADnHb`Fd020000`22121`200021AE`13201113201320132032032013201320132001320132011320032033332222000011320111320011320132013200103201132013201313201320AEf0AEhAEjAElAEnAF`AFbAFdAFfAFh87286541876543210AFjAFlAFn20`AG`0````0AGb101110101000101010010101101101111011010010101101011010AGnAH`AHb210210``AIbAJdAI`0```1AHl3AIl`20`424`2``0`1````4`2AJb4AIfAHd0AHfAHj14AJjAJf28:AIdAIj679AIn<><>6<>269435;=2178:0<>69435;=2178:0<>8666<>1079=89=89=869435;=2178:0<>69435;=2178:0<>69435;=2178:0<>66937694435;=2178:0<>69435;=2178:0<><>666669435;=2178:0<>=====6669435;=2178:0<<>>69435;=2178:0<>>699050010<>694435;=2178:0<>69435;=2178:0<>;558036969435;=2178:0<>666301344666692140<>00`59=8<>69435;=2178:0<>69435;=2178:0<><>69435;=2178:0<>6669435;=2178:0<>AKnAL`ALdALfALhALjALlALn543210432105AMbAMdAMfAMhAMj4243210`````","f":"`````{{bd}f}00{g{{h{ig}}}{}{}{{j{ce}}}{{j{ce}}}}000{b{{b{c}}}{}}000{{{b{l}}}{{b{lc}}}{}}000`{{{b{n}}}n}{{{b{A`}}}A`}{{{b{Ab}}}Ab}{{b{b{lc}}}f{}}00{{bAd}f}00{{{b{A`}}{b{A`}}}Af}{{{b{Ab}}{b{Ab}}}Af}{{b{b{c}}}Af{}}0{{}{{Ah{c}}}{}}000{{{b{l}}}{{Ah{{b{lc}}}}}{}}000{b{{Ah{{b{c}}}}}{}}000{{{b{n}}{b{Aj}}}Al}{{}An}{{}Ab}{{{b{An}}}B`}`{Bb{{b{c}}}{}}000{Bb{{b{lc}}}{}}000{c{{Bd{A`}}}Bf}{c{{Bd{Ab}}}Bf}`{Bbf}000{{}n}{{{b{n}}{b{n}}}Al}{{{b{A`}}{b{A`}}}Al}{{{b{Ab}}{b{Ab}}}Al}{{b{b{c}}}Al{}}00000000000{{{b{An}}{b{lBh}}}Bj}{{{b{n}}{b{lBh}}}Bj}0{{{b{A`}}{b{lBh}}}Bj}0{{{b{Ab}}{b{lBh}}}Bj}{cc{}}{A`n}1{Ajn}2{AjA`}3{c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ALb}{ALdFn}{ALfCb}{ALhCb}{ALjCb}{ALlCb}{ALnCb}{ALdCb}{ALfFl}`{ALjAM`}{ALlFl}{ALnFl}{ALfIl}{ALhIl}{ALjIl}{ALlIl}{ALnIl}{ALdIl}{AMbCb}{AMdCb}{AMfCb}{AMhCb}{AMjCb}{AMbFl}{AMfAJn}{AMbIl}{AMdIl}{AMfIl}{AMhIl}{AMjIl}{{}AId}{{}{{AHj{f}}}}{{}{{H`{{A@f{AJ`}}AKj}}}}{{}{{AJf{f}}}}{{}{{AIj{f}}}}","D":"BNf","p":[[1,"reference",null,null,1],[5,"Private",1827],[1,"unit"],[5,"And",1828],[10,"Policy",1829],[0,"mut"],[5,"RelayMap",0,1830],[5,"RelayNode",0,1830],[5,"RelayQuicConfig",0,1830],[1,"u8"],[6,"Ordering",1831],[5,"Compat",1832],[5,"RelayUrl",1833],[1,"bool"],[5,"PingTracker",0,1834],[5,"Duration",1835],[1,"usize"],[6,"Result",1836,null,1],[10,"Deserializer",1837],[5,"Formatter",1838],[8,"Result",1838],[17,"Item"],[10,"IntoIterator",1839],[5,"Arc",1840,null,1],[6,"Option",1841,null,1],[1,"array"],[10,"Iterator",1842],[5,"Or",1843],[1,"u16"],[10,"Serializer",1844],[5,"String",1845],[5,"TryReserveError",1846],[5,"TypeId",1847],[5,"ClientBuilder",153],[17,"Output"],[10,"Fn",1848],[10,"Send",1849],[10,"Sync",1849],[10,"Error",1850],[6,"SendError",153,1851],[5,"Backtrace",1852],[6,"RecvError",153,1851],[6,"ConnectError",153],[6,"DialError",153],[5,"Client",153],[1,"str"],[5,"ClientSink",153],[5,"ClientStream",153],[6,"Error",1853],[6,"Error",1133],[6,"Error",1074],[6,"DnsError",476],[5,"Elapsed",1854],[5,"Error",1855],[6,"SocketAddr",1856],[5,"ClientConfig",1857],[5,"SecretKey",1858],[5,"DnsResolver",476],[10,"Into",1859,null,1],[5,"Pin",1860],[5,"Context",1861],[6,"Poll",1862],[5,"Url",1863],[1,"tuple",null,null,1],[6,"ClientToRelayMsg",1133],[15,"InvalidWebsocketUrl",401],[15,"InvalidRelayUrl",401],[15,"Websocket",401],[15,"Handshake",401],[15,"Dial",401],[15,"UnexpectedUpgradeStatus",401],[15,"Upgrade",401],[15,"InvalidTlsServername",401],[15,"NoLocalAddr",401],[15,"Tls",401],[5,"StatusCode",1864],[5,"Error",1865],[5,"SpanTrace",1866],[15,"InvalidTargetPort",429],[15,"Dns",429],[15,"Timeout",429],[15,"Io",429],[15,"InvalidUrl",429],[15,"ProxyConnectInvalidStatus",429],[15,"ProxyInvalidUrl",429],[15,"ProxyConnect",429],[15,"ProxyInvalidTlsServername",429],[15,"ProxyInvalidTargetPort",429],[15,"Protocol",457],[15,"StreamError",457],[15,"StreamError",463],[15,"ExceedsMaxPacketSize",463],[15,"EmptyPacket",463],[5,"StaggeredError",476],[10,"Debug",1838],[10,"Display",1838],[5,"TxtLookup",476],[5,"TXT",476],[5,"ResolveError",1867],[8,"TokioResolver",1868],[5,"TxtLookup",1869],[6,"IpAddr",1870],[10,"ToString",1845],[1,"u64"],[1,"slice"],[5,"NodeInfo",659],[6,"LookupError",659],[8,"NodeId",1858],[5,"Name",1871],[8,"Resolving",1871],[5,"Box",1872,null,1],[15,"Timeout",639],[15,"NoResponse",639],[15,"ResolveBoth",639],[15,"MissingHost",639],[15,"Resolve",639],[15,"InvalidResponse",639],[5,"HeaderName",1873],[5,"NodeData",659],[5,"UserData",659],[6,"EncodingError",659],[6,"DecodingError",659],[5,"MaxLengthExceededError",659],[6,"ParseError",659],[5,"BTreeSet",1874],[6,"SignedPacketBuildError",1875],[5,"NodeAddr",1876],[5,"SignedPacket",1875],[10,"Hasher",1877],[1,"u32"],[5,"Vec",1878],[10,"NodeIdExt",659],[15,"InvalidEncodingZ32",946],[15,"InvalidLength",946],[15,"InvalidSignature",946],[6,"Z32Error",1879],[8,"SignatureError",1880],[15,"FailedBuildingPacket",955],[15,"InvalidTxtEntry",955],[6,"SimpleDnsError",1881],[15,"ParseError",961],[15,"LookupFailed",961],[15,"InvalidLabel",961],[5,"ProtoError",1882],[15,"UnexpectedFormat",970],[15,"AttrFromString",970],[15,"NumLabels",970],[15,"Utf8",970],[15,"NotAnIrohRecord",970],[15,"DecodingError",970],[5,"Utf8Error",1883],[6,"FrameTypeError",993],[6,"FrameType",993],[5,"TryFromPrimitiveError",1884],[15,"UnexpectedEnd",1067],[15,"UnknownFrameType",1067],[5,"VarInt",1885],[15,"ClientAuthHeaderInvalid",1111],[15,"Websocket",1111],[15,"UnexpectedEnd",1111],[15,"FrameTypeError",1111],[15,"ServerDeniedAuth",1111],[15,"UnexpectedFrameType",1111],[15,"DeserializationError",1111],[6,"Error",1886],[5,"HeaderValue",1887],[6,"RelayToClientMsg",1133],[5,"Datagrams",1133],[5,"Bytes",1888],[10,"AsRef",1859],[15,"Datagrams",1275],[15,"UnexpectedFrame",1277],[15,"FrameTooLarge",1277],[15,"SerDe",1277],[15,"FrameTypeError",1277],[15,"InvalidPublicKey",1277],[15,"InvalidFrame",1277],[15,"InvalidFrameType",1277],[15,"InvalidProtocolMessageEncoding",1277],[15,"TooSmall",1277],[15,"Datagrams",1303],[15,"Health",1303],[15,"Restarting",1303],[6,"Error",1308],[5,"QuicClient",1308],[5,"Connection",1889],[6,"ConnectError",1890],[6,"ConnectionError",1891],[5,"RecvError",1892],[5,"Endpoint",1893],[15,"Connect",1371],[15,"Connection",1371],[15,"WatchRecv",1371],[5,"Limits",1380],[5,"Metrics",1380,1894],[5,"Counter",1895],[5,"RelayConfig",1380],[6,"AccessConfig",1380],[10,"Iterable",1896],[6,"SpawnError",1380],[6,"SupervisorError",1380],[5,"QuicConfig",1380],[5,"ClientRateLimit",1380],[8,"NonZeroU32",1897],[5,"TlsConfig",1380],[6,"CertConfig",1380],[5,"Server",1380],[5,"CertificateDer",1898],[5,"RelayMetrics",1380,1894],[6,"Access",1380],[5,"ServerConfig",1380],[10,"Default",1899],[5,"ReloadingResolver",1380,1900],[5,"MetricItem",1901],[5,"JoinError",1902],[10,"MetricsGroup",1901],[17,"Value"],[5,"CertifiedKey",1903],[10,"Loader",1904],[5,"ClientHello",1905],[5,"ServerConfig",1905],[5,"AbortOnDropHandle",1906],[15,"Manual",1790],[15,"LetsEncrypt",1790],[5,"AcmeState",1907],[15,"BindTcpListener",1792],[15,"LocalAddr",1792],[15,"QuicSpawn",1792],[15,"TlsHeaderParse",1792],[15,"BindTlsListener",1792],[15,"NoLocalAddr",1792],[5,"InvalidHeaderValue",1887],[15,"Metrics",1810],[15,"AcmeEventStreamFinished",1810],[15,"JoinError",1810],[15,"NoRelayServicesEnabled",1810],[15,"TaskCancelled",1810]],"r":[[0,1133],[1,1834],[2,1830],[3,1830],[4,1830],[5,1830],[6,1830],[7,1830],[8,1834],[9,1830],[10,1830],[11,1830],[12,1834],[13,1830],[14,1830],[15,1830],[16,1834],[17,1830],[18,1830],[19,1830],[21,1830],[22,1830],[23,1830],[24,1830],[25,1830],[26,1830],[27,1830],[28,1830],[29,1830],[30,1830],[31,1830],[32,1830],[33,1830],[34,1834],[35,1830],[36,1830],[37,1830],[38,1834],[39,1830],[40,1830],[41,1830],[42,1834],[43,1830],[44,1830],[45,1830],[46,1830],[47,1834],[48,1830],[49,1834],[51,1834],[52,1830],[53,1830],[54,1830],[55,1834],[56,1830],[57,1830],[58,1830],[59,1830],[60,1830],[62,1834],[63,1830],[64,1830],[65,1830],[66,1830],[67,1830],[68,1830],[69,1830],[70,1830],[71,1830],[72,1830],[73,1830],[74,1830],[75,1830],[76,1830],[77,1830],[78,1830],[79,1830],[80,1830],[81,1830],[82,1834],[83,1830],[84,1830],[85,1830],[86,1830],[87,1830],[88,1834],[89,1830],[90,1830],[91,1830],[92,1830],[93,1830],[94,1830],[95,1830],[96,1830],[97,1830],[99,1834],[100,1830],[101,1830],[102,1830],[103,1834],[104,1830],[105,1830],[106,1830],[107,1830],[108,1830],[109,1834],[110,1834],[112,1830],[113,1834],[114,1830],[115,1830],[116,1830],[117,1830],[118,1830],[119,1834],[120,1830],[123,1830],[124,1830],[125,1830],[127,1834],[128,1830],[129,1830],[130,1830],[131,1830],[132,1830],[133,1834],[134,1830],[135,1830],[136,1830],[137,1834],[138,1830],[139,1830],[140,1830],[141,1830],[142,1830],[143,1834],[144,1830],[145,1830],[146,1830],[147,1830],[148,1830],[149,1834],[150,1830],[151,1830],[152,1830],[161,1851],[162,1851],[171,1851],[177,1851],[178,1851],[179,1851],[180,1851],[188,1851],[189,1851],[196,1851],[197,1851],[200,1851],[201,1851],[204,1851],[205,1851],[212,1851],[213,1851],[220,1851],[221,1851],[227,1851],[228,1851],[235,1851],[236,1851],[243,1851],[244,1851],[252,1851],[253,1851],[260,1851],[261,1851],[268,1851],[269,1851],[272,1851],[273,1851],[280,1851],[281,1851],[282,1851],[283,1851],[292,1851],[293,1851],[294,1851],[295,1851],[296,1851],[309,1851],[310,1851],[313,1851],[314,1851],[322,1851],[323,1851],[334,1851],[335,1851],[351,1851],[352,1851],[359,1851],[360,1851],[363,1851],[364,1851],[371,1851],[372,1851],[381,1851],[382,1851],[385,1851],[386,1851],[393,1851],[394,1851],[1388,1900],[1396,1894],[1403,1894],[1405,1900],[1414,1894],[1419,1894],[1421,1894],[1422,1894],[1423,1900],[1438,1894],[1442,1894],[1443,1894],[1444,1900],[1457,1894],[1458,1894],[1459,1900],[1473,1894],[1474,1894],[1475,1894],[1481,1894],[1484,1894],[1487,1894],[1490,1894],[1491,1894],[1492,1900],[1505,1894],[1506,1894],[1507,1900],[1520,1894],[1521,1894],[1522,1900],[1535,1894],[1536,1894],[1537,1894],[1540,1894],[1541,1894],[1542,1900],[1543,1900],[1556,1894],[1557,1894],[1558,1900],[1573,1894],[1574,1894],[1575,1894],[1576,1894],[1577,1894],[1578,1894],[1579,1900],[1597,1894],[1598,1894],[1599,1894],[1600,1894],[1601,1900],[1616,1894],[1617,1894],[1618,1900],[1632,1894],[1633,1894],[1634,1894],[1643,1894],[1644,1894],[1645,1900],[1646,1900],[1659,1894],[1660,1894],[1661,1900],[1680,1894],[1681,1894],[1682,1894],[1683,1894],[1684,1900],[1697,1894],[1698,1894],[1699,1894],[1704,1900],[1705,1900],[1706,1894],[1707,1894],[1708,1894],[1709,1894],[1710,1894],[1713,1900],[1721,1894],[1726,1894],[1727,1894],[1728,1900],[1741,1894],[1742,1894],[1743,1900],[1758,1894],[1759,1894],[1760,1900],[1773,1894],[1774,1894],[1775,1894],[1776,1894],[1777,1900]],"b":[[83,"impl-Display-for-RelayMap"],[84,"impl-Debug-for-RelayMap"],[85,"impl-Display-for-RelayNode"],[86,"impl-Debug-for-RelayNode"],[89,"impl-From%3CRelayNode%3E-for-RelayMap"],[91,"impl-From%3CRelayUrl%3E-for-RelayMap"],[95,"impl-FromIterator%3CRelayUrl%3E-for-RelayMap"],[96,"impl-FromIterator%3CRelayNode%3E-for-RelayMap"],[280,"impl-Display-for-SendError"],[281,"impl-Debug-for-SendError"],[282,"impl-Debug-for-RecvError"],[283,"impl-Display-for-RecvError"],[284,"impl-Display-for-ConnectError"],[285,"impl-Debug-for-ConnectError"],[286,"impl-Display-for-DialError"],[287,"impl-Debug-for-DialError"],[295,"impl-From%3CError%3E-for-RecvError"],[296,"impl-From%3CError%3E-for-RecvError"],[298,"impl-From%3CError%3E-for-ConnectError"],[299,"impl-From%3CError%3E-for-ConnectError"],[300,"impl-From%3CDialError%3E-for-ConnectError"],[302,"impl-From%3CDnsError%3E-for-DialError"],[303,"impl-From%3CElapsed%3E-for-DialError"],[304,"impl-From%3CError%3E-for-DialError"],[556,"impl-Debug-for-DnsError"],[557,"impl-Display-for-DnsError"],[558,"impl-Debug-for-StaggeredError%3CE%3E"],[559,"impl-Display-for-StaggeredError%3CE%3E"],[562,"impl-Display-for-TXT"],[563,"impl-Debug-for-TXT"],[564,"impl-From%3CElapsed%3E-for-DnsError"],[566,"impl-From%3CResolveError%3E-for-DnsError"],[813,"impl-Display-for-EncodingError"],[814,"impl-Debug-for-EncodingError"],[815,"impl-Debug-for-DecodingError"],[816,"impl-Display-for-DecodingError"],[818,"impl-Display-for-UserData"],[819,"impl-Debug-for-UserData"],[820,"impl-Debug-for-MaxLengthExceededError"],[821,"impl-Display-for-MaxLengthExceededError"],[823,"impl-Display-for-LookupError"],[824,"impl-Debug-for-LookupError"],[825,"impl-Display-for-ParseError"],[826,"impl-Debug-for-ParseError"],[1042,"impl-Display-for-FrameTypeError"],[1043,"impl-Debug-for-FrameTypeError"],[1095,"impl-Display-for-Error"],[1096,"impl-Debug-for-Error"],[1097,"impl-From%3CFrameTypeError%3E-for-Error"],[1098,"impl-From%3CError%3E-for-Error"],[1225,"impl-Display-for-Error"],[1226,"impl-Debug-for-Error"],[1230,"impl-From%3CError%3E-for-Error"],[1231,"impl-From%3CFrameTypeError%3E-for-Error"],[1343,"impl-Debug-for-Error"],[1344,"impl-Display-for-Error"],[1346,"impl-From%3CConnectError%3E-for-Error"],[1348,"impl-From%3CConnectionError%3E-for-Error"],[1349,"impl-From%3CRecvError%3E-for-Error"],[1612,"impl-Display-for-SpawnError"],[1613,"impl-Debug-for-SpawnError"],[1614,"impl-Debug-for-SupervisorError"],[1615,"impl-Display-for-SupervisorError"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAALAFdgABAAAABgAOABYAGAAwAAEANAAJAD8AAwBEABQAWgAAAF4AAABhAAAAZAADAHIABQB9AAEAgQAMAJAAAwCWAAMAnwAAAKEAEAC0AAcAvQA+AP0AKAAoAQEAKwECAC8BAgA2AQsATwEPAGABAwBlARgAggFVAN8BAQDjAQIA6AEAAOoBFwADAjIANwIAADoCAQA+AgYASgIAAFcCBABdAgAAXwIRAHUCCQCAAg8AlAIEAJoCBgCmAgQArAIDALECJwDaAiIA/gIXABcDJAA9AwAAPwMAAEQDAABHAwAASgMAAE0DDQBnAwgAcwMEAHkDAgB9AwUAhQMQAJwDBwClAwcAswMpAOYDAADxAyMAFwQCABwECgAoBAgANAQXAE0EAQBQBAQAVgQXAHMEAQB2BAMAggQpAK0EDAC7BBUA1AQAANYEBADfBAMA5AQAAOYECwD0BAcA/gQZAB4FAQAkBRMAOQUKAEUFAQBIBQIATgUIAFgFDABnBQAAaQUBAHAFAABzBQAAdgUCAHoFAACEBQAAhgUDAI4FEwCjBR0AxQUBAMoFNQABBiQAKgYmAF8GAABiBgEAagYEAHAGCwCRBhAAqgYAALQGAQC6BiIA3wYOAPAGDgABBx0A","P":[[8,"B,E,P,T"],[12,"T"],[21,""],[24,"T"],[27,""],[32,"K"],[34,"T"],[46,""],[51,"T"],[59,"__D"],[62,""],[70,"K"],[82,""],[88,"T"],[89,""],[90,"T"],[91,""],[92,"T"],[93,""],[94,"T"],[97,""],[103,"U"],[107,""],[113,"B,E,P,T"],[117,""],[124,"__S"],[127,""],[128,"T"],[131,""],[133,"U,T"],[137,"U"],[141,""],[149,"V"],[186,""],[187,"S"],[188,"B,E,P,T"],[196,""],[204,"T"],[220,""],[225,"T"],[226,""],[227,"T"],[251,""],[252,"T"],[268,""],[293,"T"],[295,""],[297,"T"],[298,""],[301,"T"],[302,""],[305,"T"],[309,""],[322,"U"],[330,""],[333,""],[334,"B,E,P,T"],[342,"Sink::Error"],[346,"Stream::Item"],[348,"Sink::Error"],[350,""],[356,"Sink::Error"],[358,"T"],[359,""],[363,"U,T"],[371,"U"],[379,"S"],[381,""],[393,"V"],[401,""],[492,"B,E,P,T"],[497,""],[500,"E"],[501,"T"],[511,""],[512,"E"],[513,""],[517,"T"],[520,""],[523,"T"],[538,""],[539,"T"],[549,""],[550,"E"],[551,""],[558,"E"],[560,""],[565,"T"],[566,""],[567,"T"],[569,""],[571,"T"],[573,""],[580,"U"],[585,"IntoIterator::IntoIter"],[586,"T"],[588,""],[590,"T"],[591,""],[592,""],[596,"T"],[597,""],[598,"B,E,P,T"],[603,""],[607,"E"],[608,"T"],[611,""],[614,"U,T"],[619,"U"],[624,""],[633,"V"],[638,""],[687,""],[688,"B,E,P,T"],[696,""],[707,"T"],[723,""],[732,"T"],[735,""],[739,"K"],[740,"T"],[764,""],[766,"T"],[772,"Deref::Target"],[773,"T"],[780,"Deref::Target"],[781,"T"],[784,""],[801,"K"],[813,""],[827,"T"],[828,""],[829,"T"],[830,""],[831,"T"],[835,""],[836,"T"],[838,""],[841,"FromStr::Err"],[842,""],[844,"__H"],[845,""],[858,"U"],[866,""],[870,"B,E,P,T"],[878,""],[888,"T"],[891,""],[900,"U,T"],[904,"TryFrom::Error"],[905,"U,T"],[909,"U"],[917,""],[932,"V"],[940,""],[1011,"B,E,P,T"],[1013,""],[1015,"T"],[1019,""],[1021,"T"],[1022,""],[1023,"T"],[1033,""],[1037,"K"],[1041,""],[1044,"T"],[1046,""],[1049,"U"],[1051,"B,E,P,T"],[1053,""],[1054,"T"],[1055,""],[1057,"U,T"],[1059,"TryFromPrimitive::Primitive"],[1060,"U"],[1062,""],[1065,"V"],[1067,""],[1082,"B,E,P,T"],[1083,""],[1085,"T"],[1087,""],[1088,"T"],[1093,""],[1099,"T"],[1100,""],[1102,"U"],[1103,"B,E,P,T"],[1104,""],[1106,"U,T"],[1107,"U"],[1108,""],[1110,"V"],[1111,""],[1159,"B,E,P,T"],[1163,""],[1165,"T"],[1173,""],[1177,"T"],[1180,""],[1183,"T"],[1195,""],[1196,"T"],[1204,""],[1213,"K"],[1225,""],[1232,"T"],[1237,""],[1242,"U"],[1246,"B,E,P,T"],[1250,""],[1253,"T"],[1256,""],[1257,"U,T"],[1261,"U"],[1265,""],[1271,"V"],[1275,""],[1317,"B,E,P,T"],[1319,""],[1321,"T"],[1325,""],[1327,"T"],[1328,""],[1329,"T"],[1335,""],[1336,"T"],[1340,""],[1347,"T"],[1348,""],[1350,"T"],[1351,""],[1354,"U"],[1356,""],[1357,"B,E,P,T"],[1359,""],[1360,"T"],[1361,""],[1362,"U,T"],[1364,"U"],[1366,""],[1369,"V"],[1371,""],[1421,"B,E,P,T"],[1436,""],[1442,"T"],[1472,""],[1484,"T"],[1487,""],[1490,"T"],[1535,""],[1538,"EC,EA"],[1539,""],[1540,"T"],[1543,"Loader,Deref::Target"],[1544,"T"],[1571,""],[1593,"K"],[1597,""],[1601,"Loader"],[1602,"EC,EA"],[1604,""],[1607,"EC,EA"],[1608,""],[1610,"EC,EA"],[1611,""],[1616,"T"],[1630,""],[1631,"T"],[1632,""],[1646,"Loader"],[1647,""],[1659,"U"],[1674,""],[1682,"B,E,P,T"],[1697,""],[1704,"Loader"],[1706,""],[1713,"Loader"],[1714,""],[1717,"EC,EA"],[1718,""],[1721,"T"],[1724,""],[1726,"U,T"],[1741,"U"],[1756,""],[1775,"V"],[1790,""]]}]]')); if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; else if (window.initSearch) window.initSearch(searchIndex); -//{"start":39,"fragment_lengths":[446,118599,11720,7548,13194,46891]} \ No newline at end of file +//{"start":39,"fragment_lengths":[446,118632,11771,7548,13194,46891]} \ No newline at end of file diff --git a/pr/3465/docs/src/iroh/disco.rs.html b/pr/3465/docs/src/iroh/disco.rs.html index 71bea0bf30..bae503d9e0 100644 --- a/pr/3465/docs/src/iroh/disco.rs.html +++ b/pr/3465/docs/src/iroh/disco.rs.html @@ -431,116 +431,118 @@ 431#[cfg(test)] 432mod tests { 433 use iroh_base::SecretKey; -434 -435 use super::*; -436 use crate::key::{SharedSecret, public_ed_box, secret_ed_box}; -437 -438 #[test] -439 fn test_to_from_bytes() { -440 struct Test { -441 name: &'static str, -442 m: Message, -443 want: &'static str, -444 } -445 let tests = [ -446 Test { -447 name: "ping_with_nodekey_src", -448 m: Message::Ping(Ping { -449 tx_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].into(), -450 node_key: PublicKey::try_from( -451 &[ -452 190, 243, 65, 104, 37, 102, 175, 75, 243, 22, 69, 200, 167, 107, 24, -453 63, 216, 140, 120, 43, 4, 112, 16, 62, 117, 155, 45, 215, 72, 175, 40, -454 189, -455 ][..], -456 ) -457 .unwrap(), -458 }), -459 want: "01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c be f3 41 68 25 66 af 4b f3 16 45 c8 a7 6b 18 3f d8 8c 78 2b 04 70 10 3e 75 9b 2d d7 48 af 28 bd", -460 }, -461 Test { -462 name: "pong", -463 m: Message::Pong(Pong { -464 tx_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].into(), -465 ping_observed_addr: SendAddr::Udp("2.3.4.5:1234".parse().unwrap()), -466 }), -467 want: "02 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 00 00 00 00 00 00 00 00 00 00 00 ff ff 02 03 04 05 d2 04", -468 }, -469 Test { -470 name: "pongv6", -471 m: Message::Pong(Pong { -472 tx_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].into(), -473 ping_observed_addr: SendAddr::Udp("[fed0::12]:6666".parse().unwrap()), -474 }), -475 want: "02 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 00 fe d0 00 00 00 00 00 00 00 00 00 00 00 00 00 12 0a 1a", -476 }, -477 Test { -478 name: "call_me_maybe", -479 m: Message::CallMeMaybe(CallMeMaybe { -480 my_numbers: Vec::new(), -481 }), -482 want: "03 00", -483 }, -484 Test { -485 name: "call_me_maybe_endpoints", -486 m: Message::CallMeMaybe(CallMeMaybe { -487 my_numbers: vec![ -488 "1.2.3.4:567".parse().unwrap(), -489 "[2001::3456]:789".parse().unwrap(), -490 ], -491 }), -492 want: "03 00 00 00 00 00 00 00 00 00 00 00 ff ff 01 02 03 04 37 02 20 01 00 00 00 00 00 00 00 00 00 00 00 00 34 56 15 03", -493 }, -494 ]; -495 for test in tests { -496 println!("{}", test.name); -497 -498 let got = test.m.as_bytes(); -499 assert_eq!( -500 got, -501 data_encoding::HEXLOWER -502 .decode(test.want.replace(' ', "").as_bytes()) -503 .unwrap(), -504 "wrong as_bytes" -505 ); -506 -507 let back = Message::from_bytes(&got).expect("failed to parse"); -508 assert_eq!(test.m, back, "wrong from_bytes"); -509 } -510 } -511 -512 #[test] -513 fn test_extraction() { -514 let sender_key = SecretKey::generate(rand::rng()); -515 let recv_key = SecretKey::generate(rand::rng()); -516 -517 let msg = Message::Ping(Ping { -518 tx_id: stun_rs::TransactionId::default(), -519 node_key: sender_key.public(), -520 }); -521 -522 let sender_secret = secret_ed_box(sender_key.secret()); -523 let shared = SharedSecret::new(&sender_secret, &public_ed_box(&recv_key.public().public())); -524 let mut seal = msg.as_bytes(); -525 shared.seal(&mut seal); -526 -527 let bytes = encode_message(&sender_key.public(), seal.clone()); +434 use rand::SeedableRng; +435 +436 use super::*; +437 use crate::key::{SharedSecret, public_ed_box, secret_ed_box}; +438 +439 #[test] +440 fn test_to_from_bytes() { +441 struct Test { +442 name: &'static str, +443 m: Message, +444 want: &'static str, +445 } +446 let tests = [ +447 Test { +448 name: "ping_with_nodekey_src", +449 m: Message::Ping(Ping { +450 tx_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].into(), +451 node_key: PublicKey::try_from( +452 &[ +453 190, 243, 65, 104, 37, 102, 175, 75, 243, 22, 69, 200, 167, 107, 24, +454 63, 216, 140, 120, 43, 4, 112, 16, 62, 117, 155, 45, 215, 72, 175, 40, +455 189, +456 ][..], +457 ) +458 .unwrap(), +459 }), +460 want: "01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c be f3 41 68 25 66 af 4b f3 16 45 c8 a7 6b 18 3f d8 8c 78 2b 04 70 10 3e 75 9b 2d d7 48 af 28 bd", +461 }, +462 Test { +463 name: "pong", +464 m: Message::Pong(Pong { +465 tx_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].into(), +466 ping_observed_addr: SendAddr::Udp("2.3.4.5:1234".parse().unwrap()), +467 }), +468 want: "02 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 00 00 00 00 00 00 00 00 00 00 00 ff ff 02 03 04 05 d2 04", +469 }, +470 Test { +471 name: "pongv6", +472 m: Message::Pong(Pong { +473 tx_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].into(), +474 ping_observed_addr: SendAddr::Udp("[fed0::12]:6666".parse().unwrap()), +475 }), +476 want: "02 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 00 fe d0 00 00 00 00 00 00 00 00 00 00 00 00 00 12 0a 1a", +477 }, +478 Test { +479 name: "call_me_maybe", +480 m: Message::CallMeMaybe(CallMeMaybe { +481 my_numbers: Vec::new(), +482 }), +483 want: "03 00", +484 }, +485 Test { +486 name: "call_me_maybe_endpoints", +487 m: Message::CallMeMaybe(CallMeMaybe { +488 my_numbers: vec![ +489 "1.2.3.4:567".parse().unwrap(), +490 "[2001::3456]:789".parse().unwrap(), +491 ], +492 }), +493 want: "03 00 00 00 00 00 00 00 00 00 00 00 ff ff 01 02 03 04 37 02 20 01 00 00 00 00 00 00 00 00 00 00 00 00 34 56 15 03", +494 }, +495 ]; +496 for test in tests { +497 println!("{}", test.name); +498 +499 let got = test.m.as_bytes(); +500 assert_eq!( +501 got, +502 data_encoding::HEXLOWER +503 .decode(test.want.replace(' ', "").as_bytes()) +504 .unwrap(), +505 "wrong as_bytes" +506 ); +507 +508 let back = Message::from_bytes(&got).expect("failed to parse"); +509 assert_eq!(test.m, back, "wrong from_bytes"); +510 } +511 } +512 +513 #[test] +514 fn test_extraction() { +515 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +516 let sender_key = SecretKey::generate(&mut rng); +517 let recv_key = SecretKey::generate(&mut rng); +518 +519 let msg = Message::Ping(Ping { +520 tx_id: stun_rs::TransactionId::default(), +521 node_key: sender_key.public(), +522 }); +523 +524 let sender_secret = secret_ed_box(sender_key.secret()); +525 let shared = SharedSecret::new(&sender_secret, &public_ed_box(&recv_key.public().public())); +526 let mut seal = msg.as_bytes(); +527 shared.seal(&mut seal); 528 -529 assert!(looks_like_disco_wrapper(&bytes)); -530 assert_eq!(source_and_box(&bytes).unwrap().0, sender_key.public()); -531 -532 let (raw_key, seal_back) = source_and_box(&bytes).unwrap(); -533 assert_eq!(raw_key, sender_key.public()); -534 assert_eq!(seal_back, seal); -535 -536 let recv_secret = secret_ed_box(recv_key.secret()); -537 let shared_recv = -538 SharedSecret::new(&recv_secret, &public_ed_box(&sender_key.public().public())); -539 let mut open_seal = seal_back.to_vec(); -540 shared_recv -541 .open(&mut open_seal) -542 .expect("failed to open seal_back"); -543 let msg_back = Message::from_bytes(&open_seal).unwrap(); -544 assert_eq!(msg_back, msg); -545 } -546}
    \ No newline at end of file +529 let bytes = encode_message(&sender_key.public(), seal.clone()); +530 +531 assert!(looks_like_disco_wrapper(&bytes)); +532 assert_eq!(source_and_box(&bytes).unwrap().0, sender_key.public()); +533 +534 let (raw_key, seal_back) = source_and_box(&bytes).unwrap(); +535 assert_eq!(raw_key, sender_key.public()); +536 assert_eq!(seal_back, seal); +537 +538 let recv_secret = secret_ed_box(recv_key.secret()); +539 let shared_recv = +540 SharedSecret::new(&recv_secret, &public_ed_box(&sender_key.public().public())); +541 let mut open_seal = seal_back.to_vec(); +542 shared_recv +543 .open(&mut open_seal) +544 .expect("failed to open seal_back"); +545 let msg_back = Message::from_bytes(&open_seal).unwrap(); +546 assert_eq!(msg_back, msg); +547 } +548}
    \ No newline at end of file diff --git a/pr/3465/docs/src/iroh/discovery.rs.html b/pr/3465/docs/src/iroh/discovery.rs.html index b29041f05d..554522b072 100644 --- a/pr/3465/docs/src/iroh/discovery.rs.html +++ b/pr/3465/docs/src/iroh/discovery.rs.html @@ -737,7 +737,7 @@ 737 use n0_snafu::{Error, Result, ResultExt}; 738 use n0_watcher::Watcher as _; 739 use quinn::{IdleTimeout, TransportConfig}; -740 use rand::Rng; +740 use rand::{Rng, SeedableRng}; 741 use tokio_util::task::AbortOnDropHandle; 742 use tracing_test::traced_test; 743 @@ -871,380 +871,394 @@ 871 #[tokio::test] 872 #[traced_test] 873 async fn endpoint_discovery_simple_shared() -> Result { -874 let disco_shared = TestDiscoveryShared::default(); -875 let (ep1, _guard1) = { -876 let secret = SecretKey::generate(rand::rng()); -877 let disco = disco_shared.create_discovery(secret.public()); -878 new_endpoint(secret, disco).await -879 }; -880 let (ep2, _guard2) = { -881 let secret = SecretKey::generate(rand::rng()); -882 let disco = disco_shared.create_discovery(secret.public()); -883 new_endpoint(secret, disco).await -884 }; -885 let ep1_addr = NodeAddr::new(ep1.node_id()); -886 // wait for our address to be updated and thus published at least once -887 ep1.node_addr().initialized().await; -888 let _conn = ep2.connect(ep1_addr, TEST_ALPN).await?; -889 Ok(()) -890 } -891 -892 /// This test adds an empty discovery which provides no addresses. -893 #[tokio::test] -894 #[traced_test] -895 async fn endpoint_discovery_combined_with_empty() -> Result { -896 let disco_shared = TestDiscoveryShared::default(); -897 let (ep1, _guard1) = { -898 let secret = SecretKey::generate(rand::rng()); -899 let disco = disco_shared.create_discovery(secret.public()); -900 new_endpoint(secret, disco).await -901 }; -902 let (ep2, _guard2) = { -903 let secret = SecretKey::generate(rand::rng()); -904 let disco1 = EmptyDiscovery; -905 let disco2 = disco_shared.create_discovery(secret.public()); -906 let mut disco = ConcurrentDiscovery::empty(); -907 disco.add(disco1); -908 disco.add(disco2); -909 new_endpoint(secret, disco).await -910 }; -911 let ep1_addr = NodeAddr::new(ep1.node_id()); -912 // wait for out address to be updated and thus published at least once -913 ep1.node_addr().initialized().await; -914 let _conn = ep2 -915 .connect(ep1_addr, TEST_ALPN) -916 .await -917 .context("connecting")?; -918 Ok(()) -919 } -920 -921 /// This test adds a "lying" discovery which provides a wrong address. -922 /// This is to make sure that as long as one of the discoveries returns a working address, we -923 /// will connect successfully. -924 #[tokio::test] -925 #[traced_test] -926 async fn endpoint_discovery_combined_with_empty_and_wrong() -> Result { -927 let disco_shared = TestDiscoveryShared::default(); -928 let (ep1, _guard1) = { -929 let secret = SecretKey::generate(rand::rng()); -930 let disco = disco_shared.create_discovery(secret.public()); -931 new_endpoint(secret, disco).await -932 }; -933 let (ep2, _guard2) = { -934 let secret = SecretKey::generate(rand::rng()); -935 let disco1 = EmptyDiscovery; -936 let disco2 = disco_shared.create_lying_discovery(secret.public()); -937 let disco3 = disco_shared.create_discovery(secret.public()); -938 let mut disco = ConcurrentDiscovery::empty(); -939 disco.add(disco1); -940 disco.add(disco2); -941 disco.add(disco3); -942 new_endpoint(secret, disco).await -943 }; -944 // wait for out address to be updated and thus published at least once -945 ep1.node_addr().initialized().await; -946 let _conn = ep2.connect(ep1.node_id(), TEST_ALPN).await?; -947 Ok(()) -948 } -949 -950 /// This test only has the "lying" discovery. It is here to make sure that this actually fails. -951 #[tokio::test] -952 #[traced_test] -953 async fn endpoint_discovery_combined_wrong_only() -> Result { -954 let disco_shared = TestDiscoveryShared::default(); -955 let (ep1, _guard1) = { -956 let secret = SecretKey::generate(rand::rng()); -957 let disco = disco_shared.create_discovery(secret.public()); -958 new_endpoint(secret, disco).await -959 }; -960 let (ep2, _guard2) = { -961 let secret = SecretKey::generate(rand::rng()); -962 let disco1 = disco_shared.create_lying_discovery(secret.public()); -963 let disco = ConcurrentDiscovery::from_services(vec![Box::new(disco1)]); +874 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +875 +876 let disco_shared = TestDiscoveryShared::default(); +877 let (ep1, _guard1) = { +878 let secret = SecretKey::generate(&mut rng); +879 let disco = disco_shared.create_discovery(secret.public()); +880 new_endpoint(secret, disco).await +881 }; +882 let (ep2, _guard2) = { +883 let secret = SecretKey::generate(&mut rng); +884 let disco = disco_shared.create_discovery(secret.public()); +885 new_endpoint(secret, disco).await +886 }; +887 let ep1_addr = NodeAddr::new(ep1.node_id()); +888 // wait for our address to be updated and thus published at least once +889 ep1.node_addr().initialized().await; +890 let _conn = ep2.connect(ep1_addr, TEST_ALPN).await?; +891 Ok(()) +892 } +893 +894 /// This test adds an empty discovery which provides no addresses. +895 #[tokio::test] +896 #[traced_test] +897 async fn endpoint_discovery_combined_with_empty() -> Result { +898 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +899 let disco_shared = TestDiscoveryShared::default(); +900 let (ep1, _guard1) = { +901 let secret = SecretKey::generate(&mut rng); +902 let disco = disco_shared.create_discovery(secret.public()); +903 new_endpoint(secret, disco).await +904 }; +905 let (ep2, _guard2) = { +906 let secret = SecretKey::generate(&mut rng); +907 let disco1 = EmptyDiscovery; +908 let disco2 = disco_shared.create_discovery(secret.public()); +909 let mut disco = ConcurrentDiscovery::empty(); +910 disco.add(disco1); +911 disco.add(disco2); +912 new_endpoint(secret, disco).await +913 }; +914 let ep1_addr = NodeAddr::new(ep1.node_id()); +915 // wait for out address to be updated and thus published at least once +916 ep1.node_addr().initialized().await; +917 let _conn = ep2 +918 .connect(ep1_addr, TEST_ALPN) +919 .await +920 .context("connecting")?; +921 Ok(()) +922 } +923 +924 /// This test adds a "lying" discovery which provides a wrong address. +925 /// This is to make sure that as long as one of the discoveries returns a working address, we +926 /// will connect successfully. +927 #[tokio::test] +928 #[traced_test] +929 async fn endpoint_discovery_combined_with_empty_and_wrong() -> Result { +930 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +931 let disco_shared = TestDiscoveryShared::default(); +932 let (ep1, _guard1) = { +933 let secret = SecretKey::generate(&mut rng); +934 let disco = disco_shared.create_discovery(secret.public()); +935 new_endpoint(secret, disco).await +936 }; +937 let (ep2, _guard2) = { +938 let secret = SecretKey::generate(&mut rng); +939 let disco1 = EmptyDiscovery; +940 let disco2 = disco_shared.create_lying_discovery(secret.public()); +941 let disco3 = disco_shared.create_discovery(secret.public()); +942 let mut disco = ConcurrentDiscovery::empty(); +943 disco.add(disco1); +944 disco.add(disco2); +945 disco.add(disco3); +946 new_endpoint(secret, disco).await +947 }; +948 // wait for out address to be updated and thus published at least once +949 ep1.node_addr().initialized().await; +950 let _conn = ep2.connect(ep1.node_id(), TEST_ALPN).await?; +951 Ok(()) +952 } +953 +954 /// This test only has the "lying" discovery. It is here to make sure that this actually fails. +955 #[tokio::test] +956 #[traced_test] +957 async fn endpoint_discovery_combined_wrong_only() -> Result { +958 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +959 +960 let disco_shared = TestDiscoveryShared::default(); +961 let (ep1, _guard1) = { +962 let secret = SecretKey::generate(&mut rng); +963 let disco = disco_shared.create_discovery(secret.public()); 964 new_endpoint(secret, disco).await 965 }; -966 // wait for out address to be updated and thus published at least once -967 ep1.node_addr().initialized().await; -968 -969 // 10x faster test via a 3s idle timeout instead of the 30s default -970 let mut config = TransportConfig::default(); -971 config.keep_alive_interval(Some(Duration::from_secs(1))); -972 config.max_idle_timeout(Some(IdleTimeout::try_from(Duration::from_secs(3)).unwrap())); -973 let opts = ConnectOptions::new().with_transport_config(Arc::new(config)); +966 let (ep2, _guard2) = { +967 let secret = SecretKey::generate(&mut rng); +968 let disco1 = disco_shared.create_lying_discovery(secret.public()); +969 let disco = ConcurrentDiscovery::from_services(vec![Box::new(disco1)]); +970 new_endpoint(secret, disco).await +971 }; +972 // wait for out address to be updated and thus published at least once +973 ep1.node_addr().initialized().await; 974 -975 let res = ep2 -976 .connect_with_opts(ep1.node_id(), TEST_ALPN, opts) -977 .await? // -> Connecting works -978 .await; // -> Connection is expected to fail -979 assert!(res.is_err()); -980 Ok(()) -981 } -982 -983 /// This test first adds a wrong address manually (e.g. from an outdated&node_id ticket). -984 /// Connect should still succeed because the discovery service will be invoked (after a delay). -985 #[tokio::test] -986 #[traced_test] -987 async fn endpoint_discovery_with_wrong_existing_addr() -> Result { -988 let disco_shared = TestDiscoveryShared::default(); -989 let (ep1, _guard1) = { -990 let secret = SecretKey::generate(rand::rng()); -991 let disco = disco_shared.create_discovery(secret.public()); -992 new_endpoint(secret, disco).await -993 }; -994 let (ep2, _guard2) = { -995 let secret = SecretKey::generate(rand::rng()); -996 let disco = disco_shared.create_discovery(secret.public()); -997 new_endpoint(secret, disco).await -998 }; -999 // wait for out address to be updated and thus published at least once -1000 ep1.node_addr().initialized().await; -1001 let ep1_wrong_addr = NodeAddr { -1002 node_id: ep1.node_id(), -1003 relay_url: None, -1004 direct_addresses: BTreeSet::from(["240.0.0.1:1000".parse().unwrap()]), -1005 }; -1006 let _conn = ep2.connect(ep1_wrong_addr, TEST_ALPN).await?; -1007 Ok(()) -1008 } -1009 -1010 #[tokio::test] -1011 #[traced_test] -1012 async fn endpoint_discovery_watch() -> Result { -1013 let disco_shared = TestDiscoveryShared::default(); -1014 let (ep1, _guard1) = { -1015 let secret = SecretKey::generate(rand::rng()); -1016 let disco = disco_shared.create_discovery(secret.public()); -1017 new_endpoint(secret, disco).await -1018 }; -1019 let (ep2, _guard2) = { -1020 let secret = SecretKey::generate(rand::rng()); -1021 let disco = disco_shared.create_discovery(secret.public()); -1022 new_endpoint(secret, disco).await -1023 }; -1024 -1025 let mut stream = ep1.discovery_stream(); -1026 -1027 // wait for ep2 node addr to be updated and connect from ep1 -> discovery via resolve -1028 ep2.node_addr().initialized().await; -1029 let _ = ep1.connect(ep2.node_id(), TEST_ALPN).await?; -1030 -1031 let DiscoveryEvent::Discovered(item) = -1032 tokio::time::timeout(Duration::from_secs(1), stream.next()) -1033 .await -1034 .expect("timeout") -1035 .expect("stream closed") -1036 .expect("stream lagged") -1037 else { -1038 panic!("Returned unexpected discovery event!"); -1039 }; +975 // 10x faster test via a 3s idle timeout instead of the 30s default +976 let mut config = TransportConfig::default(); +977 config.keep_alive_interval(Some(Duration::from_secs(1))); +978 config.max_idle_timeout(Some(IdleTimeout::try_from(Duration::from_secs(3)).unwrap())); +979 let opts = ConnectOptions::new().with_transport_config(Arc::new(config)); +980 +981 let res = ep2 +982 .connect_with_opts(ep1.node_id(), TEST_ALPN, opts) +983 .await? // -> Connecting works +984 .await; // -> Connection is expected to fail +985 assert!(res.is_err()); +986 Ok(()) +987 } +988 +989 /// This test first adds a wrong address manually (e.g. from an outdated&node_id ticket). +990 /// Connect should still succeed because the discovery service will be invoked (after a delay). +991 #[tokio::test] +992 #[traced_test] +993 async fn endpoint_discovery_with_wrong_existing_addr() -> Result { +994 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +995 +996 let disco_shared = TestDiscoveryShared::default(); +997 let (ep1, _guard1) = { +998 let secret = SecretKey::generate(&mut rng); +999 let disco = disco_shared.create_discovery(secret.public()); +1000 new_endpoint(secret, disco).await +1001 }; +1002 let (ep2, _guard2) = { +1003 let secret = SecretKey::generate(&mut rng); +1004 let disco = disco_shared.create_discovery(secret.public()); +1005 new_endpoint(secret, disco).await +1006 }; +1007 // wait for out address to be updated and thus published at least once +1008 ep1.node_addr().initialized().await; +1009 let ep1_wrong_addr = NodeAddr { +1010 node_id: ep1.node_id(), +1011 relay_url: None, +1012 direct_addresses: BTreeSet::from(["240.0.0.1:1000".parse().unwrap()]), +1013 }; +1014 let _conn = ep2.connect(ep1_wrong_addr, TEST_ALPN).await?; +1015 Ok(()) +1016 } +1017 +1018 #[tokio::test] +1019 #[traced_test] +1020 async fn endpoint_discovery_watch() -> Result { +1021 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1022 +1023 let disco_shared = TestDiscoveryShared::default(); +1024 let (ep1, _guard1) = { +1025 let secret = SecretKey::generate(&mut rng); +1026 let disco = disco_shared.create_discovery(secret.public()); +1027 new_endpoint(secret, disco).await +1028 }; +1029 let (ep2, _guard2) = { +1030 let secret = SecretKey::generate(&mut rng); +1031 let disco = disco_shared.create_discovery(secret.public()); +1032 new_endpoint(secret, disco).await +1033 }; +1034 +1035 let mut stream = ep1.discovery_stream(); +1036 +1037 // wait for ep2 node addr to be updated and connect from ep1 -> discovery via resolve +1038 ep2.node_addr().initialized().await; +1039 let _ = ep1.connect(ep2.node_id(), TEST_ALPN).await?; 1040 -1041 assert_eq!(item.node_id(), ep2.node_id()); -1042 assert_eq!(item.provenance(), "test-disco"); -1043 -1044 // inject item into discovery passively -1045 let passive_node_id = SecretKey::generate(rand::rng()).public(); -1046 let node_info = NodeInfo::new(passive_node_id); -1047 let passive_item = DiscoveryItem::new(node_info, "test-disco-passive", None); -1048 disco_shared.send_passive(DiscoveryEvent::Discovered(passive_item.clone())); -1049 -1050 let DiscoveryEvent::Discovered(item) = -1051 tokio::time::timeout(Duration::from_secs(1), stream.next()) -1052 .await -1053 .expect("timeout") -1054 .expect("stream closed") -1055 .expect("stream lagged") -1056 else { -1057 panic!("Returned unexpected discovery event!"); -1058 }; -1059 assert_eq!(item.node_id(), passive_node_id); -1060 assert_eq!(item.provenance(), "test-disco-passive"); -1061 -1062 Ok(()) -1063 } -1064 -1065 async fn new_endpoint( -1066 secret: SecretKey, -1067 disco: impl IntoDiscovery + 'static, -1068 ) -> (Endpoint, AbortOnDropHandle<Result<()>>) { -1069 let ep = Endpoint::builder() -1070 .secret_key(secret) -1071 .discovery(disco) -1072 .relay_mode(RelayMode::Disabled) -1073 .alpns(vec![TEST_ALPN.to_vec()]) -1074 .bind() -1075 .await -1076 .unwrap(); -1077 -1078 let handle = tokio::spawn({ -1079 let ep = ep.clone(); -1080 async move { -1081 // Keep connections alive until the task is dropped. -1082 let mut connections = Vec::new(); -1083 // we skip accept() errors, they can be caused by retransmits -1084 while let Some(connecting) = ep.accept().await.and_then(|inc| inc.accept().ok()) { -1085 // Just accept incoming connections, but don't do anything with them. -1086 let conn = connecting.await.context("connecting")?; -1087 connections.push(conn); -1088 } -1089 -1090 Ok::<_, Error>(()) -1091 } -1092 }); -1093 -1094 (ep, AbortOnDropHandle::new(handle)) -1095 } -1096 -1097 fn system_time_now() -> u64 { -1098 SystemTime::now() -1099 .duration_since(SystemTime::UNIX_EPOCH) -1100 .expect("time drift") -1101 .as_micros() as u64 -1102 } -1103} -1104 -1105/// This module contains end-to-end tests for DNS node discovery. -1106/// -1107/// The tests run a minimal test DNS server to resolve against, and a minimal pkarr relay to -1108/// publish to. The DNS and pkarr servers share their state. -1109#[cfg(test)] -1110mod test_dns_pkarr { -1111 use iroh_base::{NodeAddr, SecretKey}; -1112 use iroh_relay::{RelayMap, node_info::UserData}; -1113 use n0_future::time::Duration; -1114 use n0_snafu::{Error, Result, ResultExt}; -1115 use tokio_util::task::AbortOnDropHandle; -1116 use tracing_test::traced_test; -1117 -1118 use crate::{ -1119 Endpoint, RelayMode, -1120 discovery::{NodeData, pkarr::PkarrPublisher}, -1121 dns::DnsResolver, -1122 node_info::NodeInfo, -1123 test_utils::{ -1124 DnsPkarrServer, dns_server::run_dns_server, pkarr_dns_state::State, run_relay_server, -1125 }, -1126 }; -1127 -1128 const PUBLISH_TIMEOUT: Duration = Duration::from_secs(10); -1129 -1130 #[tokio::test] -1131 #[traced_test] -1132 async fn dns_resolve() -> Result<()> { -1133 let origin = "testdns.example".to_string(); -1134 let state = State::new(origin.clone()); -1135 let (nameserver, _dns_drop_guard) = run_dns_server(state.clone()) -1136 .await -1137 .context("Running DNS server")?; +1041 let DiscoveryEvent::Discovered(item) = +1042 tokio::time::timeout(Duration::from_secs(1), stream.next()) +1043 .await +1044 .expect("timeout") +1045 .expect("stream closed") +1046 .expect("stream lagged") +1047 else { +1048 panic!("Returned unexpected discovery event!"); +1049 }; +1050 +1051 assert_eq!(item.node_id(), ep2.node_id()); +1052 assert_eq!(item.provenance(), "test-disco"); +1053 +1054 // inject item into discovery passively +1055 let passive_node_id = SecretKey::generate(&mut rng).public(); +1056 let node_info = NodeInfo::new(passive_node_id); +1057 let passive_item = DiscoveryItem::new(node_info, "test-disco-passive", None); +1058 disco_shared.send_passive(DiscoveryEvent::Discovered(passive_item.clone())); +1059 +1060 let DiscoveryEvent::Discovered(item) = +1061 tokio::time::timeout(Duration::from_secs(1), stream.next()) +1062 .await +1063 .expect("timeout") +1064 .expect("stream closed") +1065 .expect("stream lagged") +1066 else { +1067 panic!("Returned unexpected discovery event!"); +1068 }; +1069 assert_eq!(item.node_id(), passive_node_id); +1070 assert_eq!(item.provenance(), "test-disco-passive"); +1071 +1072 Ok(()) +1073 } +1074 +1075 async fn new_endpoint( +1076 secret: SecretKey, +1077 disco: impl IntoDiscovery + 'static, +1078 ) -> (Endpoint, AbortOnDropHandle<Result<()>>) { +1079 let ep = Endpoint::builder() +1080 .secret_key(secret) +1081 .discovery(disco) +1082 .relay_mode(RelayMode::Disabled) +1083 .alpns(vec![TEST_ALPN.to_vec()]) +1084 .bind() +1085 .await +1086 .unwrap(); +1087 +1088 let handle = tokio::spawn({ +1089 let ep = ep.clone(); +1090 async move { +1091 // Keep connections alive until the task is dropped. +1092 let mut connections = Vec::new(); +1093 // we skip accept() errors, they can be caused by retransmits +1094 while let Some(connecting) = ep.accept().await.and_then(|inc| inc.accept().ok()) { +1095 // Just accept incoming connections, but don't do anything with them. +1096 let conn = connecting.await.context("connecting")?; +1097 connections.push(conn); +1098 } +1099 +1100 Ok::<_, Error>(()) +1101 } +1102 }); +1103 +1104 (ep, AbortOnDropHandle::new(handle)) +1105 } +1106 +1107 fn system_time_now() -> u64 { +1108 SystemTime::now() +1109 .duration_since(SystemTime::UNIX_EPOCH) +1110 .expect("time drift") +1111 .as_micros() as u64 +1112 } +1113} +1114 +1115/// This module contains end-to-end tests for DNS node discovery. +1116/// +1117/// The tests run a minimal test DNS server to resolve against, and a minimal pkarr relay to +1118/// publish to. The DNS and pkarr servers share their state. +1119#[cfg(test)] +1120mod test_dns_pkarr { +1121 use iroh_base::{NodeAddr, SecretKey}; +1122 use iroh_relay::{RelayMap, node_info::UserData}; +1123 use n0_future::time::Duration; +1124 use n0_snafu::{Error, Result, ResultExt}; +1125 use rand::SeedableRng; +1126 use tokio_util::task::AbortOnDropHandle; +1127 use tracing_test::traced_test; +1128 +1129 use crate::{ +1130 Endpoint, RelayMode, +1131 discovery::{NodeData, pkarr::PkarrPublisher}, +1132 dns::DnsResolver, +1133 node_info::NodeInfo, +1134 test_utils::{ +1135 DnsPkarrServer, dns_server::run_dns_server, pkarr_dns_state::State, run_relay_server, +1136 }, +1137 }; 1138 -1139 let secret_key = SecretKey::generate(rand::rng()); -1140 let node_info = NodeInfo::new(secret_key.public()) -1141 .with_relay_url(Some("https://relay.example".parse().unwrap())); -1142 let signed_packet = node_info.to_pkarr_signed_packet(&secret_key, 30)?; -1143 state -1144 .upsert(signed_packet) -1145 .context("update and insert signed packet")?; -1146 -1147 let resolver = DnsResolver::with_nameserver(nameserver); -1148 let resolved = resolver -1149 .lookup_node_by_id(&node_info.node_id, &origin) -1150 .await?; -1151 -1152 assert_eq!(resolved, node_info); -1153 -1154 Ok(()) -1155 } -1156 -1157 #[tokio::test] -1158 #[traced_test] -1159 async fn pkarr_publish_dns_resolve() -> Result<()> { -1160 let origin = "testdns.example".to_string(); -1161 -1162 let dns_pkarr_server = DnsPkarrServer::run_with_origin(origin.clone()) -1163 .await -1164 .context("DnsPkarrServer")?; +1139 const PUBLISH_TIMEOUT: Duration = Duration::from_secs(10); +1140 +1141 #[tokio::test] +1142 #[traced_test] +1143 async fn dns_resolve() -> Result<()> { +1144 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1145 let origin = "testdns.example".to_string(); +1146 let state = State::new(origin.clone()); +1147 let (nameserver, _dns_drop_guard) = run_dns_server(state.clone()) +1148 .await +1149 .context("Running DNS server")?; +1150 +1151 let secret_key = SecretKey::generate(&mut rng); +1152 let node_info = NodeInfo::new(secret_key.public()) +1153 .with_relay_url(Some("https://relay.example".parse().unwrap())); +1154 let signed_packet = node_info.to_pkarr_signed_packet(&secret_key, 30)?; +1155 state +1156 .upsert(signed_packet) +1157 .context("update and insert signed packet")?; +1158 +1159 let resolver = DnsResolver::with_nameserver(nameserver); +1160 let resolved = resolver +1161 .lookup_node_by_id(&node_info.node_id, &origin) +1162 .await?; +1163 +1164 assert_eq!(resolved, node_info); 1165 -1166 let secret_key = SecretKey::generate(rand::rng()); -1167 let node_id = secret_key.public(); +1166 Ok(()) +1167 } 1168 -1169 let relay_url = Some("https://relay.example".parse().unwrap()); -1170 -1171 let resolver = DnsResolver::with_nameserver(dns_pkarr_server.nameserver); -1172 let publisher = -1173 PkarrPublisher::builder(dns_pkarr_server.pkarr_url.clone()).build(secret_key); -1174 let user_data: UserData = "foobar".parse().unwrap(); -1175 let data = NodeData::new(relay_url.clone(), Default::default()) -1176 .with_user_data(Some(user_data.clone())); -1177 // does not block, update happens in background task -1178 publisher.update_node_data(&data); -1179 // wait until our shared state received the update from pkarr publishing -1180 dns_pkarr_server -1181 .on_node(&node_id, PUBLISH_TIMEOUT) -1182 .await -1183 .context("wait for on node update")?; -1184 let resolved = resolver.lookup_node_by_id(&node_id, &origin).await?; -1185 println!("resolved {resolved:?}"); -1186 -1187 let expected_addr = NodeAddr { -1188 node_id, -1189 relay_url, -1190 direct_addresses: Default::default(), -1191 }; -1192 -1193 assert_eq!(resolved.to_node_addr(), expected_addr); -1194 assert_eq!(resolved.user_data(), Some(&user_data)); -1195 Ok(()) -1196 } -1197 -1198 const TEST_ALPN: &[u8] = b"TEST"; +1169 #[tokio::test] +1170 #[traced_test] +1171 async fn pkarr_publish_dns_resolve() -> Result<()> { +1172 let origin = "testdns.example".to_string(); +1173 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1174 +1175 let dns_pkarr_server = DnsPkarrServer::run_with_origin(origin.clone()) +1176 .await +1177 .context("DnsPkarrServer")?; +1178 +1179 let secret_key = SecretKey::generate(&mut rng); +1180 let node_id = secret_key.public(); +1181 +1182 let relay_url = Some("https://relay.example".parse().unwrap()); +1183 +1184 let resolver = DnsResolver::with_nameserver(dns_pkarr_server.nameserver); +1185 let publisher = +1186 PkarrPublisher::builder(dns_pkarr_server.pkarr_url.clone()).build(secret_key); +1187 let user_data: UserData = "foobar".parse().unwrap(); +1188 let data = NodeData::new(relay_url.clone(), Default::default()) +1189 .with_user_data(Some(user_data.clone())); +1190 // does not block, update happens in background task +1191 publisher.update_node_data(&data); +1192 // wait until our shared state received the update from pkarr publishing +1193 dns_pkarr_server +1194 .on_node(&node_id, PUBLISH_TIMEOUT) +1195 .await +1196 .context("wait for on node update")?; +1197 let resolved = resolver.lookup_node_by_id(&node_id, &origin).await?; +1198 println!("resolved {resolved:?}"); 1199 -1200 #[tokio::test] -1201 #[traced_test] -1202 async fn pkarr_publish_dns_discover() -> Result<()> { -1203 let dns_pkarr_server = DnsPkarrServer::run().await.context("DnsPkarrServer run")?; -1204 let (relay_map, _relay_url, _relay_guard) = run_relay_server().await?; +1200 let expected_addr = NodeAddr { +1201 node_id, +1202 relay_url, +1203 direct_addresses: Default::default(), +1204 }; 1205 -1206 let (ep1, _guard1) = ep_with_discovery(&relay_map, &dns_pkarr_server).await?; -1207 let (ep2, _guard2) = ep_with_discovery(&relay_map, &dns_pkarr_server).await?; -1208 -1209 // wait until our shared state received the update from pkarr publishing -1210 dns_pkarr_server -1211 .on_node(&ep1.node_id(), PUBLISH_TIMEOUT) -1212 .await -1213 .context("wait for on node update")?; -1214 -1215 // we connect only by node id! -1216 let _conn = ep2.connect(ep1.node_id(), TEST_ALPN).await?; -1217 Ok(()) -1218 } -1219 -1220 async fn ep_with_discovery( -1221 relay_map: &RelayMap, -1222 dns_pkarr_server: &DnsPkarrServer, -1223 ) -> Result<(Endpoint, AbortOnDropHandle<Result<()>>)> { -1224 let secret_key = SecretKey::generate(rand::rng()); -1225 let ep = Endpoint::builder() -1226 .relay_mode(RelayMode::Custom(relay_map.clone())) -1227 .insecure_skip_relay_cert_verify(true) -1228 .secret_key(secret_key.clone()) -1229 .alpns(vec![TEST_ALPN.to_vec()]) -1230 .dns_resolver(dns_pkarr_server.dns_resolver()) -1231 .discovery(dns_pkarr_server.discovery(secret_key)) -1232 .bind() -1233 .await?; -1234 -1235 let handle = tokio::spawn({ -1236 let ep = ep.clone(); -1237 async move { -1238 // we skip accept() errors, they can be caused by retransmits -1239 while let Some(connecting) = ep.accept().await.and_then(|inc| inc.accept().ok()) { -1240 let _conn = connecting.await.context("connecting")?; -1241 // Just accept incoming connections, but don't do anything with them. -1242 } -1243 -1244 Ok::<_, Error>(()) -1245 } -1246 }); -1247 -1248 Ok((ep, AbortOnDropHandle::new(handle))) -1249 } -1250}
\ No newline at end of file +1206 assert_eq!(resolved.to_node_addr(), expected_addr); +1207 assert_eq!(resolved.user_data(), Some(&user_data)); +1208 Ok(()) +1209 } +1210 +1211 const TEST_ALPN: &[u8] = b"TEST"; +1212 +1213 #[tokio::test] +1214 #[traced_test] +1215 async fn pkarr_publish_dns_discover() -> Result<()> { +1216 let dns_pkarr_server = DnsPkarrServer::run().await.context("DnsPkarrServer run")?; +1217 let (relay_map, _relay_url, _relay_guard) = run_relay_server().await?; +1218 +1219 let (ep1, _guard1) = ep_with_discovery(&relay_map, &dns_pkarr_server).await?; +1220 let (ep2, _guard2) = ep_with_discovery(&relay_map, &dns_pkarr_server).await?; +1221 +1222 // wait until our shared state received the update from pkarr publishing +1223 dns_pkarr_server +1224 .on_node(&ep1.node_id(), PUBLISH_TIMEOUT) +1225 .await +1226 .context("wait for on node update")?; +1227 +1228 // we connect only by node id! +1229 let _conn = ep2.connect(ep1.node_id(), TEST_ALPN).await?; +1230 Ok(()) +1231 } +1232 +1233 async fn ep_with_discovery( +1234 relay_map: &RelayMap, +1235 dns_pkarr_server: &DnsPkarrServer, +1236 ) -> Result<(Endpoint, AbortOnDropHandle<Result<()>>)> { +1237 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1238 let secret_key = SecretKey::generate(&mut rng); +1239 let ep = Endpoint::builder() +1240 .relay_mode(RelayMode::Custom(relay_map.clone())) +1241 .insecure_skip_relay_cert_verify(true) +1242 .secret_key(secret_key.clone()) +1243 .alpns(vec![TEST_ALPN.to_vec()]) +1244 .dns_resolver(dns_pkarr_server.dns_resolver()) +1245 .discovery(dns_pkarr_server.discovery(secret_key)) +1246 .bind() +1247 .await?; +1248 +1249 let handle = tokio::spawn({ +1250 let ep = ep.clone(); +1251 async move { +1252 // we skip accept() errors, they can be caused by retransmits +1253 while let Some(connecting) = ep.accept().await.and_then(|inc| inc.accept().ok()) { +1254 let _conn = connecting.await.context("connecting")?; +1255 // Just accept incoming connections, but don't do anything with them. +1256 } +1257 +1258 Ok::<_, Error>(()) +1259 } +1260 }); +1261 +1262 Ok((ep, AbortOnDropHandle::new(handle))) +1263 } +1264}
\ No newline at end of file diff --git a/pr/3465/docs/src/iroh/discovery/mdns.rs.html b/pr/3465/docs/src/iroh/discovery/mdns.rs.html index eae3c15f69..0f18962208 100644 --- a/pr/3465/docs/src/iroh/discovery/mdns.rs.html +++ b/pr/3465/docs/src/iroh/discovery/mdns.rs.html @@ -474,192 +474,203 @@ 474 use iroh_base::SecretKey; 475 use n0_future::StreamExt; 476 use n0_snafu::{Error, Result, ResultExt}; -477 use snafu::whatever; -478 use tracing_test::traced_test; -479 -480 use super::super::*; -481 use crate::discovery::UserData; -482 -483 #[tokio::test] -484 #[traced_test] -485 async fn mdns_publish_resolve() -> Result { -486 // Create discoverer A with advertise=false (only listens) -487 let (_, discovery_a) = make_discoverer(false)?; -488 // Create discoverer B with advertise=true (will broadcast) -489 let (node_id_b, discovery_b) = make_discoverer(true)?; -490 -491 // make addr info for discoverer b -492 let user_data: UserData = "foobar".parse()?; -493 let node_data = NodeData::new(None, BTreeSet::from(["0.0.0.0:11111".parse().unwrap()])) -494 .with_user_data(Some(user_data.clone())); -495 -496 // resolve twice to ensure we can create separate streams for the same node_id -497 let mut s1 = discovery_a -498 .subscribe() -499 .unwrap() -500 .filter(|event| match event { -501 DiscoveryEvent::Discovered(event) => event.node_id() == node_id_b, -502 _ => false, -503 }); -504 let mut s2 = discovery_a -505 .subscribe() -506 .unwrap() -507 .filter(|event| match event { -508 DiscoveryEvent::Discovered(event) => event.node_id() == node_id_b, -509 _ => false, -510 }); -511 -512 tracing::debug!(?node_id_b, "Discovering node id b"); -513 // publish discovery_b's address -514 discovery_b.publish(&node_data); -515 let DiscoveryEvent::Discovered(s1_res) = -516 tokio::time::timeout(Duration::from_secs(5), s1.next()) -517 .await -518 .context("timeout")? -519 .unwrap() -520 else { -521 panic!("Received unexpected discovery event"); -522 }; -523 let DiscoveryEvent::Discovered(s2_res) = -524 tokio::time::timeout(Duration::from_secs(5), s2.next()) -525 .await -526 .context("timeout")? -527 .unwrap() -528 else { -529 panic!("Received unexpected discovery event"); -530 }; -531 assert_eq!(s1_res.node_info().data, node_data); -532 assert_eq!(s2_res.node_info().data, node_data); -533 -534 Ok(()) -535 } +477 use rand::{CryptoRng, SeedableRng}; +478 use snafu::whatever; +479 use tracing_test::traced_test; +480 +481 use super::super::*; +482 use crate::discovery::UserData; +483 +484 #[tokio::test] +485 #[traced_test] +486 async fn mdns_publish_resolve() -> Result { +487 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +488 +489 // Create discoverer A with advertise=false (only listens) +490 let (_, discovery_a) = make_discoverer(&mut rng, false)?; +491 // Create discoverer B with advertise=true (will broadcast) +492 let (node_id_b, discovery_b) = make_discoverer(&mut rng, true)?; +493 +494 // make addr info for discoverer b +495 let user_data: UserData = "foobar".parse()?; +496 let node_data = NodeData::new(None, BTreeSet::from(["0.0.0.0:11111".parse().unwrap()])) +497 .with_user_data(Some(user_data.clone())); +498 +499 // resolve twice to ensure we can create separate streams for the same node_id +500 let mut s1 = discovery_a +501 .subscribe() +502 .unwrap() +503 .filter(|event| match event { +504 DiscoveryEvent::Discovered(event) => event.node_id() == node_id_b, +505 _ => false, +506 }); +507 let mut s2 = discovery_a +508 .subscribe() +509 .unwrap() +510 .filter(|event| match event { +511 DiscoveryEvent::Discovered(event) => event.node_id() == node_id_b, +512 _ => false, +513 }); +514 +515 tracing::debug!(?node_id_b, "Discovering node id b"); +516 // publish discovery_b's address +517 discovery_b.publish(&node_data); +518 let DiscoveryEvent::Discovered(s1_res) = +519 tokio::time::timeout(Duration::from_secs(5), s1.next()) +520 .await +521 .context("timeout")? +522 .unwrap() +523 else { +524 panic!("Received unexpected discovery event"); +525 }; +526 let DiscoveryEvent::Discovered(s2_res) = +527 tokio::time::timeout(Duration::from_secs(5), s2.next()) +528 .await +529 .context("timeout")? +530 .unwrap() +531 else { +532 panic!("Received unexpected discovery event"); +533 }; +534 assert_eq!(s1_res.node_info().data, node_data); +535 assert_eq!(s2_res.node_info().data, node_data); 536 -537 #[tokio::test] -538 #[traced_test] -539 async fn mdns_publish_expire() -> Result { -540 let (_, discovery_a) = make_discoverer(false)?; -541 let (node_id_b, discovery_b) = make_discoverer(true)?; -542 -543 // publish discovery_b's address -544 let node_data = NodeData::new(None, BTreeSet::from(["0.0.0.0:11111".parse().unwrap()])) -545 .with_user_data(Some("".parse()?)); -546 discovery_b.publish(&node_data); -547 -548 let mut s1 = discovery_a.subscribe().unwrap(); -549 tracing::debug!(?node_id_b, "Discovering node id b"); -550 -551 // Wait for the specific node to be discovered -552 loop { -553 let event = tokio::time::timeout(Duration::from_secs(5), s1.next()) -554 .await -555 .context("timeout")? -556 .expect("Stream should not be closed"); -557 -558 match event { -559 DiscoveryEvent::Discovered(item) if item.node_info().node_id == node_id_b => { -560 break; -561 } -562 _ => continue, // Ignore other discovery events -563 } -564 } -565 -566 // Shutdown node B -567 drop(discovery_b); -568 tokio::time::sleep(Duration::from_secs(5)).await; +537 Ok(()) +538 } +539 +540 #[tokio::test] +541 #[traced_test] +542 async fn mdns_publish_expire() -> Result { +543 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +544 let (_, discovery_a) = make_discoverer(&mut rng, false)?; +545 let (node_id_b, discovery_b) = make_discoverer(&mut rng, true)?; +546 +547 // publish discovery_b's address +548 let node_data = NodeData::new(None, BTreeSet::from(["0.0.0.0:11111".parse().unwrap()])) +549 .with_user_data(Some("".parse()?)); +550 discovery_b.publish(&node_data); +551 +552 let mut s1 = discovery_a.subscribe().unwrap(); +553 tracing::debug!(?node_id_b, "Discovering node id b"); +554 +555 // Wait for the specific node to be discovered +556 loop { +557 let event = tokio::time::timeout(Duration::from_secs(5), s1.next()) +558 .await +559 .context("timeout")? +560 .expect("Stream should not be closed"); +561 +562 match event { +563 DiscoveryEvent::Discovered(item) if item.node_info().node_id == node_id_b => { +564 break; +565 } +566 _ => continue, // Ignore other discovery events +567 } +568 } 569 -570 // Wait for the expiration event for the specific node -571 loop { -572 let event = tokio::time::timeout(Duration::from_secs(10), s1.next()) -573 .await -574 .context("timeout waiting for expiration event")? -575 .expect("Stream should not be closed"); -576 -577 match event { -578 DiscoveryEvent::Expired(expired_node_id) if expired_node_id == node_id_b => { -579 break; -580 } -581 _ => continue, // Ignore other events -582 } -583 } -584 -585 Ok(()) -586 } -587 -588 #[tokio::test] -589 #[traced_test] -590 async fn mdns_subscribe() -> Result { -591 let num_nodes = 5; -592 let mut node_ids = BTreeSet::new(); -593 let mut discoverers = vec![]; -594 -595 let (_, discovery) = make_discoverer(false)?; -596 let node_data = NodeData::new(None, BTreeSet::from(["0.0.0.0:11111".parse().unwrap()])); -597 -598 for i in 0..num_nodes { -599 let (node_id, discovery) = make_discoverer(true)?; -600 let user_data: UserData = format!("node{i}").parse()?; -601 let node_data = node_data.clone().with_user_data(Some(user_data.clone())); -602 node_ids.insert((node_id, Some(user_data))); -603 discovery.publish(&node_data); -604 discoverers.push(discovery); -605 } -606 -607 let mut events = discovery.subscribe().unwrap(); -608 -609 let test = async move { -610 let mut got_ids = BTreeSet::new(); -611 while got_ids.len() != num_nodes { -612 if let Some(DiscoveryEvent::Discovered(item)) = events.next().await { -613 if node_ids.contains(&(item.node_id(), item.user_data())) { -614 got_ids.insert((item.node_id(), item.user_data())); -615 } -616 } else { -617 whatever!( -618 "no more events, only got {} ids, expected {num_nodes}\n", -619 got_ids.len() -620 ); -621 } -622 } -623 assert_eq!(got_ids, node_ids); -624 Ok::<_, Error>(()) -625 }; -626 tokio::time::timeout(Duration::from_secs(5), test) -627 .await -628 .context("timeout")? -629 } -630 -631 #[tokio::test] -632 #[traced_test] -633 async fn non_advertising_node_not_discovered() -> Result { -634 let (_, discovery_a) = make_discoverer(false)?; -635 let (node_id_b, discovery_b) = make_discoverer(false)?; +570 // Shutdown node B +571 drop(discovery_b); +572 tokio::time::sleep(Duration::from_secs(5)).await; +573 +574 // Wait for the expiration event for the specific node +575 loop { +576 let event = tokio::time::timeout(Duration::from_secs(10), s1.next()) +577 .await +578 .context("timeout waiting for expiration event")? +579 .expect("Stream should not be closed"); +580 +581 match event { +582 DiscoveryEvent::Expired(expired_node_id) if expired_node_id == node_id_b => { +583 break; +584 } +585 _ => continue, // Ignore other events +586 } +587 } +588 +589 Ok(()) +590 } +591 +592 #[tokio::test] +593 #[traced_test] +594 async fn mdns_subscribe() -> Result { +595 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +596 +597 let num_nodes = 5; +598 let mut node_ids = BTreeSet::new(); +599 let mut discoverers = vec![]; +600 +601 let (_, discovery) = make_discoverer(&mut rng, false)?; +602 let node_data = NodeData::new(None, BTreeSet::from(["0.0.0.0:11111".parse().unwrap()])); +603 +604 for i in 0..num_nodes { +605 let (node_id, discovery) = make_discoverer(&mut rng, true)?; +606 let user_data: UserData = format!("node{i}").parse()?; +607 let node_data = node_data.clone().with_user_data(Some(user_data.clone())); +608 node_ids.insert((node_id, Some(user_data))); +609 discovery.publish(&node_data); +610 discoverers.push(discovery); +611 } +612 +613 let mut events = discovery.subscribe().unwrap(); +614 +615 let test = async move { +616 let mut got_ids = BTreeSet::new(); +617 while got_ids.len() != num_nodes { +618 if let Some(DiscoveryEvent::Discovered(item)) = events.next().await { +619 if node_ids.contains(&(item.node_id(), item.user_data())) { +620 got_ids.insert((item.node_id(), item.user_data())); +621 } +622 } else { +623 whatever!( +624 "no more events, only got {} ids, expected {num_nodes}\n", +625 got_ids.len() +626 ); +627 } +628 } +629 assert_eq!(got_ids, node_ids); +630 Ok::<_, Error>(()) +631 }; +632 tokio::time::timeout(Duration::from_secs(5), test) +633 .await +634 .context("timeout")? +635 } 636 -637 let (node_id_c, discovery_c) = make_discoverer(true)?; -638 let node_data_c = -639 NodeData::new(None, BTreeSet::from(["0.0.0.0:22222".parse().unwrap()])); -640 discovery_c.publish(&node_data_c); +637 #[tokio::test] +638 #[traced_test] +639 async fn non_advertising_node_not_discovered() -> Result { +640 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); 641 -642 let node_data_b = -643 NodeData::new(None, BTreeSet::from(["0.0.0.0:11111".parse().unwrap()])); -644 discovery_b.publish(&node_data_b); -645 -646 let mut stream_c = discovery_a.resolve(node_id_c).unwrap(); -647 let result_c = tokio::time::timeout(Duration::from_secs(2), stream_c.next()).await; -648 assert!(result_c.is_ok(), "Advertising node should be discoverable"); +642 let (_, discovery_a) = make_discoverer(&mut rng, false)?; +643 let (node_id_b, discovery_b) = make_discoverer(&mut rng, false)?; +644 +645 let (node_id_c, discovery_c) = make_discoverer(&mut rng, true)?; +646 let node_data_c = +647 NodeData::new(None, BTreeSet::from(["0.0.0.0:22222".parse().unwrap()])); +648 discovery_c.publish(&node_data_c); 649 -650 let mut stream_b = discovery_a.resolve(node_id_b).unwrap(); -651 let result_b = tokio::time::timeout(Duration::from_secs(2), stream_b.next()).await; -652 assert!( -653 result_b.is_err(), -654 "Expected timeout since node b isn't advertising" -655 ); -656 -657 Ok(()) -658 } -659 -660 fn make_discoverer(advertise: bool) -> Result<(PublicKey, MdnsDiscovery)> { -661 let node_id = SecretKey::generate(rand::rng()).public(); -662 Ok((node_id, MdnsDiscovery::new(node_id, advertise)?)) -663 } -664 } -665}
\ No newline at end of file +650 let node_data_b = +651 NodeData::new(None, BTreeSet::from(["0.0.0.0:11111".parse().unwrap()])); +652 discovery_b.publish(&node_data_b); +653 +654 let mut stream_c = discovery_a.resolve(node_id_c).unwrap(); +655 let result_c = tokio::time::timeout(Duration::from_secs(2), stream_c.next()).await; +656 assert!(result_c.is_ok(), "Advertising node should be discoverable"); +657 +658 let mut stream_b = discovery_a.resolve(node_id_b).unwrap(); +659 let result_b = tokio::time::timeout(Duration::from_secs(2), stream_b.next()).await; +660 assert!( +661 result_b.is_err(), +662 "Expected timeout since node b isn't advertising" +663 ); +664 +665 Ok(()) +666 } +667 +668 fn make_discoverer<R: CryptoRng + ?Sized>( +669 rng: &mut R, +670 advertise: bool, +671 ) -> Result<(PublicKey, MdnsDiscovery)> { +672 let node_id = SecretKey::generate(rng).public(); +673 Ok((node_id, MdnsDiscovery::new(node_id, advertise)?)) +674 } +675 } +676}
\ No newline at end of file diff --git a/pr/3465/docs/src/iroh/endpoint.rs.html b/pr/3465/docs/src/iroh/endpoint.rs.html index 516dad2130..b0d8bd416f 100644 --- a/pr/3465/docs/src/iroh/endpoint.rs.html +++ b/pr/3465/docs/src/iroh/endpoint.rs.html @@ -156,3123 +156,3129 @@ 156 157 /// Binds the magic endpoint. 158 pub async fn bind(self) -> Result<Endpoint, BindError> { -159 let relay_map = self.relay_mode.relay_map(); -160 let secret_key = self -161 .secret_key -162 .unwrap_or_else(|| SecretKey::generate(rand::rng())); -163 let static_config = StaticConfig { -164 transport_config: Arc::new(self.transport_config), -165 tls_config: tls::TlsConfig::new(secret_key.clone(), self.max_tls_tickets), -166 keylog: self.keylog, -167 }; -168 let server_config = static_config.create_server_config(self.alpn_protocols); -169 -170 #[cfg(not(wasm_browser))] -171 let dns_resolver = self.dns_resolver.unwrap_or_default(); -172 -173 let discovery: Option<Box<dyn Discovery>> = { -174 let context = DiscoveryContext { -175 secret_key: &secret_key, -176 #[cfg(not(wasm_browser))] -177 dns_resolver: &dns_resolver, -178 }; -179 let discovery = self -180 .discovery -181 .into_iter() -182 .map(|builder| builder.into_discovery(&context)) -183 .collect::<Result<Vec<_>, IntoDiscoveryError>>()?; -184 match discovery.len() { -185 0 => None, -186 1 => Some(discovery.into_iter().next().expect("checked length")), -187 _ => Some(Box::new(ConcurrentDiscovery::from_services(discovery))), -188 } -189 }; -190 -191 let metrics = EndpointMetrics::default(); -192 -193 let msock_opts = magicsock::Options { -194 addr_v4: self.addr_v4, -195 addr_v6: self.addr_v6, -196 secret_key, -197 relay_map, -198 node_map: self.node_map, -199 discovery, -200 discovery_user_data: self.discovery_user_data, -201 proxy_url: self.proxy_url, -202 #[cfg(not(wasm_browser))] -203 dns_resolver, -204 server_config, -205 #[cfg(any(test, feature = "test-utils"))] -206 insecure_skip_relay_cert_verify: self.insecure_skip_relay_cert_verify, -207 #[cfg(any(test, feature = "test-utils"))] -208 path_selection: self.path_selection, -209 metrics, -210 }; -211 -212 Endpoint::bind(static_config, msock_opts).await -213 } -214 -215 // # The very common methods everyone basically needs. -216 -217 /// Sets the IPv4 bind address. -218 /// -219 /// Setting the port to `0` will use a random port. -220 /// If the port specified is already in use, it will fallback to choosing a random port. -221 /// -222 /// By default will use `0.0.0.0:0` to bind to. -223 pub fn bind_addr_v4(mut self, addr: SocketAddrV4) -> Self { -224 self.addr_v4.replace(addr); -225 self -226 } -227 -228 /// Sets the IPv6 bind address. -229 /// -230 /// Setting the port to `0` will use a random port. -231 /// If the port specified is already in use, it will fallback to choosing a random port. -232 /// -233 /// By default will use `[::]:0` to bind to. -234 pub fn bind_addr_v6(mut self, addr: SocketAddrV6) -> Self { -235 self.addr_v6.replace(addr); -236 self -237 } -238 -239 /// Sets a secret key to authenticate with other peers. -240 /// -241 /// This secret key's public key will be the [`PublicKey`] of this endpoint and thus -242 /// also its [`NodeId`] -243 /// -244 /// If not set, a new secret key will be generated. -245 /// -246 /// [`PublicKey`]: iroh_base::PublicKey -247 pub fn secret_key(mut self, secret_key: SecretKey) -> Self { -248 self.secret_key = Some(secret_key); -249 self -250 } -251 -252 /// Sets the [ALPN] protocols that this endpoint will accept on incoming connections. -253 /// -254 /// Not setting this will still allow creating connections, but to accept incoming -255 /// connections at least one [ALPN] must be set. -256 /// -257 /// [ALPN]: https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation -258 pub fn alpns(mut self, alpn_protocols: Vec<Vec<u8>>) -> Self { -259 self.alpn_protocols = alpn_protocols; -260 self -261 } -262 -263 // # Methods for common customisation items. -264 -265 /// Sets the relay servers to assist in establishing connectivity. -266 /// -267 /// Relay servers are used to establish initial connection with another iroh node. -268 /// They also perform various functions related to hole punching, see the [crate docs] -269 /// for more details. -270 /// -271 /// By default the [number 0] relay servers are used, see [`RelayMode::Default`]. -272 /// -273 /// When using [RelayMode::Custom], the provided `relay_map` must contain at least one -274 /// configured relay node. If an invalid RelayMap is provided [`bind`] -275 /// will result in an error. -276 /// -277 /// [`bind`]: Builder::bind -278 /// [crate docs]: crate -279 /// [number 0]: https://n0.computer -280 pub fn relay_mode(mut self, relay_mode: RelayMode) -> Self { -281 self.relay_mode = relay_mode; -282 self -283 } -284 -285 /// Removes all discovery services from the builder. -286 pub fn clear_discovery(mut self) -> Self { -287 self.discovery.clear(); -288 self -289 } -290 -291 /// Optionally sets a discovery mechanism for this endpoint. -292 /// -293 /// If you want to combine multiple discovery services, you can use -294 /// [`Builder::add_discovery`] instead. This will internally create a -295 /// [`crate::discovery::ConcurrentDiscovery`]. -296 /// -297 /// If no discovery service is set, connecting to a node without providing its -298 /// direct addresses or relay URLs will fail. -299 /// -300 /// See the documentation of the [`Discovery`] trait for details. -301 pub fn discovery(mut self, discovery: impl IntoDiscovery) -> Self { -302 self.discovery.clear(); -303 self.discovery.push(Box::new(discovery)); -304 self -305 } -306 -307 /// Adds a discovery mechanism for this endpoint. -308 /// -309 /// The function `discovery` -310 /// will be called on endpoint creation with the configured secret key of -311 /// the endpoint. Discovery services that need to publish information need -312 /// to use this secret key to sign the information. -313 /// -314 /// If you add multiple discovery services, they will be combined using a -315 /// [`crate::discovery::ConcurrentDiscovery`]. -316 /// -317 /// If no discovery service is set, connecting to a node without providing its -318 /// direct addresses or relay URLs will fail. -319 /// -320 /// To clear all discovery services, use [`Builder::clear_discovery`]. -321 /// -322 /// See the documentation of the [`Discovery`] trait for details. -323 pub fn add_discovery(mut self, discovery: impl IntoDiscovery) -> Self { -324 self.discovery.push(Box::new(discovery)); -325 self -326 } -327 -328 /// Configures the endpoint to use the default n0 DNS discovery service. -329 /// -330 /// The default discovery service publishes to and resolves from the -331 /// n0.computer dns server `iroh.link`. -332 /// -333 /// This is equivalent to adding both a [`crate::discovery::pkarr::PkarrPublisher`] -334 /// and a [`crate::discovery::dns::DnsDiscovery`], both configured to use the -335 /// n0.computer dns server. -336 /// -337 /// This will by default use [`N0_DNS_PKARR_RELAY_PROD`]. -338 /// When in tests, or when the `test-utils` feature is enabled, this will use the -339 /// [`N0_DNS_PKARR_RELAY_STAGING`]. -340 /// -341 /// [`N0_DNS_PKARR_RELAY_PROD`]: crate::discovery::pkarr::N0_DNS_PKARR_RELAY_PROD -342 /// [`N0_DNS_PKARR_RELAY_STAGING`]: crate::discovery::pkarr::N0_DNS_PKARR_RELAY_STAGING -343 pub fn discovery_n0(mut self) -> Self { -344 self = self.add_discovery(PkarrPublisher::n0_dns()); -345 // Resolve using HTTPS requests to our DNS server's /pkarr path in browsers -346 #[cfg(wasm_browser)] -347 { -348 self = self.add_discovery(PkarrResolver::n0_dns()); -349 } -350 // Resolve using DNS queries outside browsers. -351 #[cfg(not(wasm_browser))] -352 { -353 self = self.add_discovery(DnsDiscovery::n0_dns()); -354 } -355 self -356 } -357 -358 #[cfg(feature = "discovery-pkarr-dht")] -359 /// Configures the endpoint to also use the mainline DHT with default settings. -360 /// -361 /// This is equivalent to adding a [`crate::discovery::pkarr::dht::DhtDiscovery`] -362 /// with default settings. Note that DhtDiscovery has various more advanced -363 /// configuration options. If you need any of those, you should manually -364 /// create a DhtDiscovery and add it with [`Builder::add_discovery`]. -365 pub fn discovery_dht(mut self) -> Self { -366 self = self.add_discovery(crate::discovery::pkarr::dht::DhtDiscovery::builder()); -367 self -368 } -369 -370 #[cfg(feature = "discovery-local-network")] -371 /// Configures the endpoint to also use local network discovery. -372 /// -373 /// This is equivalent to adding a [`crate::discovery::mdns::MdnsDiscovery`] -374 /// with default settings. Note that MdnsDiscovery has various more advanced -375 /// configuration options. If you need any of those, you should manually -376 /// create a MdnsDiscovery and add it with [`Builder::add_discovery`]. -377 pub fn discovery_local_network(mut self) -> Self { -378 self = self.add_discovery(crate::discovery::mdns::MdnsDiscovery::builder()); -379 self -380 } -381 -382 /// Sets the initial user-defined data to be published in discovery services for this node. -383 /// -384 /// When using discovery services, this string of [`UserData`] will be published together -385 /// with the node's addresses and relay URL. When other nodes discover this node, -386 /// they retrieve the [`UserData`] in addition to the addressing info. -387 /// -388 /// Iroh itself does not interpret the user-defined data in any way, it is purely left -389 /// for applications to parse and use. -390 pub fn user_data_for_discovery(mut self, user_data: UserData) -> Self { -391 self.discovery_user_data = Some(user_data); -392 self -393 } -394 -395 /// Optionally set a list of known nodes. -396 pub fn known_nodes(mut self, nodes: Vec<NodeAddr>) -> Self { -397 self.node_map = Some(nodes); -398 self -399 } -400 -401 // # Methods for more specialist customisation. -402 -403 /// Sets a custom [`quinn::TransportConfig`] for this endpoint. -404 /// -405 /// The transport config contains parameters governing the QUIC state machine. -406 /// -407 /// If unset, the default config is used. Default values should be suitable for most -408 /// internet applications. Applications protocols which forbid remotely-initiated -409 /// streams should set `max_concurrent_bidi_streams` and `max_concurrent_uni_streams` to -410 /// zero. -411 /// -412 /// Please be aware that changing some settings may have adverse effects on establishing -413 /// and maintaining direct connections. -414 pub fn transport_config(mut self, transport_config: quinn::TransportConfig) -> Self { -415 self.transport_config = transport_config; -416 self -417 } -418 -419 /// Optionally sets a custom DNS resolver to use for this endpoint. -420 /// -421 /// The DNS resolver is used to resolve relay hostnames, and node addresses if -422 /// [`crate::discovery::dns::DnsDiscovery`] is configured. -423 /// -424 /// By default, a new DNS resolver is created which is configured to use the -425 /// host system's DNS configuration. You can pass a custom instance of [`DnsResolver`] -426 /// here to use a differently configured DNS resolver for this endpoint, or to share -427 /// a [`DnsResolver`] between multiple endpoints. -428 #[cfg(not(wasm_browser))] -429 pub fn dns_resolver(mut self, dns_resolver: DnsResolver) -> Self { -430 self.dns_resolver = Some(dns_resolver); -431 self -432 } -433 -434 /// Sets an explicit proxy url to proxy all HTTP(S) traffic through. -435 pub fn proxy_url(mut self, url: Url) -> Self { -436 self.proxy_url.replace(url); -437 self -438 } -439 -440 /// Sets the proxy url from the environment, in this order: -441 /// -442 /// - `HTTP_PROXY` -443 /// - `http_proxy` -444 /// - `HTTPS_PROXY` -445 /// - `https_proxy` -446 pub fn proxy_from_env(mut self) -> Self { -447 self.proxy_url = proxy_url_from_env(); -448 self -449 } -450 -451 /// Enables saving the TLS pre-master key for connections. -452 /// -453 /// This key should normally remain secret but can be useful to debug networking issues -454 /// by decrypting captured traffic. -455 /// -456 /// If *keylog* is `true` then setting the `SSLKEYLOGFILE` environment variable to a -457 /// filename will result in this file being used to log the TLS pre-master keys. -458 pub fn keylog(mut self, keylog: bool) -> Self { -459 self.keylog = keylog; -460 self -461 } -462 -463 /// Skip verification of SSL certificates from relay servers -464 /// -465 /// May only be used in tests. -466 #[cfg(any(test, feature = "test-utils"))] -467 pub fn insecure_skip_relay_cert_verify(mut self, skip_verify: bool) -> Self { -468 self.insecure_skip_relay_cert_verify = skip_verify; -469 self -470 } -471 -472 /// This implies we only use the relay to communicate -473 /// and do not attempt to do any hole punching. -474 #[cfg(any(test, feature = "test-utils"))] -475 pub fn path_selection(mut self, path_selection: PathSelection) -> Self { -476 self.path_selection = path_selection; -477 self -478 } -479 -480 /// Set the maximum number of TLS tickets to cache. -481 /// -482 /// Set this to a larger value if you want to do 0rtt connections to a large -483 /// number of clients. -484 /// -485 /// The default is 256, taking about 150 KiB in memory. -486 pub fn max_tls_tickets(mut self, n: usize) -> Self { -487 self.max_tls_tickets = n; -488 self -489 } -490} -491 -492/// Configuration for a [`quinn::Endpoint`] that cannot be changed at runtime. -493#[derive(Debug)] -494struct StaticConfig { -495 tls_config: tls::TlsConfig, -496 transport_config: Arc<quinn::TransportConfig>, -497 keylog: bool, -498} -499 -500impl StaticConfig { -501 /// Create a [`quinn::ServerConfig`] with the specified ALPN protocols. -502 fn create_server_config(&self, alpn_protocols: Vec<Vec<u8>>) -> ServerConfig { -503 let quic_server_config = self -504 .tls_config -505 .make_server_config(alpn_protocols, self.keylog); -506 let mut server_config = ServerConfig::with_crypto(Arc::new(quic_server_config)); -507 server_config.transport_config(self.transport_config.clone()); -508 -509 server_config -510 } -511} -512 -513/// Controls an iroh node, establishing connections with other nodes. -514/// -515/// This is the main API interface to create connections to, and accept connections from -516/// other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is -517/// used to make the connections reliable. See the [crate docs] for a more detailed -518/// overview of iroh. -519/// -520/// It is recommended to only create a single instance per application. This ensures all -521/// the connections made share the same peer-to-peer connections to other iroh nodes, -522/// while still remaining independent connections. This will result in more optimal network -523/// behaviour. -524/// -525/// The endpoint is created using the [`Builder`], which can be created using -526/// [`Endpoint::builder`]. -527/// -528/// Once an endpoint exists, new connections are typically created using the -529/// [`Endpoint::connect`] and [`Endpoint::accept`] methods. Once established, the -530/// [`Connection`] gives access to most [QUIC] features. Individual streams to send data to -531/// the peer are created using the [`Connection::open_bi`], [`Connection::accept_bi`], -532/// [`Connection::open_uni`] and [`Connection::open_bi`] functions. -533/// -534/// Note that due to the light-weight properties of streams a stream will only be accepted -535/// once the initiating peer has sent some data on it. -536/// -537/// [QUIC]: https://quicwg.org -538#[derive(Clone, Debug)] -539pub struct Endpoint { -540 /// Handle to the magicsocket/actor -541 msock: Handle, -542 /// Handle to the actor that resets the quinn RTT estimator -543 rtt_actor: Arc<rtt_actor::RttHandle>, -544 /// Configuration structs for quinn, holds the transport config, certificate setup, secret key etc. -545 static_config: Arc<StaticConfig>, -546} -547 -548#[allow(missing_docs)] -549#[common_fields({ -550 backtrace: Option<snafu::Backtrace>, -551 #[snafu(implicit)] -552 span_trace: n0_snafu::SpanTrace, -553})] -554#[derive(Debug, Snafu)] -555#[non_exhaustive] -556pub enum ConnectWithOptsError { -557 #[snafu(transparent)] -558 AddNodeAddr { source: AddNodeAddrError }, -559 #[snafu(display("Connecting to ourself is not supported"))] -560 SelfConnect {}, -561 #[snafu(display("No addressing information available"))] -562 NoAddress { source: GetMappingAddressError }, -563 #[snafu(display("Unable to connect to remote"))] -564 Quinn { source: quinn::ConnectError }, -565} -566 -567#[allow(missing_docs)] -568#[common_fields({ -569 backtrace: Option<snafu::Backtrace>, -570 #[snafu(implicit)] -571 span_trace: n0_snafu::SpanTrace, -572})] -573#[derive(Debug, Snafu)] -574#[non_exhaustive] -575pub enum ConnectError { -576 #[snafu(transparent)] -577 Connect { -578 #[snafu(source(from(ConnectWithOptsError, Box::new)))] -579 source: Box<ConnectWithOptsError>, -580 }, -581 #[snafu(transparent)] -582 Connection { -583 #[snafu(source(from(ConnectionError, Box::new)))] -584 source: Box<ConnectionError>, -585 }, -586} -587 -588#[allow(missing_docs)] -589#[common_fields({ -590 backtrace: Option<snafu::Backtrace>, -591 #[snafu(implicit)] -592 span_trace: n0_snafu::SpanTrace, -593})] -594#[derive(Debug, Snafu)] -595#[non_exhaustive] -596pub enum BindError { -597 #[snafu(transparent)] -598 MagicSpawn { -599 source: magicsock::CreateHandleError, -600 }, -601 #[snafu(transparent)] -602 Discovery { -603 source: crate::discovery::IntoDiscoveryError, -604 }, -605} -606 -607#[allow(missing_docs)] -608#[common_fields({ -609 backtrace: Option<snafu::Backtrace>, -610 #[snafu(implicit)] -611 span_trace: n0_snafu::SpanTrace, -612})] -613#[derive(Debug, Snafu)] -614#[snafu(module)] -615#[non_exhaustive] -616pub enum GetMappingAddressError { -617 #[snafu(display("Discovery service required due to missing addressing information"))] -618 DiscoveryStart { source: DiscoveryError }, -619 #[snafu(display("Discovery service failed"))] -620 Discover { source: DiscoveryError }, -621 #[snafu(display("No addressing information found"))] -622 NoAddress {}, -623} -624 -625impl Endpoint { -626 // The ordering of public methods is reflected directly in the documentation. This is -627 // roughly ordered by what is most commonly needed by users, but grouped in similar -628 // items. -629 -630 // # Methods relating to construction. -631 -632 /// Returns the builder for an [`Endpoint`], with a production configuration. -633 pub fn builder() -> Builder { -634 Builder::default() -635 } -636 -637 /// Creates a quinn endpoint backed by a magicsock. -638 /// -639 /// This is for internal use, the public interface is the [`Builder`] obtained from -640 /// [Self::builder]. See the methods on the builder for documentation of the parameters. -641 #[instrument("ep", skip_all, fields(me = %static_config.tls_config.secret_key.public().fmt_short()))] -642 async fn bind( -643 static_config: StaticConfig, -644 msock_opts: magicsock::Options, -645 ) -> Result<Self, BindError> { -646 let msock = magicsock::MagicSock::spawn(msock_opts).await?; -647 trace!("created magicsock"); -648 debug!(version = env!("CARGO_PKG_VERSION"), "iroh Endpoint created"); -649 -650 let metrics = msock.metrics.magicsock.clone(); -651 let ep = Self { -652 msock, -653 rtt_actor: Arc::new(rtt_actor::RttHandle::new(metrics)), -654 static_config: Arc::new(static_config), -655 }; -656 Ok(ep) -657 } -658 -659 /// Sets the list of accepted ALPN protocols. -660 /// -661 /// This will only affect new incoming connections. -662 /// Note that this *overrides* the current list of ALPNs. -663 pub fn set_alpns(&self, alpns: Vec<Vec<u8>>) { -664 let server_config = self.static_config.create_server_config(alpns); -665 self.msock.endpoint().set_server_config(Some(server_config)); -666 } -667 -668 // # Methods for establishing connectivity. -669 -670 /// Connects to a remote [`Endpoint`]. -671 /// -672 /// A value that can be converted into a [`NodeAddr`] is required. This can be either a -673 /// [`NodeAddr`], a [`NodeId`] or a [`iroh_base::ticket::NodeTicket`]. -674 /// -675 /// The [`NodeAddr`] must contain the [`NodeId`] to dial and may also contain a [`RelayUrl`] -676 /// and direct addresses. If direct addresses are provided, they will be used to try and -677 /// establish a direct connection without involving a relay server. -678 /// -679 /// If neither a [`RelayUrl`] or direct addresses are configured in the [`NodeAddr`] it -680 /// may still be possible a connection can be established. This depends on other calls -681 /// to [`Endpoint::add_node_addr`] which may provide contact information, or via the -682 /// [`Discovery`] service configured using [`Builder::discovery`]. The discovery -683 /// service will also be used if the remote node is not reachable on the provided direct -684 /// addresses and there is no [`RelayUrl`]. -685 /// -686 /// If addresses or relay servers are neither provided nor can be discovered, the -687 /// connection attempt will fail with an error. -688 /// -689 /// The `alpn`, or application-level protocol identifier, is also required. The remote -690 /// endpoint must support this `alpn`, otherwise the connection attempt will fail with -691 /// an error. -692 pub async fn connect( -693 &self, -694 node_addr: impl Into<NodeAddr>, -695 alpn: &[u8], -696 ) -> Result<Connection, ConnectError> { -697 let node_addr = node_addr.into(); -698 let remote = node_addr.node_id; -699 let connecting = self -700 .connect_with_opts(node_addr, alpn, Default::default()) -701 .await?; -702 let conn = connecting.await?; -703 -704 debug!( -705 me = %self.node_id().fmt_short(), -706 remote = %remote.fmt_short(), -707 alpn = %String::from_utf8_lossy(alpn), -708 "Connection established." -709 ); -710 Ok(conn) -711 } -712 -713 /// Starts a connection attempt with a remote [`Endpoint`]. -714 /// -715 /// Like [`Endpoint::connect`] (see also its docs for general details), but allows for a more -716 /// advanced connection setup with more customization in two aspects: -717 /// 1. The returned future resolves to a [`Connecting`], which can be further processed into -718 /// a [`Connection`] by awaiting, or alternatively allows connecting with 0RTT via -719 /// [`Connecting::into_0rtt`]. -720 /// **Note:** Please read the documentation for `into_0rtt` carefully to assess -721 /// security concerns. -722 /// 2. The [`TransportConfig`] for the connection can be modified via the provided -723 /// [`ConnectOptions`]. -724 /// **Note:** Please be aware that changing transport config settings may have adverse effects on -725 /// establishing and maintaining direct connections. Carefully test settings you use and -726 /// consider this currently as still rather experimental. -727 #[instrument(name = "connect", skip_all, fields( -728 me = %self.node_id().fmt_short(), -729 remote = tracing::field::Empty, -730 alpn = String::from_utf8_lossy(alpn).to_string(), -731 ))] -732 pub async fn connect_with_opts( -733 &self, -734 node_addr: impl Into<NodeAddr>, -735 alpn: &[u8], -736 options: ConnectOptions, -737 ) -> Result<Connecting, ConnectWithOptsError> { -738 let node_addr: NodeAddr = node_addr.into(); -739 tracing::Span::current().record( -740 "remote", -741 tracing::field::display(node_addr.node_id.fmt_short()), -742 ); -743 -744 // Connecting to ourselves is not supported. -745 ensure!(node_addr.node_id != self.node_id(), SelfConnectSnafu); -746 -747 if !node_addr.is_empty() { -748 self.add_node_addr(node_addr.clone())?; -749 } -750 let node_id = node_addr.node_id; -751 let direct_addresses = node_addr.direct_addresses.clone(); -752 let relay_url = node_addr.relay_url.clone(); -753 -754 // Get the mapped IPv6 address from the magic socket. Quinn will connect to this -755 // address. Start discovery for this node if it's enabled and we have no valid or -756 // verified address information for this node. Dropping the discovery cancels any -757 // still running task. -758 let (mapped_addr, _discovery_drop_guard) = self -759 .get_mapping_addr_and_maybe_start_discovery(node_addr) -760 .await -761 .context(NoAddressSnafu)?; -762 -763 let transport_config = options -764 .transport_config -765 .unwrap_or(self.static_config.transport_config.clone()); -766 -767 // Start connecting via quinn. This will time out after 10 seconds if no reachable -768 // address is available. -769 -770 debug!( -771 ?mapped_addr, -772 ?direct_addresses, -773 ?relay_url, -774 "Attempting connection..." -775 ); -776 let client_config = { -777 let mut alpn_protocols = vec![alpn.to_vec()]; -778 alpn_protocols.extend(options.additional_alpns); -779 let quic_client_config = self -780 .static_config -781 .tls_config -782 .make_client_config(alpn_protocols, self.static_config.keylog); -783 let mut client_config = quinn::ClientConfig::new(Arc::new(quic_client_config)); -784 client_config.transport_config(transport_config); -785 client_config -786 }; -787 -788 let server_name = &tls::name::encode(node_id); -789 let connect = self -790 .msock -791 .endpoint() -792 .connect_with( -793 client_config, -794 mapped_addr.private_socket_addr(), -795 server_name, -796 ) -797 .context(QuinnSnafu)?; -798 -799 Ok(Connecting { -800 inner: connect, -801 ep: self.clone(), -802 remote_node_id: Some(node_id), -803 _discovery_drop_guard, -804 }) -805 } -806 -807 /// Accepts an incoming connection on the endpoint. -808 /// -809 /// Only connections with the ALPNs configured in [`Builder::alpns`] will be accepted. -810 /// If multiple ALPNs have been configured the ALPN can be inspected before accepting -811 /// the connection using [`Connecting::alpn`]. -812 /// -813 /// The returned future will yield `None` if the endpoint is closed by calling -814 /// [`Endpoint::close`]. -815 pub fn accept(&self) -> Accept<'_> { -816 Accept { -817 inner: self.msock.endpoint().accept(), -818 ep: self.clone(), -819 } -820 } -821 -822 // # Methods for manipulating the internal state about other nodes. -823 -824 /// Informs this [`Endpoint`] about addresses of the iroh node. -825 /// -826 /// This updates the local state for the remote node. If the provided [`NodeAddr`] -827 /// contains a [`RelayUrl`] this will be used as the new relay server for this node. If -828 /// it contains any new IP endpoints they will also be stored and tried when next -829 /// connecting to this node. Any address that matches this node's direct addresses will be -830 /// silently ignored. -831 /// -832 /// See also [`Endpoint::add_node_addr_with_source`]. -833 /// -834 /// # Using node discovery instead -835 /// -836 /// It is strongly advised to use node discovery using the [`StaticProvider`] instead. -837 /// This provides more flexibility and future proofing. -838 /// -839 /// # Errors -840 /// -841 /// Will return an error if we attempt to add our own [`NodeId`] to the node map or -842 /// if the direct addresses are a subset of ours. -843 /// -844 /// [`StaticProvider`]: crate::discovery::static_provider::StaticProvider -845 pub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), AddNodeAddrError> { -846 self.add_node_addr_inner(node_addr, magicsock::Source::App) -847 } -848 -849 /// Informs this [`Endpoint`] about addresses of the iroh node, noting the source. -850 /// -851 /// This updates the local state for the remote node. If the provided [`NodeAddr`] contains a -852 /// [`RelayUrl`] this will be used as the new relay server for this node. If it contains any -853 /// new IP endpoints they will also be stored and tried when next connecting to this node. Any -854 /// address that matches this node's direct addresses will be silently ignored. The *source* is -855 /// used for logging exclusively and will not be stored. -856 /// -857 /// # Using node discovery instead -858 /// -859 /// It is strongly advised to use node discovery using the [`StaticProvider`] instead. -860 /// This provides more flexibility and future proofing. -861 /// -862 /// # Errors -863 /// -864 /// Will return an error if we attempt to add our own [`NodeId`] to the node map or -865 /// if the direct addresses are a subset of ours. -866 /// -867 /// [`StaticProvider`]: crate::discovery::static_provider::StaticProvider -868 pub fn add_node_addr_with_source( -869 &self, -870 node_addr: NodeAddr, -871 source: &'static str, -872 ) -> Result<(), AddNodeAddrError> { -873 self.add_node_addr_inner( -874 node_addr, -875 magicsock::Source::NamedApp { -876 name: source.into(), -877 }, -878 ) -879 } -880 -881 fn add_node_addr_inner( -882 &self, -883 node_addr: NodeAddr, -884 source: magicsock::Source, -885 ) -> Result<(), AddNodeAddrError> { -886 // Connecting to ourselves is not supported. -887 snafu::ensure!(node_addr.node_id != self.node_id(), OwnAddressSnafu); -888 self.msock.add_node_addr(node_addr, source) -889 } -890 -891 // # Getter methods for properties of this Endpoint itself. -892 -893 /// Returns the secret_key of this endpoint. -894 pub fn secret_key(&self) -> &SecretKey { -895 &self.static_config.tls_config.secret_key -896 } -897 -898 /// Returns the node id of this endpoint. -899 /// -900 /// This ID is the unique addressing information of this node and other peers must know -901 /// it to be able to connect to this node. -902 pub fn node_id(&self) -> NodeId { -903 self.static_config.tls_config.secret_key.public() -904 } -905 -906 /// Returns a [`Watcher`] for the current [`NodeAddr`] for this endpoint. -907 /// -908 /// The observed [`NodeAddr`] will have the current [`RelayUrl`] and direct addresses -909 /// as they would be returned by [`Endpoint::home_relay`] and [`Endpoint::direct_addresses`]. -910 /// -911 /// Use [`Watcher::initialized`] to wait for a [`NodeAddr`] that is ready to be connected to: -912 /// -913 /// ```no_run -914 /// # async fn wrapper() -> n0_snafu::Result { -915 /// use iroh::{Endpoint, Watcher}; -916 /// -917 /// let endpoint = Endpoint::builder() -918 /// .alpns(vec![b"my-alpn".to_vec()]) -919 /// .bind() -920 /// .await?; -921 /// let node_addr = endpoint.node_addr().initialized().await; -922 /// # let _ = node_addr; -923 /// # Ok(()) -924 /// # } -925 /// ``` -926 #[cfg(not(wasm_browser))] -927 pub fn node_addr(&self) -> impl n0_watcher::Watcher<Value = Option<NodeAddr>> + use<> { -928 let watch_addrs = self.direct_addresses(); -929 let watch_relay = self.home_relay(); -930 let node_id = self.node_id(); -931 -932 watch_addrs -933 .or(watch_relay) -934 .map(move |(addrs, mut relays)| match addrs { -935 Some(addrs) => Some(NodeAddr::from_parts( -936 node_id, -937 relays.pop(), -938 addrs.into_iter().map(|x| x.addr), -939 )), -940 None => relays.pop().map(|relay_url| { -941 NodeAddr::from_parts(node_id, Some(relay_url), std::iter::empty()) -942 }), -943 }) -944 .expect("watchable is alive - cannot be disconnected yet") -945 } -946 -947 /// Returns a [`Watcher`] for the current [`NodeAddr`] for this endpoint. -948 /// -949 /// When compiled to Wasm, this function returns a watcher that initializes -950 /// with a [`NodeAddr`] that only contains a relay URL, but no direct addresses, -951 /// as there are no APIs for directly using sockets in browsers. -952 #[cfg(wasm_browser)] -953 pub fn node_addr(&self) -> impl n0_watcher::Watcher<Value = Option<NodeAddr>> + use<> { -954 // In browsers, there will never be any direct addresses, so we wait -955 // for the home relay instead. This makes the `NodeAddr` have *some* way -956 // of connecting to us. -957 let watch_relay = self.home_relay(); -958 let node_id = self.node_id(); -959 watch_relay -960 .map(move |mut relays| { -961 relays.pop().map(|relay_url| { -962 NodeAddr::from_parts(node_id, Some(relay_url), std::iter::empty()) -963 }) -964 }) -965 .expect("watchable is alive - cannot be disconnected yet") -966 } -967 -968 /// Returns a [`Watcher`] for the [`RelayUrl`] of the Relay server used as home relay. -969 /// -970 /// Every endpoint has a home Relay server which it chooses as the server with the -971 /// lowest latency out of the configured servers provided by [`Builder::relay_mode`]. -972 /// This is the server other iroh nodes can use to reliably establish a connection -973 /// to this node. -974 /// -975 /// The watcher stores `None` if we are not connected to any Relay server. -976 /// -977 /// Note that this will store `None` right after the [`Endpoint`] is created since it takes -978 /// some time to connect to find and connect to the home relay server. -979 /// -980 /// # Examples -981 /// -982 /// To wait for a home relay connection to be established, use [`Watcher::initialized`]: -983 /// ```no_run -984 /// use iroh::{Endpoint, Watcher}; -985 /// -986 /// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap(); -987 /// # rt.block_on(async move { -988 /// let mep = Endpoint::builder().bind().await.unwrap(); -989 /// let _relay_url = mep.home_relay().initialized().await; -990 /// # }); -991 /// ``` -992 pub fn home_relay(&self) -> impl n0_watcher::Watcher<Value = Vec<RelayUrl>> + use<> { -993 self.msock.home_relay() -994 } -995 -996 /// Returns a [`Watcher`] for the direct addresses of this [`Endpoint`]. -997 /// -998 /// The direct addresses of the [`Endpoint`] are those that could be used by other -999 /// iroh nodes to establish direct connectivity, depending on the network -1000 /// situation. The yielded lists of direct addresses contain both the locally-bound -1001 /// addresses and the [`Endpoint`]'s publicly reachable addresses discovered through -1002 /// mechanisms such as [QAD] and port mapping. Hence usually only a subset of these -1003 /// will be applicable to a certain remote iroh node. -1004 /// -1005 /// The [`Endpoint`] continuously monitors the direct addresses for changes as its own -1006 /// location in the network might change. Whenever changes are detected this stream -1007 /// will yield a new list of direct addresses. -1008 /// -1009 /// When issuing the first call to this method the first direct address discovery might -1010 /// still be underway, in this case the [`Watcher`] might not be initialized with [`Some`] -1011 /// value yet. Once the first set of local direct addresses are discovered the [`Watcher`] -1012 /// will always return [`Some`] set of direct addresses immediately, which are the most -1013 /// recently discovered direct addresses. -1014 /// -1015 /// # Examples -1016 /// -1017 /// To get the first set of direct addresses use [`Watcher::initialized`]: -1018 /// ```no_run -1019 /// use iroh::{Endpoint, Watcher as _}; -1020 /// -1021 /// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap(); -1022 /// # rt.block_on(async move { -1023 /// let ep = Endpoint::builder().bind().await.unwrap(); -1024 /// let _addrs = ep.direct_addresses().initialized().await; -1025 /// # }); -1026 /// ``` -1027 /// -1028 /// [QAD]: https://www.ietf.org/archive/id/draft-ietf-quic-address-discovery-00.html -1029 pub fn direct_addresses(&self) -> n0_watcher::Direct<Option<BTreeSet<DirectAddr>>> { -1030 self.msock.direct_addresses() -1031 } -1032 -1033 /// Returns a [`Watcher`] for any net-reports run from this [`Endpoint`]. -1034 /// -1035 /// A `net-report` checks the network conditions of the [`Endpoint`], such as -1036 /// whether it is connected to the internet via Ipv4 and/or Ipv6, its NAT -1037 /// status, its latency to the relay servers, and its public addresses. -1038 /// -1039 /// The [`Endpoint`] continuously runs `net-reports` to monitor if network -1040 /// conditions have changed. This [`Watcher`] will return the latest result -1041 /// of the `net-report`. -1042 /// -1043 /// When issuing the first call to this method the first report might -1044 /// still be underway, in this case the [`Watcher`] might not be initialized -1045 /// with [`Some`] value yet. Once the net-report has been successfully -1046 /// run, the [`Watcher`] will always return [`Some`] report immediately, which -1047 /// is the most recently run `net-report`. -1048 /// -1049 /// # Examples -1050 /// -1051 /// To get the first report use [`Watcher::initialized`]: -1052 /// ```no_run -1053 /// use iroh::{Endpoint, Watcher as _}; -1054 /// -1055 /// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap(); -1056 /// # rt.block_on(async move { -1057 /// let ep = Endpoint::builder().bind().await.unwrap(); -1058 /// let _report = ep.net_report().initialized().await; -1059 /// # }); -1060 /// ``` -1061 #[doc(hidden)] -1062 pub fn net_report(&self) -> impl Watcher<Value = Option<Report>> + use<> { -1063 self.msock.net_report() -1064 } -1065 -1066 /// Returns the local socket addresses on which the underlying sockets are bound. -1067 /// -1068 /// The [`Endpoint`] always binds on an IPv4 address and also tries to bind on an IPv6 -1069 /// address if available. -1070 pub fn bound_sockets(&self) -> Vec<SocketAddr> { -1071 self.msock -1072 .local_addr() -1073 .into_iter() -1074 .filter_map(|addr| addr.into_socket_addr()) -1075 .collect() -1076 } -1077 -1078 // # Getter methods for information about other nodes. -1079 -1080 /// Returns information about the remote node identified by a [`NodeId`]. -1081 /// -1082 /// The [`Endpoint`] keeps some information about remote iroh nodes, which it uses to find -1083 /// the best path to a node. Having information on a remote node, however, does not mean we have -1084 /// ever connected to it to or even whether a connection is even possible. The information about a -1085 /// remote node will change over time, as the [`Endpoint`] learns more about the node. Future -1086 /// calls may return different information. Furthermore, node information may even be -1087 /// completely evicted as it becomes stale. -1088 /// -1089 /// See also [`Endpoint::remote_info_iter`] which returns information on all nodes known -1090 /// by this [`Endpoint`]. -1091 pub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo> { -1092 self.msock.remote_info(node_id) -1093 } -1094 -1095 /// Returns information about all the remote nodes this [`Endpoint`] knows about. -1096 /// -1097 /// This returns the same information as [`Endpoint::remote_info`] for each node known to this -1098 /// [`Endpoint`]. -1099 /// -1100 /// The [`Endpoint`] keeps some information about remote iroh nodes, which it uses to find -1101 /// the best path to a node. This returns all the nodes it knows about, regardless of whether a -1102 /// connection was ever made or is even possible. -1103 /// -1104 /// See also [`Endpoint::remote_info`] to only retrieve information about a single node. -1105 pub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo> + use<> { -1106 self.msock.list_remote_infos().into_iter() -1107 } -1108 -1109 /// Returns a stream of all remote nodes discovered through the endpoint's discovery services. -1110 /// -1111 /// Whenever a node is discovered via the endpoint's discovery service, the corresponding -1112 /// [`DiscoveryEvent`] is yielded from this stream. This includes nodes discovered actively -1113 /// through [`Discovery::resolve`], which is invoked automatically when calling -1114 /// [`Endpoint::connect`] for a [`NodeId`] unknown to the endpoint. It also includes -1115 /// nodes that the endpoint discovers passively from discovery services that implement -1116 /// [`Discovery::subscribe`], which e.g. [`MdnsDiscovery`] does. -1117 /// -1118 /// The stream does not yield information about nodes that are added manually to the endpoint's -1119 /// addressbook by calling [`Endpoint::add_node_addr`] or by supplying a full [`NodeAddr`] to -1120 /// [`Endpoint::connect`]. It also does not yield information about nodes that we only -1121 /// know about because they connected to us. When using the [`StaticProvider`] discovery, -1122 /// discovery info is only emitted once connecting to a node added to the static provider, not -1123 /// at the time of adding it to the static provider. -1124 /// -1125 /// The stream should be processed in a loop. If the stream is not processed fast enough, -1126 /// [`Lagged`] may be yielded, indicating that items were missed. -1127 /// -1128 /// See also [`Endpoint::remote_info_iter`], which returns an iterator over all remotes -1129 /// the endpoint knows about at a specific point in time. -1130 /// -1131 /// [`MdnsDiscovery`]: crate::discovery::mdns::MdnsDiscovery -1132 /// [`StaticProvider`]: crate::discovery::static_provider::StaticProvider -1133 pub fn discovery_stream(&self) -> impl Stream<Item = Result<DiscoveryEvent, Lagged>> + use<> { -1134 self.msock.discovery_subscribers().subscribe() -1135 } -1136 -1137 // # Methods for less common getters. -1138 // -1139 // Partially they return things passed into the builder. -1140 -1141 /// Returns a [`Watcher`] that reports the current connection type and any changes for -1142 /// given remote node. -1143 /// -1144 /// This watcher allows observing a stream of [`ConnectionType`] items by calling -1145 /// [`Watcher::stream()`]. If the underlying connection to a remote node changes, it will -1146 /// yield a new item. These connection changes are when the connection switches between -1147 /// using the Relay server and a direct connection. -1148 /// -1149 /// Note that this does not guarantee each connection change is yielded in the stream. -1150 /// If the connection type changes several times before this stream is polled, only the -1151 /// last recorded state is returned. This can be observed e.g. right at the start of a -1152 /// connection when the switch from a relayed to a direct connection can be so fast that -1153 /// the relayed state is never exposed. -1154 /// -1155 /// If there is currently a connection with the remote node, then using [`Watcher::get`] -1156 /// will immediately return either [`ConnectionType::Relay`], [`ConnectionType::Direct`] -1157 /// or [`ConnectionType::Mixed`]. -1158 /// -1159 /// It is possible for the connection type to be [`ConnectionType::None`] if you've -1160 /// recently connected to this node id but previous methods of reaching the node have -1161 /// become inaccessible. -1162 /// -1163 /// Will return `None` if we do not have any address information for the given `node_id`. -1164 pub fn conn_type(&self, node_id: NodeId) -> Option<n0_watcher::Direct<ConnectionType>> { -1165 self.msock.conn_type(node_id) -1166 } -1167 -1168 /// Returns the DNS resolver used in this [`Endpoint`]. -1169 /// -1170 /// See [`Builder::dns_resolver`]. -1171 #[cfg(not(wasm_browser))] -1172 pub fn dns_resolver(&self) -> &DnsResolver { -1173 self.msock.dns_resolver() -1174 } -1175 -1176 /// Returns the discovery mechanism, if configured. -1177 /// -1178 /// See [`Builder::discovery`]. -1179 pub fn discovery(&self) -> Option<&dyn Discovery> { -1180 self.msock.discovery() -1181 } -1182 -1183 /// Returns metrics collected for this endpoint. -1184 /// -1185 /// The endpoint internally collects various metrics about its operation. -1186 /// The returned [`EndpointMetrics`] struct contains all of these metrics. -1187 /// -1188 /// You can access individual metrics directly by using the public fields: -1189 /// ```rust -1190 /// # use std::collections::BTreeMap; -1191 /// # use iroh::endpoint::Endpoint; -1192 /// # async fn wrapper() -> n0_snafu::Result { -1193 /// let endpoint = Endpoint::builder().bind().await?; -1194 /// assert_eq!(endpoint.metrics().magicsock.recv_datagrams.get(), 0); -1195 /// # Ok(()) -1196 /// # } -1197 /// ``` -1198 /// -1199 /// [`EndpointMetrics`] implements [`MetricsGroupSet`], and each field -1200 /// implements [`MetricsGroup`]. These traits provide methods to iterate over -1201 /// the groups in the set, and over the individual metrics in each group, without having -1202 /// to access each field manually. With these methods, it is straightforward to collect -1203 /// all metrics into a map or push their values to a metrics collector. -1204 /// -1205 /// For example, the following snippet collects all metrics into a map: -1206 /// ```rust -1207 /// # use std::collections::BTreeMap; -1208 /// # use iroh_metrics::{Metric, MetricsGroup, MetricValue, MetricsGroupSet}; -1209 /// # use iroh::endpoint::Endpoint; -1210 /// # async fn wrapper() -> n0_snafu::Result { -1211 /// let endpoint = Endpoint::builder().bind().await?; -1212 /// let metrics: BTreeMap<String, MetricValue> = endpoint -1213 /// .metrics() -1214 /// .iter() -1215 /// .map(|(group, metric)| { -1216 /// let name = [group, metric.name()].join(":"); -1217 /// (name, metric.value()) -1218 /// }) -1219 /// .collect(); -1220 /// -1221 /// assert_eq!(metrics["magicsock:recv_datagrams"], MetricValue::Counter(0)); -1222 /// # Ok(()) -1223 /// # } -1224 /// ``` -1225 /// -1226 /// The metrics can also be encoded into the OpenMetrics text format, as used by Prometheus. -1227 /// To do so, use the [`iroh_metrics::Registry`], add the endpoint metrics to the -1228 /// registry with [`Registry::register_all`], and encode the metrics to a string with -1229 /// [`encode_openmetrics_to_string`]: -1230 /// ```rust -1231 /// # use iroh_metrics::{Registry, MetricsSource}; -1232 /// # use iroh::endpoint::Endpoint; -1233 /// # async fn wrapper() -> n0_snafu::Result { -1234 /// let endpoint = Endpoint::builder().bind().await?; -1235 /// let mut registry = Registry::default(); -1236 /// registry.register_all(endpoint.metrics()); -1237 /// let s = registry.encode_openmetrics_to_string()?; -1238 /// assert!(s.contains(r#"TYPE magicsock_recv_datagrams counter"#)); -1239 /// assert!(s.contains(r#"magicsock_recv_datagrams_total 0"#)); -1240 /// # Ok(()) -1241 /// # } -1242 /// ``` -1243 /// -1244 /// Through a registry, you can also add labels or prefixes to metrics with -1245 /// [`Registry::sub_registry_with_label`] or [`Registry::sub_registry_with_prefix`]. -1246 /// Furthermore, [`iroh_metrics::service`] provides functions to easily start services -1247 /// to serve the metrics with a HTTP server, dump them to a file, or push them -1248 /// to a Prometheus gateway. -1249 /// -1250 /// For example, the following snippet launches an HTTP server that serves the metrics in the -1251 /// OpenMetrics text format: -1252 /// ```no_run -1253 /// # use std::{sync::{Arc, RwLock}, time::Duration}; -1254 /// # use iroh_metrics::{Registry, MetricsSource}; -1255 /// # use iroh::endpoint::Endpoint; -1256 /// # use n0_snafu::ResultExt; -1257 /// # async fn wrapper() -> n0_snafu::Result { -1258 /// // Create a registry, wrapped in a read-write lock so that we can register and serve -1259 /// // the metrics independently. -1260 /// let registry = Arc::new(RwLock::new(Registry::default())); -1261 /// // Spawn a task to serve the metrics on an OpenMetrics HTTP endpoint. -1262 /// let metrics_task = tokio::task::spawn({ -1263 /// let registry = registry.clone(); -1264 /// async move { -1265 /// let addr = "0.0.0.0:9100".parse().unwrap(); -1266 /// iroh_metrics::service::start_metrics_server(addr, registry).await -1267 /// } -1268 /// }); -1269 /// -1270 /// // Spawn an endpoint and add the metrics to the registry. -1271 /// let endpoint = Endpoint::builder().bind().await?; -1272 /// registry.write().unwrap().register_all(endpoint.metrics()); -1273 /// -1274 /// // Wait for the metrics server to bind, then fetch the metrics via HTTP. -1275 /// tokio::time::sleep(Duration::from_millis(500)); -1276 /// let res = reqwest::get("http://localhost:9100/metrics") -1277 /// .await -1278 /// .context("get")? -1279 /// .text() -1280 /// .await -1281 /// .context("text")?; -1282 /// -1283 /// assert!(res.contains(r#"TYPE magicsock_recv_datagrams counter"#)); -1284 /// assert!(res.contains(r#"magicsock_recv_datagrams_total 0"#)); -1285 /// # metrics_task.abort(); -1286 /// # Ok(()) -1287 /// # } -1288 /// ``` -1289 /// -1290 /// [`Registry`]: iroh_metrics::Registry -1291 /// [`Registry::register_all`]: iroh_metrics::Registry::register_all -1292 /// [`Registry::sub_registry_with_label`]: iroh_metrics::Registry::sub_registry_with_label -1293 /// [`Registry::sub_registry_with_prefix`]: iroh_metrics::Registry::sub_registry_with_prefix -1294 /// [`encode_openmetrics_to_string`]: iroh_metrics::MetricsSource::encode_openmetrics_to_string -1295 /// [`MetricsGroup`]: iroh_metrics::MetricsGroup -1296 /// [`MetricsGroupSet`]: iroh_metrics::MetricsGroupSet -1297 #[cfg(feature = "metrics")] -1298 pub fn metrics(&self) -> &EndpointMetrics { -1299 &self.msock.metrics -1300 } -1301 -1302 // # Methods for less common state updates. -1303 -1304 /// Notifies the system of potential network changes. -1305 /// -1306 /// On many systems iroh is able to detect network changes by itself, however -1307 /// some systems like android do not expose this functionality to native code. -1308 /// Android does however provide this functionality to Java code. This -1309 /// function allows for notifying iroh of any potential network changes like -1310 /// this. -1311 /// -1312 /// Even when the network did not change, or iroh was already able to detect -1313 /// the network change itself, there is no harm in calling this function. -1314 pub async fn network_change(&self) { -1315 self.msock.network_change().await; -1316 } -1317 -1318 // # Methods to update internal state. -1319 -1320 /// Sets the initial user-defined data to be published in discovery services for this node. -1321 /// -1322 /// If the user-defined data passed to this function is different to the previous one, -1323 /// the endpoint will republish its node info to the configured discovery services. -1324 /// -1325 /// See also [`Builder::user_data_for_discovery`] for setting an initial value when -1326 /// building the endpoint. -1327 pub fn set_user_data_for_discovery(&self, user_data: Option<UserData>) { -1328 self.msock.set_user_data_for_discovery(user_data); -1329 } -1330 -1331 // # Methods for terminating the endpoint. -1332 -1333 /// Closes the QUIC endpoint and the magic socket. -1334 /// -1335 /// This will close any remaining open [`Connection`]s with an error code -1336 /// of `0` and an empty reason. Though it is best practice to close those -1337 /// explicitly before with a custom error code and reason. -1338 /// -1339 /// It will then make a best effort to wait for all close notifications to be -1340 /// acknowledged by the peers, re-transmitting them if needed. This ensures the -1341 /// peers are aware of the closed connections instead of having to wait for a timeout -1342 /// on the connection. Once all connections are closed or timed out, the future -1343 /// finishes. -1344 /// -1345 /// The maximum time-out that this future will wait for depends on QUIC transport -1346 /// configurations of non-drained connections at the time of calling, and their current -1347 /// estimates of round trip time. With default parameters and a conservative estimate -1348 /// of round trip time, this call's future should take 3 seconds to resolve in cases of -1349 /// bad connectivity or failed connections. In the usual case, this call's future should -1350 /// return much more quickly. -1351 /// -1352 /// It is highly recommended you *do* wait for this close call to finish, if possible. -1353 /// Not doing so will make connections that were still open while closing the endpoint -1354 /// time out on the remote end. Thus remote ends will assume connections to have failed -1355 /// even if all application data was transmitted successfully. -1356 /// -1357 /// Note: Someone used to closing TCP sockets might wonder why it is necessary to wait -1358 /// for timeouts when closing QUIC endpoints, while they don't have to do this for TCP -1359 /// sockets. This is due to QUIC and its acknowledgments being implemented in user-land, -1360 /// while TCP sockets usually get closed and drained by the operating system in the -1361 /// kernel during the "Time-Wait" period of the TCP socket. -1362 /// -1363 /// Be aware however that the underlying UDP sockets are only closed once all clones of -1364 /// the the respective [`Endpoint`] are dropped. -1365 pub async fn close(&self) { -1366 if self.is_closed() { -1367 return; -1368 } -1369 -1370 tracing::debug!("Connections closed"); -1371 self.msock.close().await; -1372 } -1373 -1374 /// Check if this endpoint is still alive, or already closed. -1375 pub fn is_closed(&self) -> bool { -1376 self.msock.is_closed() -1377 } -1378 -1379 // # Remaining private methods -1380 -1381 /// Return the quic mapped address for this `node_id` and possibly start discovery -1382 /// services if discovery is enabled on this magic endpoint. -1383 /// -1384 /// This will launch discovery in all cases except if: -1385 /// 1) we do not have discovery enabled -1386 /// 2) we have discovery enabled, but already have at least one verified, unexpired -1387 /// addresses for this `node_id` -1388 /// -1389 /// # Errors -1390 /// -1391 /// This method may fail if we have no way of dialing the node. This can occur if -1392 /// we were given no dialing information in the [`NodeAddr`] and no discovery -1393 /// services were configured or if discovery failed to fetch any dialing information. -1394 async fn get_mapping_addr_and_maybe_start_discovery( -1395 &self, -1396 node_addr: NodeAddr, -1397 ) -> Result<(NodeIdMappedAddr, Option<DiscoveryTask>), GetMappingAddressError> { -1398 let node_id = node_addr.node_id; -1399 -1400 // Only return a mapped addr if we have some way of dialing this node, in other -1401 // words, we have either a relay URL or at least one direct address. -1402 let addr = if self.msock.has_send_address(node_id) { -1403 self.msock.get_mapping_addr(node_id) -1404 } else { -1405 None -1406 }; -1407 match addr { -1408 Some(addr) => { -1409 // We have some way of dialing this node, but that doesn't actually mean -1410 // we can actually connect to any of these addresses. -1411 // Therefore, we will invoke the discovery service if we haven't received from the -1412 // endpoint on any of the existing paths recently. -1413 // If the user provided addresses in this connect call, we will add a delay -1414 // followed by a recheck before starting the discovery, to give the magicsocket a -1415 // chance to test the newly provided addresses. -1416 let delay = (!node_addr.is_empty()).then_some(DISCOVERY_WAIT_PERIOD); -1417 let discovery = DiscoveryTask::maybe_start_after_delay(self, node_id, delay) -1418 .ok() -1419 .flatten(); -1420 Ok((addr, discovery)) -1421 } -1422 -1423 None => { -1424 // We have no known addresses or relay URLs for this node. -1425 // So, we start a discovery task and wait for the first result to arrive, and -1426 // only then continue, because otherwise we wouldn't have any -1427 // path to the remote endpoint. -1428 let res = DiscoveryTask::start(self.clone(), node_id); -1429 let mut discovery = res.context(get_mapping_address_error::DiscoveryStartSnafu)?; -1430 discovery -1431 .first_arrived() -1432 .await -1433 .context(get_mapping_address_error::DiscoverSnafu)?; -1434 if let Some(addr) = self.msock.get_mapping_addr(node_id) { -1435 Ok((addr, Some(discovery))) -1436 } else { -1437 Err(get_mapping_address_error::NoAddressSnafu.build()) -1438 } -1439 } -1440 } -1441 } -1442 -1443 /// Returns a reference to the subscribers channel for discovery events. -1444 pub(crate) fn discovery_subscribers(&self) -> &DiscoverySubscribers { -1445 self.msock.discovery_subscribers() -1446 } -1447 -1448 #[cfg(test)] -1449 pub(crate) fn magic_sock(&self) -> Handle { -1450 self.msock.clone() -1451 } -1452 #[cfg(test)] -1453 pub(crate) fn endpoint(&self) -> &quinn::Endpoint { -1454 self.msock.endpoint() -1455 } -1456} -1457 -1458/// Options for the [`Endpoint::connect_with_opts`] function. -1459#[derive(Default, Debug, Clone)] -1460pub struct ConnectOptions { -1461 transport_config: Option<Arc<TransportConfig>>, -1462 additional_alpns: Vec<Vec<u8>>, -1463} -1464 -1465impl ConnectOptions { -1466 /// Initializes new connection options. -1467 /// -1468 /// By default, the connection will use the same options -1469 /// as [`Endpoint::connect`], e.g. a default [`TransportConfig`]. -1470 pub fn new() -> Self { -1471 Self::default() -1472 } -1473 -1474 /// Sets the QUIC transport config options for this connection. -1475 pub fn with_transport_config(mut self, transport_config: Arc<TransportConfig>) -> Self { -1476 self.transport_config = Some(transport_config); -1477 self -1478 } -1479 -1480 /// Sets [ALPN] identifiers that should be signaled as supported on connection, *in -1481 /// addition* to the main [ALPN] identifier used in [`Endpoint::connect_with_opts`]. -1482 /// -1483 /// This allows connecting to servers that may only support older versions of your -1484 /// protocol. In this case, you would add the older [ALPN] identifiers with this -1485 /// function. -1486 /// -1487 /// You'll know the final negotiated [ALPN] identifier once your connection was -1488 /// established using [`Connection::alpn`], or even slightly earlier in the -1489 /// handshake by using [`Connecting::alpn`]. -1490 /// The negotiated [ALPN] identifier may be any of the [ALPN] identifiers in this -1491 /// list or the main [ALPN] used in [`Endpoint::connect_with_opts`]. -1492 /// -1493 /// The [ALPN] identifier order on the connect side doesn't matter, since it's the -1494 /// accept side that determines the protocol. -1495 /// -1496 /// For setting the supported [ALPN] identifiers on the accept side, see the endpoint -1497 /// builder's [`Builder::alpns`] function. -1498 /// -1499 /// [ALPN]: https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation -1500 pub fn with_additional_alpns(mut self, alpns: Vec<Vec<u8>>) -> Self { -1501 self.additional_alpns = alpns; -1502 self -1503 } -1504} -1505 -1506/// Future produced by [`Endpoint::accept`]. -1507#[derive(derive_more::Debug)] -1508#[pin_project] -1509pub struct Accept<'a> { -1510 #[pin] -1511 #[debug("quinn::Accept")] -1512 inner: quinn::Accept<'a>, -1513 ep: Endpoint, -1514} -1515 -1516impl Future for Accept<'_> { -1517 type Output = Option<Incoming>; -1518 -1519 fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { -1520 let this = self.project(); -1521 match this.inner.poll(cx) { -1522 Poll::Pending => Poll::Pending, -1523 Poll::Ready(None) => Poll::Ready(None), -1524 Poll::Ready(Some(inner)) => Poll::Ready(Some(Incoming { -1525 inner, -1526 ep: this.ep.clone(), -1527 })), -1528 } -1529 } -1530} -1531 -1532/// An incoming connection for which the server has not yet begun its parts of the -1533/// handshake. -1534#[derive(Debug)] -1535pub struct Incoming { -1536 inner: quinn::Incoming, -1537 ep: Endpoint, -1538} -1539 -1540impl Incoming { -1541 /// Attempts to accept this incoming connection (an error may still occur). -1542 /// -1543 /// Errors occurring here are likely not caused by the application or remote. The QUIC -1544 /// connection listens on a normal UDP socket and any reachable network endpoint can -1545 /// send datagrams to it, solicited or not. Even if the first few bytes look like a -1546 /// QUIC packet, it might not even be a QUIC packet that is being received. -1547 /// -1548 /// Thus it is common to simply log the errors here and accept them as something which -1549 /// can happen. -1550 pub fn accept(self) -> Result<Connecting, ConnectionError> { -1551 self.inner.accept().map(|conn| Connecting { -1552 inner: conn, -1553 ep: self.ep, -1554 remote_node_id: None, -1555 _discovery_drop_guard: None, -1556 }) -1557 } -1558 -1559 /// Accepts this incoming connection using a custom configuration. -1560 /// -1561 /// See [`accept()`] for more details. -1562 /// -1563 /// [`accept()`]: Incoming::accept -1564 pub fn accept_with( -1565 self, -1566 server_config: Arc<ServerConfig>, -1567 ) -> Result<Connecting, ConnectionError> { -1568 self.inner -1569 .accept_with(server_config) -1570 .map(|conn| Connecting { -1571 inner: conn, -1572 ep: self.ep, -1573 remote_node_id: None, -1574 _discovery_drop_guard: None, -1575 }) -1576 } -1577 -1578 /// Rejects this incoming connection attempt. -1579 pub fn refuse(self) { -1580 self.inner.refuse() -1581 } -1582 -1583 /// Responds with a retry packet. -1584 /// -1585 /// This requires the client to retry with address validation. -1586 /// -1587 /// Errors if `remote_address_validated()` is true. -1588 #[allow(clippy::result_large_err)] -1589 pub fn retry(self) -> Result<(), RetryError> { -1590 self.inner.retry() -1591 } -1592 -1593 /// Ignores this incoming connection attempt, not sending any packet in response. -1594 pub fn ignore(self) { -1595 self.inner.ignore() -1596 } -1597 -1598 /// Returns the local IP address which was used when the peer established the -1599 /// connection. -1600 pub fn local_ip(&self) -> Option<IpAddr> { -1601 self.inner.local_ip() -1602 } -1603 -1604 /// Returns the peer's UDP address. -1605 pub fn remote_address(&self) -> SocketAddr { -1606 self.inner.remote_address() -1607 } -1608 -1609 /// Whether the socket address that is initiating this connection has been validated. -1610 /// -1611 /// This means that the sender of the initial packet has proved that they can receive -1612 /// traffic sent to `self.remote_address()`. -1613 pub fn remote_address_validated(&self) -> bool { -1614 self.inner.remote_address_validated() -1615 } -1616} -1617 -1618impl IntoFuture for Incoming { -1619 type Output = Result<Connection, ConnectionError>; -1620 type IntoFuture = IncomingFuture; -1621 -1622 fn into_future(self) -> Self::IntoFuture { -1623 IncomingFuture { -1624 inner: self.inner.into_future(), -1625 ep: self.ep, -1626 } -1627 } -1628} -1629 -1630/// Adaptor to let [`Incoming`] be `await`ed like a [`Connecting`]. -1631#[derive(Debug)] -1632#[pin_project] -1633pub struct IncomingFuture { -1634 #[pin] -1635 inner: quinn::IncomingFuture, -1636 ep: Endpoint, -1637} -1638 -1639impl Future for IncomingFuture { -1640 type Output = Result<Connection, ConnectionError>; -1641 -1642 fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { -1643 let this = self.project(); -1644 match this.inner.poll(cx) { -1645 Poll::Pending => Poll::Pending, -1646 Poll::Ready(Err(err)) => Poll::Ready(Err(err)), -1647 Poll::Ready(Ok(inner)) => { -1648 let conn = Connection { inner }; -1649 try_send_rtt_msg(&conn, this.ep, None); -1650 Poll::Ready(Ok(conn)) -1651 } -1652 } -1653 } -1654} -1655 -1656/// In-progress connection attempt future -1657#[derive(derive_more::Debug)] -1658#[pin_project] -1659pub struct Connecting { -1660 #[pin] -1661 inner: quinn::Connecting, -1662 ep: Endpoint, -1663 remote_node_id: Option<NodeId>, -1664 /// We run discovery as long as we haven't established a connection yet. -1665 #[debug("Option<DiscoveryTask>")] -1666 _discovery_drop_guard: Option<DiscoveryTask>, -1667} -1668 -1669#[allow(missing_docs)] -1670#[common_fields({ -1671 backtrace: Option<snafu::Backtrace>, -1672 #[snafu(implicit)] -1673 span_trace: n0_snafu::SpanTrace, -1674})] -1675#[derive(Debug, Snafu)] -1676#[non_exhaustive] -1677pub enum AlpnError { -1678 #[snafu(transparent)] -1679 ConnectionError { source: ConnectionError }, -1680 #[snafu(display("No ALPN available"))] -1681 Unavailable {}, -1682 #[snafu(display("Unknown handshake type"))] -1683 UnknownHandshake {}, -1684} -1685 -1686impl Connecting { -1687 /// Converts this [`Connecting`] into a 0-RTT or 0.5-RTT connection at the cost of weakened -1688 /// security. -1689 /// -1690 /// Returns `Ok` immediately if the local endpoint is able to attempt sending 0/0.5-RTT data. -1691 /// If so, the returned [`Connection`] can be used to send application data without waiting for -1692 /// the rest of the handshake to complete, at the cost of weakened cryptographic security -1693 /// guarantees. The returned [`ZeroRttAccepted`] future resolves when the handshake does -1694 /// complete, at which point subsequently opened streams and written data will have full -1695 /// cryptographic protection. -1696 /// -1697 /// Once the [`ZeroRttAccepted`] future completed, a full handshake has been carried through -1698 /// and any data sent and any streams opened on the [`Connection`] will operate with the same -1699 /// security as on normal 1-RTT connections. -1700 /// -1701 /// ## Outgoing -1702 /// -1703 /// For outgoing connections, the initial attempt to convert to a [`Connection`] which sends -1704 /// 0-RTT data will attempt to resume a previous TLS session. However, **the remote endpoint -1705 /// may not actually _accept_ the 0-RTT data**--yet still accept the connection attempt in -1706 /// general. This possibility is conveyed through the [`ZeroRttAccepted`] future--when the -1707 /// handshake completes, it resolves to true if the 0-RTT data was accepted and false if it was -1708 /// rejected. If it was rejected, the existence of streams opened and other application data -1709 /// sent prior to the handshake completing will not be conveyed to the remote application, and -1710 /// local operations on them will return `ZeroRttRejected` errors. -1711 /// -1712 /// A server may reject 0-RTT data at its discretion, but accepting 0-RTT data requires the -1713 /// relevant resumption state to be stored in the server, which servers may limit or lose for -1714 /// various reasons including not persisting resumption state across server restarts. -1715 /// -1716 /// ## Incoming -1717 /// -1718 /// For incoming connections, conversion to 0.5-RTT will always fully succeed. `into_0rtt` will -1719 /// always return `Ok` and the [`ZeroRttAccepted`] will always resolve to true. -1720 /// -1721 /// ## Security -1722 /// -1723 /// On outgoing connections, this enables transmission of 0-RTT data, which is vulnerable to -1724 /// replay attacks, and should therefore never invoke non-idempotent operations. -1725 /// -1726 /// On incoming connections, this enables transmission of 0.5-RTT data, which may be sent -1727 /// before TLS client authentication has occurred, and should therefore not be used to send -1728 /// data for which client authentication is being used. -1729 /// -1730 /// You can use [`RecvStream::is_0rtt`] to check whether a stream has been opened in 0-RTT -1731 /// and thus whether parts of the stream are operating under this reduced security level. -1732 #[allow(clippy::result_large_err)] -1733 pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self> { -1734 match self.inner.into_0rtt() { -1735 Ok((inner, zrtt_accepted)) => { -1736 let conn = Connection { inner }; -1737 let zrtt_accepted = ZeroRttAccepted { -1738 inner: zrtt_accepted, -1739 _discovery_drop_guard: self._discovery_drop_guard, -1740 }; -1741 // This call is why `self.remote_node_id` was introduced. -1742 // When we `Connecting::into_0rtt`, then we don't yet have `handshake_data` -1743 // in our `Connection`, thus `try_send_rtt_msg` won't be able to pick up -1744 // `Connection::remote_node_id`. -1745 // Instead, we provide `self.remote_node_id` here - we know it in advance, -1746 // after all. -1747 try_send_rtt_msg(&conn, &self.ep, self.remote_node_id); -1748 Ok((conn, zrtt_accepted)) -1749 } -1750 Err(inner) => Err(Self { -1751 inner, -1752 ep: self.ep, -1753 remote_node_id: self.remote_node_id, -1754 _discovery_drop_guard: self._discovery_drop_guard, -1755 }), -1756 } -1757 } -1758 -1759 /// Parameters negotiated during the handshake -1760 pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError> { -1761 self.inner.handshake_data().await -1762 } -1763 -1764 /// Extracts the ALPN protocol from the peer's handshake data. -1765 pub async fn alpn(&mut self) -> Result<Vec<u8>, AlpnError> { -1766 let data = self.handshake_data().await?; -1767 match data.downcast::<quinn::crypto::rustls::HandshakeData>() { -1768 Ok(data) => match data.protocol { -1769 Some(protocol) => Ok(protocol), -1770 None => Err(UnavailableSnafu.build()), -1771 }, -1772 Err(_) => Err(UnknownHandshakeSnafu.build()), -1773 } -1774 } -1775} -1776 -1777impl Future for Connecting { -1778 type Output = Result<Connection, ConnectionError>; -1779 -1780 fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { -1781 let this = self.project(); -1782 match this.inner.poll(cx) { -1783 Poll::Pending => Poll::Pending, -1784 Poll::Ready(Err(err)) => Poll::Ready(Err(err)), -1785 Poll::Ready(Ok(inner)) => { -1786 let conn = Connection { inner }; -1787 try_send_rtt_msg(&conn, this.ep, *this.remote_node_id); -1788 Poll::Ready(Ok(conn)) -1789 } -1790 } -1791 } -1792} -1793 -1794/// Future that completes when a connection is fully established. -1795/// -1796/// For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting -1797/// value is meaningless. -1798#[derive(derive_more::Debug)] -1799#[debug("ZeroRttAccepted")] -1800pub struct ZeroRttAccepted { -1801 inner: quinn::ZeroRttAccepted, -1802 /// When we call `Connecting::into_0rtt`, we don't want to stop discovery, so we transfer the task -1803 /// to this future. -1804 /// When `quinn::ZeroRttAccepted` resolves, we've successfully received data from the remote. -1805 /// Thus, that's the right time to drop discovery to preserve the behaviour similar to -1806 /// `Connecting` -> `Connection` without 0-RTT. -1807 /// Should we eventually decide to keep the discovery task alive for the duration of the whole -1808 /// `Connection`, then this task should be transferred to the `Connection` instead of here. -1809 _discovery_drop_guard: Option<DiscoveryTask>, -1810} -1811 -1812impl Future for ZeroRttAccepted { -1813 type Output = bool; -1814 fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { -1815 Pin::new(&mut self.inner).poll(cx) -1816 } -1817} -1818 -1819/// A QUIC connection. -1820/// -1821/// If all references to a connection (including every clone of the Connection handle, -1822/// streams of incoming streams, and the various stream types) have been dropped, then the -1823/// connection will be automatically closed with an error_code of 0 and an empty reason. You -1824/// can also close the connection explicitly by calling [`Connection::close`]. -1825/// -1826/// Closing the connection immediately abandons efforts to deliver data to the peer. Upon -1827/// receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered to the -1828/// application. [`Connection::close`] describes in more detail how to gracefully close a -1829/// connection without losing application data. -1830/// -1831/// May be cloned to obtain another handle to the same connection. -1832#[derive(Debug, Clone)] -1833pub struct Connection { -1834 inner: quinn::Connection, -1835} -1836 -1837#[allow(missing_docs)] -1838#[derive(Debug, Snafu)] -1839#[snafu(display("Protocol error: no remote id available"))] -1840pub struct RemoteNodeIdError { -1841 backtrace: Option<snafu::Backtrace>, -1842} -1843 -1844impl Connection { -1845 /// Initiates a new outgoing unidirectional stream. -1846 /// -1847 /// Streams are cheap and instantaneous to open unless blocked by flow control. As a -1848 /// consequence, the peer won’t be notified that a stream has been opened until the -1849 /// stream is actually used. -1850 #[inline] -1851 pub fn open_uni(&self) -> OpenUni<'_> { -1852 self.inner.open_uni() -1853 } -1854 -1855 /// Initiates a new outgoing bidirectional stream. -1856 /// -1857 /// Streams are cheap and instantaneous to open unless blocked by flow control. As a -1858 /// consequence, the peer won't be notified that a stream has been opened until the -1859 /// stream is actually used. Calling [`open_bi`] then waiting on the [`RecvStream`] -1860 /// without writing anything to [`SendStream`] will never succeed. -1861 /// -1862 /// [`open_bi`]: Connection::open_bi -1863 #[inline] -1864 pub fn open_bi(&self) -> OpenBi<'_> { -1865 self.inner.open_bi() -1866 } -1867 -1868 /// Accepts the next incoming uni-directional stream. -1869 #[inline] -1870 pub fn accept_uni(&self) -> AcceptUni<'_> { -1871 self.inner.accept_uni() -1872 } -1873 -1874 /// Accept the next incoming bidirectional stream. -1875 /// -1876 /// **Important Note**: The peer that calls [`open_bi`] must write to its [`SendStream`] -1877 /// before the peer `Connection` is able to accept the stream using -1878 /// `accept_bi()`. Calling [`open_bi`] then waiting on the [`RecvStream`] without -1879 /// writing anything to the connected [`SendStream`] will never succeed. -1880 /// -1881 /// [`open_bi`]: Connection::open_bi -1882 #[inline] -1883 pub fn accept_bi(&self) -> AcceptBi<'_> { -1884 self.inner.accept_bi() -1885 } -1886 -1887 /// Receives an application datagram. -1888 #[inline] -1889 pub fn read_datagram(&self) -> ReadDatagram<'_> { -1890 self.inner.read_datagram() -1891 } -1892 -1893 /// Wait for the connection to be closed for any reason. -1894 /// -1895 /// Despite the return type's name, closed connections are often not an error condition -1896 /// at the application layer. Cases that might be routine include -1897 /// [`ConnectionError::LocallyClosed`] and [`ConnectionError::ApplicationClosed`]. -1898 #[inline] -1899 pub async fn closed(&self) -> ConnectionError { -1900 self.inner.closed().await -1901 } -1902 -1903 /// If the connection is closed, the reason why. -1904 /// -1905 /// Returns `None` if the connection is still open. -1906 #[inline] -1907 pub fn close_reason(&self) -> Option<ConnectionError> { -1908 self.inner.close_reason() -1909 } -1910 -1911 /// Closes the connection immediately. -1912 /// -1913 /// Pending operations will fail immediately with [`ConnectionError::LocallyClosed`]. No -1914 /// more data is sent to the peer and the peer may drop buffered data upon receiving the -1915 /// CONNECTION_CLOSE frame. -1916 /// -1917 /// `error_code` and `reason` are not interpreted, and are provided directly to the -1918 /// peer. -1919 /// -1920 /// `reason` will be truncated to fit in a single packet with overhead; to improve odds -1921 /// that it is preserved in full, it should be kept under 1KiB. -1922 /// -1923 /// # Gracefully closing a connection -1924 /// -1925 /// Only the peer last receiving application data can be certain that all data is -1926 /// delivered. The only reliable action it can then take is to close the connection, -1927 /// potentially with a custom error code. The delivery of the final CONNECTION_CLOSE -1928 /// frame is very likely if both endpoints stay online long enough, calling -1929 /// [`Endpoint::close`] will wait to provide sufficient time. Otherwise, the remote peer -1930 /// will time out the connection, provided that the idle timeout is not disabled. -1931 /// -1932 /// The sending side can not guarantee all stream data is delivered to the remote -1933 /// application. It only knows the data is delivered to the QUIC stack of the remote -1934 /// endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to calling -1935 /// [`close`] the remote endpoint may drop any data it received but is as yet -1936 /// undelivered to the application, including data that was acknowledged as received to -1937 /// the local endpoint. -1938 /// -1939 /// [`close`]: Connection::close -1940 #[inline] -1941 pub fn close(&self, error_code: VarInt, reason: &[u8]) { -1942 self.inner.close(error_code, reason) -1943 } -1944 -1945 /// Transmits `data` as an unreliable, unordered application datagram. -1946 /// -1947 /// Application datagrams are a low-level primitive. They may be lost or delivered out -1948 /// of order, and `data` must both fit inside a single QUIC packet and be smaller than -1949 /// the maximum dictated by the peer. -1950 #[inline] -1951 pub fn send_datagram(&self, data: bytes::Bytes) -> Result<(), SendDatagramError> { -1952 self.inner.send_datagram(data) -1953 } -1954 -1955 // TODO: It seems `SendDatagram` is not yet exposed by quinn. This has been fixed -1956 // upstream and will be in the next release. -1957 // /// Transmits `data` as an unreliable, unordered application datagram -1958 // /// -1959 // /// Unlike [`send_datagram()`], this method will wait for buffer space during congestion -1960 // /// conditions, which effectively prioritizes old datagrams over new datagrams. -1961 // /// -1962 // /// See [`send_datagram()`] for details. -1963 // /// -1964 // /// [`send_datagram()`]: Connection::send_datagram -1965 // #[inline] -1966 // pub fn send_datagram_wait(&self, data: bytes::Bytes) -> SendDatagram<'_> { -1967 // self.inner.send_datagram_wait(data) -1968 // } -1969 -1970 /// Computes the maximum size of datagrams that may be passed to [`send_datagram`]. -1971 /// -1972 /// Returns `None` if datagrams are unsupported by the peer or disabled locally. -1973 /// -1974 /// This may change over the lifetime of a connection according to variation in the path -1975 /// MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the -1976 /// peer's limit is large this is guaranteed to be a little over a kilobyte at minimum. -1977 /// -1978 /// Not necessarily the maximum size of received datagrams. -1979 /// -1980 /// [`send_datagram`]: Self::send_datagram -1981 #[inline] -1982 pub fn max_datagram_size(&self) -> Option<usize> { -1983 self.inner.max_datagram_size() -1984 } -1985 -1986 /// Bytes available in the outgoing datagram buffer. -1987 /// -1988 /// When greater than zero, calling [`send_datagram`] with a -1989 /// datagram of at most this size is guaranteed not to cause older datagrams to be -1990 /// dropped. -1991 /// -1992 /// [`send_datagram`]: Self::send_datagram -1993 #[inline] -1994 pub fn datagram_send_buffer_space(&self) -> usize { -1995 self.inner.datagram_send_buffer_space() -1996 } -1997 -1998 /// Current best estimate of this connection's latency (round-trip-time). -1999 #[inline] -2000 pub fn rtt(&self) -> Duration { -2001 self.inner.rtt() -2002 } -2003 -2004 /// Returns connection statistics. -2005 #[inline] -2006 pub fn stats(&self) -> ConnectionStats { -2007 self.inner.stats() -2008 } -2009 -2010 /// Current state of the congestion control algorithm, for debugging purposes. -2011 #[inline] -2012 pub fn congestion_state(&self) -> Box<dyn quinn_proto::congestion::Controller> { -2013 self.inner.congestion_state() -2014 } -2015 -2016 /// Parameters negotiated during the handshake. -2017 /// -2018 /// Guaranteed to return `Some` on fully established connections or after -2019 /// [`Connecting::handshake_data()`] succeeds. See that method's documentations for -2020 /// details on the returned value. -2021 /// -2022 /// [`Connection::handshake_data()`]: crate::endpoint::Connecting::handshake_data -2023 #[inline] -2024 pub fn handshake_data(&self) -> Option<Box<dyn Any>> { -2025 self.inner.handshake_data() -2026 } -2027 -2028 /// Extracts the ALPN protocol from the peer's handshake data. -2029 pub fn alpn(&self) -> Option<Vec<u8>> { -2030 let data = self.handshake_data()?; -2031 match data.downcast::<quinn::crypto::rustls::HandshakeData>() { -2032 Ok(data) => data.protocol, -2033 Err(_) => None, -2034 } -2035 } -2036 -2037 /// Cryptographic identity of the peer. -2038 /// -2039 /// The dynamic type returned is determined by the configured [`Session`]. For the -2040 /// default `rustls` session, the return value can be [`downcast`] to a -2041 /// <code>Vec<[rustls::pki_types::CertificateDer]></code> -2042 /// -2043 /// [`Session`]: quinn_proto::crypto::Session -2044 /// [`downcast`]: Box::downcast -2045 #[inline] -2046 pub fn peer_identity(&self) -> Option<Box<dyn Any>> { -2047 self.inner.peer_identity() -2048 } -2049 -2050 /// Returns the [`NodeId`] from the peer's TLS certificate. -2051 /// -2052 /// The [`PublicKey`] of a node is also known as a [`NodeId`]. This [`PublicKey`] is -2053 /// included in the TLS certificate presented during the handshake when connecting. -2054 /// This function allows you to get the [`NodeId`] of the remote node of this -2055 /// connection. -2056 /// -2057 /// [`PublicKey`]: iroh_base::PublicKey -2058 // TODO: Would be nice if this could be infallible. -2059 pub fn remote_node_id(&self) -> Result<NodeId, RemoteNodeIdError> { -2060 let data = self.peer_identity(); -2061 match data { -2062 None => { -2063 warn!("no peer certificate found"); -2064 Err(RemoteNodeIdSnafu.build()) -2065 } -2066 Some(data) => match data.downcast::<Vec<rustls::pki_types::CertificateDer>>() { -2067 Ok(certs) => { -2068 if certs.len() != 1 { -2069 warn!( -2070 "expected a single peer certificate, but {} found", -2071 certs.len() -2072 ); -2073 return Err(RemoteNodeIdSnafu.build()); -2074 } -2075 -2076 let peer_id = VerifyingKey::from_public_key_der(&certs[0]) -2077 .map_err(|_| RemoteNodeIdSnafu.build())? -2078 .into(); -2079 Ok(peer_id) -2080 } -2081 Err(err) => { -2082 warn!("invalid peer certificate: {:?}", err); -2083 Err(RemoteNodeIdSnafu.build()) -2084 } -2085 }, -2086 } -2087 } -2088 -2089 /// A stable identifier for this connection. -2090 /// -2091 /// Peer addresses and connection IDs can change, but this value will remain fixed for -2092 /// the lifetime of the connection. -2093 #[inline] -2094 pub fn stable_id(&self) -> usize { -2095 self.inner.stable_id() -2096 } -2097 -2098 /// Derives keying material from this connection's TLS session secrets. -2099 /// -2100 /// When both peers call this method with the same `label` and `context` -2101 /// arguments and `output` buffers of equal length, they will get the -2102 /// same sequence of bytes in `output`. These bytes are cryptographically -2103 /// strong and pseudorandom, and are suitable for use as keying material. -2104 /// -2105 /// See [RFC5705](https://tools.ietf.org/html/rfc5705) for more information. -2106 #[inline] -2107 pub fn export_keying_material( -2108 &self, -2109 output: &mut [u8], -2110 label: &[u8], -2111 context: &[u8], -2112 ) -> Result<(), quinn_proto::crypto::ExportKeyingMaterialError> { -2113 self.inner.export_keying_material(output, label, context) -2114 } -2115 -2116 /// Modifies the number of unidirectional streams that may be concurrently opened. -2117 /// -2118 /// No streams may be opened by the peer unless fewer than `count` are already -2119 /// open. Large `count`s increase both minimum and worst-case memory consumption. -2120 #[inline] -2121 pub fn set_max_concurrent_uni_streams(&self, count: VarInt) { -2122 self.inner.set_max_concurrent_uni_streams(count) -2123 } -2124 -2125 /// See [`quinn_proto::TransportConfig::receive_window`]. -2126 #[inline] -2127 pub fn set_receive_window(&self, receive_window: VarInt) { -2128 self.inner.set_receive_window(receive_window) -2129 } -2130 -2131 /// Modifies the number of bidirectional streams that may be concurrently opened. -2132 /// -2133 /// No streams may be opened by the peer unless fewer than `count` are already -2134 /// open. Large `count`s increase both minimum and worst-case memory consumption. -2135 #[inline] -2136 pub fn set_max_concurrent_bi_streams(&self, count: VarInt) { -2137 self.inner.set_max_concurrent_bi_streams(count) -2138 } -2139} -2140 -2141/// Try send a message to the rtt-actor. -2142/// -2143/// If we can't notify the actor that will impact performance a little, but we can still -2144/// function. -2145fn try_send_rtt_msg(conn: &Connection, magic_ep: &Endpoint, remote_node_id: Option<NodeId>) { -2146 // If we can't notify the rtt-actor that's not great but not critical. -2147 let Some(node_id) = remote_node_id.or_else(|| conn.remote_node_id().ok()) else { -2148 warn!(?conn, "failed to get remote node id"); -2149 return; -2150 }; -2151 let Some(conn_type_changes) = magic_ep.conn_type(node_id) else { -2152 warn!(?conn, "failed to create conn_type stream"); -2153 return; -2154 }; -2155 let rtt_msg = RttMessage::NewConnection { -2156 connection: conn.inner.weak_handle(), -2157 conn_type_changes: conn_type_changes.stream(), -2158 node_id, -2159 }; -2160 if let Err(err) = magic_ep.rtt_actor.msg_tx.try_send(rtt_msg) { -2161 warn!(?conn, "rtt-actor not reachable: {err:#}"); -2162 } -2163} -2164 -2165/// Read a proxy url from the environment, in this order -2166/// -2167/// - `HTTP_PROXY` -2168/// - `http_proxy` -2169/// - `HTTPS_PROXY` -2170/// - `https_proxy` -2171fn proxy_url_from_env() -> Option<Url> { -2172 if let Some(url) = std::env::var("HTTP_PROXY") -2173 .ok() -2174 .and_then(|s| s.parse::<Url>().ok()) -2175 { -2176 if is_cgi() { -2177 warn!("HTTP_PROXY environment variable ignored in CGI"); -2178 } else { -2179 return Some(url); -2180 } -2181 } -2182 if let Some(url) = std::env::var("http_proxy") -2183 .ok() -2184 .and_then(|s| s.parse::<Url>().ok()) -2185 { -2186 return Some(url); -2187 } -2188 if let Some(url) = std::env::var("HTTPS_PROXY") -2189 .ok() -2190 .and_then(|s| s.parse::<Url>().ok()) -2191 { -2192 return Some(url); -2193 } -2194 if let Some(url) = std::env::var("https_proxy") -2195 .ok() -2196 .and_then(|s| s.parse::<Url>().ok()) -2197 { -2198 return Some(url); -2199 } -2200 -2201 None -2202} -2203 -2204/// Configuration of the relay servers for an [`Endpoint`]. -2205#[derive(Debug, Clone, PartialEq, Eq)] -2206pub enum RelayMode { -2207 /// Disable relay servers completely. -2208 Disabled, -2209 /// Use the default relay map, with production relay servers from n0. -2210 /// -2211 /// See [`crate::defaults::prod`] for the severs used. -2212 Default, -2213 /// Use the staging relay servers from n0. -2214 Staging, -2215 /// Use a custom relay map. -2216 Custom(RelayMap), -2217} -2218 -2219impl RelayMode { -2220 /// Returns the relay map for this mode. -2221 pub fn relay_map(&self) -> RelayMap { -2222 match self { -2223 RelayMode::Disabled => RelayMap::empty(), -2224 RelayMode::Default => crate::defaults::prod::default_relay_map(), -2225 RelayMode::Staging => crate::defaults::staging::default_relay_map(), -2226 RelayMode::Custom(relay_map) => relay_map.clone(), -2227 } -2228 } -2229} -2230 -2231/// Environment variable to force the use of staging relays. -2232pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS"; -2233 -2234/// Returns `true` if the use of staging relays is forced. -2235pub fn force_staging_infra() -> bool { -2236 matches!(std::env::var(ENV_FORCE_STAGING_RELAYS), Ok(value) if !value.is_empty()) -2237} -2238 -2239/// Returns the default relay mode. -2240/// -2241/// If the `IROH_FORCE_STAGING_RELAYS` environment variable is non empty, it will return `RelayMode::Staging`. -2242/// Otherwise, it will return `RelayMode::Default`. -2243pub fn default_relay_mode() -> RelayMode { -2244 // Use staging in testing -2245 match force_staging_infra() { -2246 true => RelayMode::Staging, -2247 false => RelayMode::Default, -2248 } -2249} -2250 -2251/// Check if we are being executed in a CGI context. -2252/// -2253/// If so, a malicious client can send the `Proxy:` header, and it will -2254/// be in the `HTTP_PROXY` env var. So we don't use it :) -2255fn is_cgi() -> bool { -2256 std::env::var_os("REQUEST_METHOD").is_some() -2257} -2258 -2259// TODO: These tests could still be flaky, lets fix that: -2260// https://github.com/n0-computer/iroh/issues/1183 -2261#[cfg(test)] -2262mod tests { -2263 use std::{ -2264 net::SocketAddr, -2265 time::{Duration, Instant}, -2266 }; -2267 -2268 use iroh_base::{NodeAddr, NodeId, SecretKey}; -2269 use n0_future::{BufferedStreamExt, StreamExt, stream, task::AbortOnDropHandle}; -2270 use n0_snafu::{Error, Result, ResultExt}; -2271 use n0_watcher::Watcher; -2272 use quinn::ConnectionError; -2273 use rand::SeedableRng; -2274 use tracing::{Instrument, error_span, info, info_span}; -2275 use tracing_test::traced_test; -2276 -2277 use super::Endpoint; -2278 use crate::{ -2279 RelayMode, -2280 discovery::static_provider::StaticProvider, -2281 endpoint::{ConnectOptions, Connection, ConnectionType, RemoteInfo}, -2282 protocol::{AcceptError, ProtocolHandler, Router}, -2283 test_utils::{run_relay_server, run_relay_server_with}, -2284 }; -2285 -2286 const TEST_ALPN: &[u8] = b"n0/iroh/test"; -2287 -2288 #[tokio::test] -2289 #[traced_test] -2290 async fn test_connect_self() -> Result { -2291 let ep = Endpoint::builder() -2292 .alpns(vec![TEST_ALPN.to_vec()]) -2293 .bind() -2294 .await -2295 .unwrap(); -2296 let my_addr = ep.node_addr().initialized().await; -2297 let res = ep.connect(my_addr.clone(), TEST_ALPN).await; -2298 assert!(res.is_err()); -2299 let err = res.err().unwrap(); -2300 assert!(err.to_string().starts_with("Connecting to ourself")); -2301 -2302 let res = ep.add_node_addr(my_addr); -2303 assert!(res.is_err()); -2304 let err = res.err().unwrap(); -2305 assert!(err.to_string().starts_with("Adding our own address")); -2306 Ok(()) -2307 } -2308 -2309 #[tokio::test] -2310 #[traced_test] -2311 async fn endpoint_connect_close() -> Result { -2312 let (relay_map, relay_url, _guard) = run_relay_server().await?; -2313 let server_secret_key = SecretKey::generate(rand::rng()); -2314 let server_peer_id = server_secret_key.public(); -2315 -2316 // Wait for the endpoint to be started to make sure it's up before clients try to connect -2317 let ep = Endpoint::builder() -2318 .secret_key(server_secret_key) -2319 .alpns(vec![TEST_ALPN.to_vec()]) -2320 .relay_mode(RelayMode::Custom(relay_map.clone())) -2321 .insecure_skip_relay_cert_verify(true) -2322 .bind() -2323 .await?; -2324 // Wait for the endpoint to be reachable via relay -2325 ep.home_relay().initialized().await; -2326 -2327 let server = tokio::spawn( -2328 async move { -2329 info!("accepting connection"); -2330 let incoming = ep.accept().await.e()?; -2331 let conn = incoming.await.e()?; -2332 let mut stream = conn.accept_uni().await.e()?; -2333 let mut buf = [0u8; 5]; -2334 stream.read_exact(&mut buf).await.e()?; -2335 info!("Accepted 1 stream, received {buf:?}. Closing now."); -2336 // close the connection -2337 conn.close(7u8.into(), b"bye"); -2338 -2339 let res = conn.accept_uni().await; -2340 assert_eq!(res.unwrap_err(), quinn::ConnectionError::LocallyClosed); -2341 -2342 let res = stream.read_to_end(10).await; -2343 assert_eq!( -2344 res.unwrap_err(), -2345 quinn::ReadToEndError::Read(quinn::ReadError::ConnectionLost( -2346 quinn::ConnectionError::LocallyClosed -2347 )) -2348 ); -2349 info!("server test completed"); -2350 Ok::<_, Error>(()) -2351 } -2352 .instrument(info_span!("test-server")), -2353 ); -2354 -2355 let client = tokio::spawn( -2356 async move { -2357 let ep = Endpoint::builder() -2358 .alpns(vec![TEST_ALPN.to_vec()]) -2359 .relay_mode(RelayMode::Custom(relay_map)) -2360 .insecure_skip_relay_cert_verify(true) -2361 .bind() -2362 .await?; -2363 info!("client connecting"); -2364 let node_addr = NodeAddr::new(server_peer_id).with_relay_url(relay_url); -2365 let conn = ep.connect(node_addr, TEST_ALPN).await?; -2366 let mut stream = conn.open_uni().await.e()?; -2367 -2368 // First write is accepted by server. We need this bit of synchronisation -2369 // because if the server closes after simply accepting the connection we can -2370 // not be sure our .open_uni() call would succeed as it may already receive -2371 // the error. -2372 stream.write_all(b"hello").await.e()?; -2373 -2374 info!("waiting for closed"); -2375 // Remote now closes the connection, we should see an error sometime soon. -2376 let err = conn.closed().await; -2377 let expected_err = -2378 quinn::ConnectionError::ApplicationClosed(quinn::ApplicationClose { -2379 error_code: 7u8.into(), -2380 reason: b"bye".to_vec().into(), -2381 }); -2382 assert_eq!(err, expected_err); -2383 -2384 info!("opening new - expect it to fail"); -2385 let res = conn.open_uni().await; -2386 assert_eq!(res.unwrap_err(), expected_err); -2387 info!("client test completed"); -2388 Ok::<_, Error>(()) -2389 } -2390 .instrument(info_span!("test-client")), -2391 ); -2392 -2393 let (server, client) = tokio::time::timeout( -2394 Duration::from_secs(30), -2395 n0_future::future::zip(server, client), -2396 ) -2397 .await -2398 .e()?; -2399 server.e()??; -2400 client.e()??; -2401 Ok(()) -2402 } -2403 -2404 /// Test that peers are properly restored -2405 #[tokio::test] -2406 #[traced_test] -2407 async fn restore_peers() -> Result { -2408 let secret_key = SecretKey::generate(rand::rng()); -2409 -2410 /// Create an endpoint for the test. -2411 async fn new_endpoint( -2412 secret_key: SecretKey, -2413 nodes: Option<Vec<NodeAddr>>, -2414 ) -> Result<Endpoint> { -2415 let mut transport_config = quinn::TransportConfig::default(); -2416 transport_config.max_idle_timeout(Some(Duration::from_secs(10).try_into().unwrap())); -2417 -2418 let mut builder = Endpoint::builder() -2419 .secret_key(secret_key.clone()) -2420 .transport_config(transport_config); -2421 if let Some(nodes) = nodes { -2422 builder = builder.known_nodes(nodes); -2423 } -2424 Ok(builder.alpns(vec![TEST_ALPN.to_vec()]).bind().await?) -2425 } -2426 -2427 // create the peer that will be added to the peer map -2428 let peer_id = SecretKey::generate(rand::rng()).public(); -2429 let direct_addr: SocketAddr = -2430 (std::net::IpAddr::V4(std::net::Ipv4Addr::LOCALHOST), 8758u16).into(); -2431 let node_addr = NodeAddr::new(peer_id).with_direct_addresses([direct_addr]); -2432 -2433 info!("setting up first endpoint"); -2434 // first time, create a magic endpoint without peers but a peers file and add addressing -2435 // information for a peer -2436 let endpoint = new_endpoint(secret_key.clone(), None).await?; -2437 assert_eq!(endpoint.remote_info_iter().count(), 0); -2438 endpoint.add_node_addr(node_addr.clone())?; -2439 -2440 // Grab the current addrs -2441 let node_addrs: Vec<NodeAddr> = endpoint.remote_info_iter().map(Into::into).collect(); -2442 assert_eq!(node_addrs.len(), 1); -2443 assert_eq!(node_addrs[0], node_addr); -2444 -2445 info!("closing endpoint"); -2446 // close the endpoint and restart it -2447 endpoint.close().await; -2448 -2449 info!("restarting endpoint"); -2450 // now restart it and check the addressing info of the peer -2451 let endpoint = new_endpoint(secret_key, Some(node_addrs)).await?; -2452 let RemoteInfo { mut addrs, .. } = endpoint.remote_info(peer_id).e()?; -2453 let conn_addr = addrs.pop().unwrap().addr; -2454 assert_eq!(conn_addr, direct_addr); -2455 Ok(()) -2456 } -2457 -2458 #[tokio::test] -2459 #[traced_test] -2460 async fn endpoint_relay_connect_loop() -> Result { -2461 let test_start = Instant::now(); -2462 let n_clients = 5; -2463 let n_chunks_per_client = 2; -2464 let chunk_size = 10; -2465 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); -2466 let (relay_map, relay_url, _relay_guard) = run_relay_server().await.unwrap(); -2467 let server_secret_key = SecretKey::generate(&mut rng); -2468 let server_node_id = server_secret_key.public(); -2469 -2470 // Make sure the server is bound before having clients connect to it: -2471 let ep = Endpoint::builder() -2472 .insecure_skip_relay_cert_verify(true) -2473 .secret_key(server_secret_key) -2474 .alpns(vec![TEST_ALPN.to_vec()]) -2475 .relay_mode(RelayMode::Custom(relay_map.clone())) -2476 .bind() -2477 .await?; -2478 // Also make sure the server has a working relay connection -2479 ep.home_relay().initialized().await; -2480 -2481 info!(time = ?test_start.elapsed(), "test setup done"); -2482 -2483 // The server accepts the connections of the clients sequentially. -2484 let server = tokio::spawn( -2485 async move { -2486 let eps = ep.bound_sockets(); -2487 -2488 info!(me = %ep.node_id().fmt_short(), eps = ?eps, "server listening on"); -2489 for i in 0..n_clients { -2490 let round_start = Instant::now(); -2491 info!("[server] round {i}"); -2492 let incoming = ep.accept().await.e()?; -2493 let conn = incoming.await.e()?; -2494 let node_id = conn.remote_node_id()?; -2495 info!(%i, peer = %node_id.fmt_short(), "accepted connection"); -2496 let (mut send, mut recv) = conn.accept_bi().await.e()?; -2497 let mut buf = vec![0u8; chunk_size]; -2498 for _i in 0..n_chunks_per_client { -2499 recv.read_exact(&mut buf).await.e()?; -2500 send.write_all(&buf).await.e()?; -2501 } -2502 send.finish().e()?; -2503 conn.closed().await; // we're the last to send data, so we wait for the other side to close -2504 info!(%i, peer = %node_id.fmt_short(), "finished"); -2505 info!("[server] round {i} done in {:?}", round_start.elapsed()); -2506 } -2507 Ok::<_, Error>(()) -2508 } -2509 .instrument(error_span!("server")), -2510 ); -2511 -2512 let start = Instant::now(); -2513 -2514 for i in 0..n_clients { -2515 let round_start = Instant::now(); -2516 info!("[client] round {i}"); -2517 let client_secret_key = SecretKey::generate(&mut rng); -2518 async { -2519 info!("client binding"); -2520 let ep = Endpoint::builder() -2521 .alpns(vec![TEST_ALPN.to_vec()]) -2522 .insecure_skip_relay_cert_verify(true) -2523 .relay_mode(RelayMode::Custom(relay_map.clone())) -2524 .secret_key(client_secret_key) -2525 .bind() -2526 .await?; -2527 let eps = ep.bound_sockets(); -2528 -2529 info!(me = %ep.node_id().fmt_short(), eps=?eps, "client bound"); -2530 let node_addr = NodeAddr::new(server_node_id).with_relay_url(relay_url.clone()); -2531 info!(to = ?node_addr, "client connecting"); -2532 let conn = ep.connect(node_addr, TEST_ALPN).await.e()?; -2533 info!("client connected"); -2534 let (mut send, mut recv) = conn.open_bi().await.e()?; -2535 -2536 for i in 0..n_chunks_per_client { -2537 let mut buf = vec![i; chunk_size]; -2538 send.write_all(&buf).await.e()?; -2539 recv.read_exact(&mut buf).await.e()?; -2540 assert_eq!(buf, vec![i; chunk_size]); -2541 } -2542 // we're the last to receive data, so we close -2543 conn.close(0u32.into(), b"bye!"); -2544 info!("client finished"); -2545 ep.close().await; -2546 info!("client closed"); -2547 Ok::<_, Error>(()) -2548 } -2549 .instrument(error_span!("client", %i)) -2550 .await?; -2551 info!("[client] round {i} done in {:?}", round_start.elapsed()); -2552 } -2553 -2554 server.await.e()??; -2555 -2556 // We appear to have seen this being very slow at times. So ensure we fail if this -2557 // test is too slow. We're only making two connections transferring very little -2558 // data, this really shouldn't take long. -2559 if start.elapsed() > Duration::from_secs(15) { -2560 panic!("Test too slow, something went wrong"); -2561 } -2562 -2563 Ok(()) -2564 } +159 let mut rng = rand::rng(); +160 let relay_map = self.relay_mode.relay_map(); +161 let secret_key = self +162 .secret_key +163 .unwrap_or_else(move || SecretKey::generate(&mut rng)); +164 let static_config = StaticConfig { +165 transport_config: Arc::new(self.transport_config), +166 tls_config: tls::TlsConfig::new(secret_key.clone(), self.max_tls_tickets), +167 keylog: self.keylog, +168 }; +169 let server_config = static_config.create_server_config(self.alpn_protocols); +170 +171 #[cfg(not(wasm_browser))] +172 let dns_resolver = self.dns_resolver.unwrap_or_default(); +173 +174 let discovery: Option<Box<dyn Discovery>> = { +175 let context = DiscoveryContext { +176 secret_key: &secret_key, +177 #[cfg(not(wasm_browser))] +178 dns_resolver: &dns_resolver, +179 }; +180 let discovery = self +181 .discovery +182 .into_iter() +183 .map(|builder| builder.into_discovery(&context)) +184 .collect::<Result<Vec<_>, IntoDiscoveryError>>()?; +185 match discovery.len() { +186 0 => None, +187 1 => Some(discovery.into_iter().next().expect("checked length")), +188 _ => Some(Box::new(ConcurrentDiscovery::from_services(discovery))), +189 } +190 }; +191 +192 let metrics = EndpointMetrics::default(); +193 +194 let msock_opts = magicsock::Options { +195 addr_v4: self.addr_v4, +196 addr_v6: self.addr_v6, +197 secret_key, +198 relay_map, +199 node_map: self.node_map, +200 discovery, +201 discovery_user_data: self.discovery_user_data, +202 proxy_url: self.proxy_url, +203 #[cfg(not(wasm_browser))] +204 dns_resolver, +205 server_config, +206 #[cfg(any(test, feature = "test-utils"))] +207 insecure_skip_relay_cert_verify: self.insecure_skip_relay_cert_verify, +208 #[cfg(any(test, feature = "test-utils"))] +209 path_selection: self.path_selection, +210 metrics, +211 }; +212 +213 Endpoint::bind(static_config, msock_opts).await +214 } +215 +216 // # The very common methods everyone basically needs. +217 +218 /// Sets the IPv4 bind address. +219 /// +220 /// Setting the port to `0` will use a random port. +221 /// If the port specified is already in use, it will fallback to choosing a random port. +222 /// +223 /// By default will use `0.0.0.0:0` to bind to. +224 pub fn bind_addr_v4(mut self, addr: SocketAddrV4) -> Self { +225 self.addr_v4.replace(addr); +226 self +227 } +228 +229 /// Sets the IPv6 bind address. +230 /// +231 /// Setting the port to `0` will use a random port. +232 /// If the port specified is already in use, it will fallback to choosing a random port. +233 /// +234 /// By default will use `[::]:0` to bind to. +235 pub fn bind_addr_v6(mut self, addr: SocketAddrV6) -> Self { +236 self.addr_v6.replace(addr); +237 self +238 } +239 +240 /// Sets a secret key to authenticate with other peers. +241 /// +242 /// This secret key's public key will be the [`PublicKey`] of this endpoint and thus +243 /// also its [`NodeId`] +244 /// +245 /// If not set, a new secret key will be generated. +246 /// +247 /// [`PublicKey`]: iroh_base::PublicKey +248 pub fn secret_key(mut self, secret_key: SecretKey) -> Self { +249 self.secret_key = Some(secret_key); +250 self +251 } +252 +253 /// Sets the [ALPN] protocols that this endpoint will accept on incoming connections. +254 /// +255 /// Not setting this will still allow creating connections, but to accept incoming +256 /// connections at least one [ALPN] must be set. +257 /// +258 /// [ALPN]: https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation +259 pub fn alpns(mut self, alpn_protocols: Vec<Vec<u8>>) -> Self { +260 self.alpn_protocols = alpn_protocols; +261 self +262 } +263 +264 // # Methods for common customisation items. +265 +266 /// Sets the relay servers to assist in establishing connectivity. +267 /// +268 /// Relay servers are used to establish initial connection with another iroh node. +269 /// They also perform various functions related to hole punching, see the [crate docs] +270 /// for more details. +271 /// +272 /// By default the [number 0] relay servers are used, see [`RelayMode::Default`]. +273 /// +274 /// When using [RelayMode::Custom], the provided `relay_map` must contain at least one +275 /// configured relay node. If an invalid RelayMap is provided [`bind`] +276 /// will result in an error. +277 /// +278 /// [`bind`]: Builder::bind +279 /// [crate docs]: crate +280 /// [number 0]: https://n0.computer +281 pub fn relay_mode(mut self, relay_mode: RelayMode) -> Self { +282 self.relay_mode = relay_mode; +283 self +284 } +285 +286 /// Removes all discovery services from the builder. +287 pub fn clear_discovery(mut self) -> Self { +288 self.discovery.clear(); +289 self +290 } +291 +292 /// Optionally sets a discovery mechanism for this endpoint. +293 /// +294 /// If you want to combine multiple discovery services, you can use +295 /// [`Builder::add_discovery`] instead. This will internally create a +296 /// [`crate::discovery::ConcurrentDiscovery`]. +297 /// +298 /// If no discovery service is set, connecting to a node without providing its +299 /// direct addresses or relay URLs will fail. +300 /// +301 /// See the documentation of the [`Discovery`] trait for details. +302 pub fn discovery(mut self, discovery: impl IntoDiscovery) -> Self { +303 self.discovery.clear(); +304 self.discovery.push(Box::new(discovery)); +305 self +306 } +307 +308 /// Adds a discovery mechanism for this endpoint. +309 /// +310 /// The function `discovery` +311 /// will be called on endpoint creation with the configured secret key of +312 /// the endpoint. Discovery services that need to publish information need +313 /// to use this secret key to sign the information. +314 /// +315 /// If you add multiple discovery services, they will be combined using a +316 /// [`crate::discovery::ConcurrentDiscovery`]. +317 /// +318 /// If no discovery service is set, connecting to a node without providing its +319 /// direct addresses or relay URLs will fail. +320 /// +321 /// To clear all discovery services, use [`Builder::clear_discovery`]. +322 /// +323 /// See the documentation of the [`Discovery`] trait for details. +324 pub fn add_discovery(mut self, discovery: impl IntoDiscovery) -> Self { +325 self.discovery.push(Box::new(discovery)); +326 self +327 } +328 +329 /// Configures the endpoint to use the default n0 DNS discovery service. +330 /// +331 /// The default discovery service publishes to and resolves from the +332 /// n0.computer dns server `iroh.link`. +333 /// +334 /// This is equivalent to adding both a [`crate::discovery::pkarr::PkarrPublisher`] +335 /// and a [`crate::discovery::dns::DnsDiscovery`], both configured to use the +336 /// n0.computer dns server. +337 /// +338 /// This will by default use [`N0_DNS_PKARR_RELAY_PROD`]. +339 /// When in tests, or when the `test-utils` feature is enabled, this will use the +340 /// [`N0_DNS_PKARR_RELAY_STAGING`]. +341 /// +342 /// [`N0_DNS_PKARR_RELAY_PROD`]: crate::discovery::pkarr::N0_DNS_PKARR_RELAY_PROD +343 /// [`N0_DNS_PKARR_RELAY_STAGING`]: crate::discovery::pkarr::N0_DNS_PKARR_RELAY_STAGING +344 pub fn discovery_n0(mut self) -> Self { +345 self = self.add_discovery(PkarrPublisher::n0_dns()); +346 // Resolve using HTTPS requests to our DNS server's /pkarr path in browsers +347 #[cfg(wasm_browser)] +348 { +349 self = self.add_discovery(PkarrResolver::n0_dns()); +350 } +351 // Resolve using DNS queries outside browsers. +352 #[cfg(not(wasm_browser))] +353 { +354 self = self.add_discovery(DnsDiscovery::n0_dns()); +355 } +356 self +357 } +358 +359 #[cfg(feature = "discovery-pkarr-dht")] +360 /// Configures the endpoint to also use the mainline DHT with default settings. +361 /// +362 /// This is equivalent to adding a [`crate::discovery::pkarr::dht::DhtDiscovery`] +363 /// with default settings. Note that DhtDiscovery has various more advanced +364 /// configuration options. If you need any of those, you should manually +365 /// create a DhtDiscovery and add it with [`Builder::add_discovery`]. +366 pub fn discovery_dht(mut self) -> Self { +367 self = self.add_discovery(crate::discovery::pkarr::dht::DhtDiscovery::builder()); +368 self +369 } +370 +371 #[cfg(feature = "discovery-local-network")] +372 /// Configures the endpoint to also use local network discovery. +373 /// +374 /// This is equivalent to adding a [`crate::discovery::mdns::MdnsDiscovery`] +375 /// with default settings. Note that MdnsDiscovery has various more advanced +376 /// configuration options. If you need any of those, you should manually +377 /// create a MdnsDiscovery and add it with [`Builder::add_discovery`]. +378 pub fn discovery_local_network(mut self) -> Self { +379 self = self.add_discovery(crate::discovery::mdns::MdnsDiscovery::builder()); +380 self +381 } +382 +383 /// Sets the initial user-defined data to be published in discovery services for this node. +384 /// +385 /// When using discovery services, this string of [`UserData`] will be published together +386 /// with the node's addresses and relay URL. When other nodes discover this node, +387 /// they retrieve the [`UserData`] in addition to the addressing info. +388 /// +389 /// Iroh itself does not interpret the user-defined data in any way, it is purely left +390 /// for applications to parse and use. +391 pub fn user_data_for_discovery(mut self, user_data: UserData) -> Self { +392 self.discovery_user_data = Some(user_data); +393 self +394 } +395 +396 /// Optionally set a list of known nodes. +397 pub fn known_nodes(mut self, nodes: Vec<NodeAddr>) -> Self { +398 self.node_map = Some(nodes); +399 self +400 } +401 +402 // # Methods for more specialist customisation. +403 +404 /// Sets a custom [`quinn::TransportConfig`] for this endpoint. +405 /// +406 /// The transport config contains parameters governing the QUIC state machine. +407 /// +408 /// If unset, the default config is used. Default values should be suitable for most +409 /// internet applications. Applications protocols which forbid remotely-initiated +410 /// streams should set `max_concurrent_bidi_streams` and `max_concurrent_uni_streams` to +411 /// zero. +412 /// +413 /// Please be aware that changing some settings may have adverse effects on establishing +414 /// and maintaining direct connections. +415 pub fn transport_config(mut self, transport_config: quinn::TransportConfig) -> Self { +416 self.transport_config = transport_config; +417 self +418 } +419 +420 /// Optionally sets a custom DNS resolver to use for this endpoint. +421 /// +422 /// The DNS resolver is used to resolve relay hostnames, and node addresses if +423 /// [`crate::discovery::dns::DnsDiscovery`] is configured. +424 /// +425 /// By default, a new DNS resolver is created which is configured to use the +426 /// host system's DNS configuration. You can pass a custom instance of [`DnsResolver`] +427 /// here to use a differently configured DNS resolver for this endpoint, or to share +428 /// a [`DnsResolver`] between multiple endpoints. +429 #[cfg(not(wasm_browser))] +430 pub fn dns_resolver(mut self, dns_resolver: DnsResolver) -> Self { +431 self.dns_resolver = Some(dns_resolver); +432 self +433 } +434 +435 /// Sets an explicit proxy url to proxy all HTTP(S) traffic through. +436 pub fn proxy_url(mut self, url: Url) -> Self { +437 self.proxy_url.replace(url); +438 self +439 } +440 +441 /// Sets the proxy url from the environment, in this order: +442 /// +443 /// - `HTTP_PROXY` +444 /// - `http_proxy` +445 /// - `HTTPS_PROXY` +446 /// - `https_proxy` +447 pub fn proxy_from_env(mut self) -> Self { +448 self.proxy_url = proxy_url_from_env(); +449 self +450 } +451 +452 /// Enables saving the TLS pre-master key for connections. +453 /// +454 /// This key should normally remain secret but can be useful to debug networking issues +455 /// by decrypting captured traffic. +456 /// +457 /// If *keylog* is `true` then setting the `SSLKEYLOGFILE` environment variable to a +458 /// filename will result in this file being used to log the TLS pre-master keys. +459 pub fn keylog(mut self, keylog: bool) -> Self { +460 self.keylog = keylog; +461 self +462 } +463 +464 /// Skip verification of SSL certificates from relay servers +465 /// +466 /// May only be used in tests. +467 #[cfg(any(test, feature = "test-utils"))] +468 pub fn insecure_skip_relay_cert_verify(mut self, skip_verify: bool) -> Self { +469 self.insecure_skip_relay_cert_verify = skip_verify; +470 self +471 } +472 +473 /// This implies we only use the relay to communicate +474 /// and do not attempt to do any hole punching. +475 #[cfg(any(test, feature = "test-utils"))] +476 pub fn path_selection(mut self, path_selection: PathSelection) -> Self { +477 self.path_selection = path_selection; +478 self +479 } +480 +481 /// Set the maximum number of TLS tickets to cache. +482 /// +483 /// Set this to a larger value if you want to do 0rtt connections to a large +484 /// number of clients. +485 /// +486 /// The default is 256, taking about 150 KiB in memory. +487 pub fn max_tls_tickets(mut self, n: usize) -> Self { +488 self.max_tls_tickets = n; +489 self +490 } +491} +492 +493/// Configuration for a [`quinn::Endpoint`] that cannot be changed at runtime. +494#[derive(Debug)] +495struct StaticConfig { +496 tls_config: tls::TlsConfig, +497 transport_config: Arc<quinn::TransportConfig>, +498 keylog: bool, +499} +500 +501impl StaticConfig { +502 /// Create a [`quinn::ServerConfig`] with the specified ALPN protocols. +503 fn create_server_config(&self, alpn_protocols: Vec<Vec<u8>>) -> ServerConfig { +504 let quic_server_config = self +505 .tls_config +506 .make_server_config(alpn_protocols, self.keylog); +507 let mut server_config = ServerConfig::with_crypto(Arc::new(quic_server_config)); +508 server_config.transport_config(self.transport_config.clone()); +509 +510 server_config +511 } +512} +513 +514/// Controls an iroh node, establishing connections with other nodes. +515/// +516/// This is the main API interface to create connections to, and accept connections from +517/// other iroh nodes. The connections are peer-to-peer and encrypted, a Relay server is +518/// used to make the connections reliable. See the [crate docs] for a more detailed +519/// overview of iroh. +520/// +521/// It is recommended to only create a single instance per application. This ensures all +522/// the connections made share the same peer-to-peer connections to other iroh nodes, +523/// while still remaining independent connections. This will result in more optimal network +524/// behaviour. +525/// +526/// The endpoint is created using the [`Builder`], which can be created using +527/// [`Endpoint::builder`]. +528/// +529/// Once an endpoint exists, new connections are typically created using the +530/// [`Endpoint::connect`] and [`Endpoint::accept`] methods. Once established, the +531/// [`Connection`] gives access to most [QUIC] features. Individual streams to send data to +532/// the peer are created using the [`Connection::open_bi`], [`Connection::accept_bi`], +533/// [`Connection::open_uni`] and [`Connection::open_bi`] functions. +534/// +535/// Note that due to the light-weight properties of streams a stream will only be accepted +536/// once the initiating peer has sent some data on it. +537/// +538/// [QUIC]: https://quicwg.org +539#[derive(Clone, Debug)] +540pub struct Endpoint { +541 /// Handle to the magicsocket/actor +542 msock: Handle, +543 /// Handle to the actor that resets the quinn RTT estimator +544 rtt_actor: Arc<rtt_actor::RttHandle>, +545 /// Configuration structs for quinn, holds the transport config, certificate setup, secret key etc. +546 static_config: Arc<StaticConfig>, +547} +548 +549#[allow(missing_docs)] +550#[common_fields({ +551 backtrace: Option<snafu::Backtrace>, +552 #[snafu(implicit)] +553 span_trace: n0_snafu::SpanTrace, +554})] +555#[derive(Debug, Snafu)] +556#[non_exhaustive] +557pub enum ConnectWithOptsError { +558 #[snafu(transparent)] +559 AddNodeAddr { source: AddNodeAddrError }, +560 #[snafu(display("Connecting to ourself is not supported"))] +561 SelfConnect {}, +562 #[snafu(display("No addressing information available"))] +563 NoAddress { source: GetMappingAddressError }, +564 #[snafu(display("Unable to connect to remote"))] +565 Quinn { source: quinn::ConnectError }, +566} +567 +568#[allow(missing_docs)] +569#[common_fields({ +570 backtrace: Option<snafu::Backtrace>, +571 #[snafu(implicit)] +572 span_trace: n0_snafu::SpanTrace, +573})] +574#[derive(Debug, Snafu)] +575#[non_exhaustive] +576pub enum ConnectError { +577 #[snafu(transparent)] +578 Connect { +579 #[snafu(source(from(ConnectWithOptsError, Box::new)))] +580 source: Box<ConnectWithOptsError>, +581 }, +582 #[snafu(transparent)] +583 Connection { +584 #[snafu(source(from(ConnectionError, Box::new)))] +585 source: Box<ConnectionError>, +586 }, +587} +588 +589#[allow(missing_docs)] +590#[common_fields({ +591 backtrace: Option<snafu::Backtrace>, +592 #[snafu(implicit)] +593 span_trace: n0_snafu::SpanTrace, +594})] +595#[derive(Debug, Snafu)] +596#[non_exhaustive] +597pub enum BindError { +598 #[snafu(transparent)] +599 MagicSpawn { +600 source: magicsock::CreateHandleError, +601 }, +602 #[snafu(transparent)] +603 Discovery { +604 source: crate::discovery::IntoDiscoveryError, +605 }, +606} +607 +608#[allow(missing_docs)] +609#[common_fields({ +610 backtrace: Option<snafu::Backtrace>, +611 #[snafu(implicit)] +612 span_trace: n0_snafu::SpanTrace, +613})] +614#[derive(Debug, Snafu)] +615#[snafu(module)] +616#[non_exhaustive] +617pub enum GetMappingAddressError { +618 #[snafu(display("Discovery service required due to missing addressing information"))] +619 DiscoveryStart { source: DiscoveryError }, +620 #[snafu(display("Discovery service failed"))] +621 Discover { source: DiscoveryError }, +622 #[snafu(display("No addressing information found"))] +623 NoAddress {}, +624} +625 +626impl Endpoint { +627 // The ordering of public methods is reflected directly in the documentation. This is +628 // roughly ordered by what is most commonly needed by users, but grouped in similar +629 // items. +630 +631 // # Methods relating to construction. +632 +633 /// Returns the builder for an [`Endpoint`], with a production configuration. +634 pub fn builder() -> Builder { +635 Builder::default() +636 } +637 +638 /// Creates a quinn endpoint backed by a magicsock. +639 /// +640 /// This is for internal use, the public interface is the [`Builder`] obtained from +641 /// [Self::builder]. See the methods on the builder for documentation of the parameters. +642 #[instrument("ep", skip_all, fields(me = %static_config.tls_config.secret_key.public().fmt_short()))] +643 async fn bind( +644 static_config: StaticConfig, +645 msock_opts: magicsock::Options, +646 ) -> Result<Self, BindError> { +647 let msock = magicsock::MagicSock::spawn(msock_opts).await?; +648 trace!("created magicsock"); +649 debug!(version = env!("CARGO_PKG_VERSION"), "iroh Endpoint created"); +650 +651 let metrics = msock.metrics.magicsock.clone(); +652 let ep = Self { +653 msock, +654 rtt_actor: Arc::new(rtt_actor::RttHandle::new(metrics)), +655 static_config: Arc::new(static_config), +656 }; +657 Ok(ep) +658 } +659 +660 /// Sets the list of accepted ALPN protocols. +661 /// +662 /// This will only affect new incoming connections. +663 /// Note that this *overrides* the current list of ALPNs. +664 pub fn set_alpns(&self, alpns: Vec<Vec<u8>>) { +665 let server_config = self.static_config.create_server_config(alpns); +666 self.msock.endpoint().set_server_config(Some(server_config)); +667 } +668 +669 // # Methods for establishing connectivity. +670 +671 /// Connects to a remote [`Endpoint`]. +672 /// +673 /// A value that can be converted into a [`NodeAddr`] is required. This can be either a +674 /// [`NodeAddr`], a [`NodeId`] or a [`iroh_base::ticket::NodeTicket`]. +675 /// +676 /// The [`NodeAddr`] must contain the [`NodeId`] to dial and may also contain a [`RelayUrl`] +677 /// and direct addresses. If direct addresses are provided, they will be used to try and +678 /// establish a direct connection without involving a relay server. +679 /// +680 /// If neither a [`RelayUrl`] or direct addresses are configured in the [`NodeAddr`] it +681 /// may still be possible a connection can be established. This depends on other calls +682 /// to [`Endpoint::add_node_addr`] which may provide contact information, or via the +683 /// [`Discovery`] service configured using [`Builder::discovery`]. The discovery +684 /// service will also be used if the remote node is not reachable on the provided direct +685 /// addresses and there is no [`RelayUrl`]. +686 /// +687 /// If addresses or relay servers are neither provided nor can be discovered, the +688 /// connection attempt will fail with an error. +689 /// +690 /// The `alpn`, or application-level protocol identifier, is also required. The remote +691 /// endpoint must support this `alpn`, otherwise the connection attempt will fail with +692 /// an error. +693 pub async fn connect( +694 &self, +695 node_addr: impl Into<NodeAddr>, +696 alpn: &[u8], +697 ) -> Result<Connection, ConnectError> { +698 let node_addr = node_addr.into(); +699 let remote = node_addr.node_id; +700 let connecting = self +701 .connect_with_opts(node_addr, alpn, Default::default()) +702 .await?; +703 let conn = connecting.await?; +704 +705 debug!( +706 me = %self.node_id().fmt_short(), +707 remote = %remote.fmt_short(), +708 alpn = %String::from_utf8_lossy(alpn), +709 "Connection established." +710 ); +711 Ok(conn) +712 } +713 +714 /// Starts a connection attempt with a remote [`Endpoint`]. +715 /// +716 /// Like [`Endpoint::connect`] (see also its docs for general details), but allows for a more +717 /// advanced connection setup with more customization in two aspects: +718 /// 1. The returned future resolves to a [`Connecting`], which can be further processed into +719 /// a [`Connection`] by awaiting, or alternatively allows connecting with 0RTT via +720 /// [`Connecting::into_0rtt`]. +721 /// **Note:** Please read the documentation for `into_0rtt` carefully to assess +722 /// security concerns. +723 /// 2. The [`TransportConfig`] for the connection can be modified via the provided +724 /// [`ConnectOptions`]. +725 /// **Note:** Please be aware that changing transport config settings may have adverse effects on +726 /// establishing and maintaining direct connections. Carefully test settings you use and +727 /// consider this currently as still rather experimental. +728 #[instrument(name = "connect", skip_all, fields( +729 me = %self.node_id().fmt_short(), +730 remote = tracing::field::Empty, +731 alpn = String::from_utf8_lossy(alpn).to_string(), +732 ))] +733 pub async fn connect_with_opts( +734 &self, +735 node_addr: impl Into<NodeAddr>, +736 alpn: &[u8], +737 options: ConnectOptions, +738 ) -> Result<Connecting, ConnectWithOptsError> { +739 let node_addr: NodeAddr = node_addr.into(); +740 tracing::Span::current().record( +741 "remote", +742 tracing::field::display(node_addr.node_id.fmt_short()), +743 ); +744 +745 // Connecting to ourselves is not supported. +746 ensure!(node_addr.node_id != self.node_id(), SelfConnectSnafu); +747 +748 if !node_addr.is_empty() { +749 self.add_node_addr(node_addr.clone())?; +750 } +751 let node_id = node_addr.node_id; +752 let direct_addresses = node_addr.direct_addresses.clone(); +753 let relay_url = node_addr.relay_url.clone(); +754 +755 // Get the mapped IPv6 address from the magic socket. Quinn will connect to this +756 // address. Start discovery for this node if it's enabled and we have no valid or +757 // verified address information for this node. Dropping the discovery cancels any +758 // still running task. +759 let (mapped_addr, _discovery_drop_guard) = self +760 .get_mapping_addr_and_maybe_start_discovery(node_addr) +761 .await +762 .context(NoAddressSnafu)?; +763 +764 let transport_config = options +765 .transport_config +766 .unwrap_or(self.static_config.transport_config.clone()); +767 +768 // Start connecting via quinn. This will time out after 10 seconds if no reachable +769 // address is available. +770 +771 debug!( +772 ?mapped_addr, +773 ?direct_addresses, +774 ?relay_url, +775 "Attempting connection..." +776 ); +777 let client_config = { +778 let mut alpn_protocols = vec![alpn.to_vec()]; +779 alpn_protocols.extend(options.additional_alpns); +780 let quic_client_config = self +781 .static_config +782 .tls_config +783 .make_client_config(alpn_protocols, self.static_config.keylog); +784 let mut client_config = quinn::ClientConfig::new(Arc::new(quic_client_config)); +785 client_config.transport_config(transport_config); +786 client_config +787 }; +788 +789 let server_name = &tls::name::encode(node_id); +790 let connect = self +791 .msock +792 .endpoint() +793 .connect_with( +794 client_config, +795 mapped_addr.private_socket_addr(), +796 server_name, +797 ) +798 .context(QuinnSnafu)?; +799 +800 Ok(Connecting { +801 inner: connect, +802 ep: self.clone(), +803 remote_node_id: Some(node_id), +804 _discovery_drop_guard, +805 }) +806 } +807 +808 /// Accepts an incoming connection on the endpoint. +809 /// +810 /// Only connections with the ALPNs configured in [`Builder::alpns`] will be accepted. +811 /// If multiple ALPNs have been configured the ALPN can be inspected before accepting +812 /// the connection using [`Connecting::alpn`]. +813 /// +814 /// The returned future will yield `None` if the endpoint is closed by calling +815 /// [`Endpoint::close`]. +816 pub fn accept(&self) -> Accept<'_> { +817 Accept { +818 inner: self.msock.endpoint().accept(), +819 ep: self.clone(), +820 } +821 } +822 +823 // # Methods for manipulating the internal state about other nodes. +824 +825 /// Informs this [`Endpoint`] about addresses of the iroh node. +826 /// +827 /// This updates the local state for the remote node. If the provided [`NodeAddr`] +828 /// contains a [`RelayUrl`] this will be used as the new relay server for this node. If +829 /// it contains any new IP endpoints they will also be stored and tried when next +830 /// connecting to this node. Any address that matches this node's direct addresses will be +831 /// silently ignored. +832 /// +833 /// See also [`Endpoint::add_node_addr_with_source`]. +834 /// +835 /// # Using node discovery instead +836 /// +837 /// It is strongly advised to use node discovery using the [`StaticProvider`] instead. +838 /// This provides more flexibility and future proofing. +839 /// +840 /// # Errors +841 /// +842 /// Will return an error if we attempt to add our own [`NodeId`] to the node map or +843 /// if the direct addresses are a subset of ours. +844 /// +845 /// [`StaticProvider`]: crate::discovery::static_provider::StaticProvider +846 pub fn add_node_addr(&self, node_addr: NodeAddr) -> Result<(), AddNodeAddrError> { +847 self.add_node_addr_inner(node_addr, magicsock::Source::App) +848 } +849 +850 /// Informs this [`Endpoint`] about addresses of the iroh node, noting the source. +851 /// +852 /// This updates the local state for the remote node. If the provided [`NodeAddr`] contains a +853 /// [`RelayUrl`] this will be used as the new relay server for this node. If it contains any +854 /// new IP endpoints they will also be stored and tried when next connecting to this node. Any +855 /// address that matches this node's direct addresses will be silently ignored. The *source* is +856 /// used for logging exclusively and will not be stored. +857 /// +858 /// # Using node discovery instead +859 /// +860 /// It is strongly advised to use node discovery using the [`StaticProvider`] instead. +861 /// This provides more flexibility and future proofing. +862 /// +863 /// # Errors +864 /// +865 /// Will return an error if we attempt to add our own [`NodeId`] to the node map or +866 /// if the direct addresses are a subset of ours. +867 /// +868 /// [`StaticProvider`]: crate::discovery::static_provider::StaticProvider +869 pub fn add_node_addr_with_source( +870 &self, +871 node_addr: NodeAddr, +872 source: &'static str, +873 ) -> Result<(), AddNodeAddrError> { +874 self.add_node_addr_inner( +875 node_addr, +876 magicsock::Source::NamedApp { +877 name: source.into(), +878 }, +879 ) +880 } +881 +882 fn add_node_addr_inner( +883 &self, +884 node_addr: NodeAddr, +885 source: magicsock::Source, +886 ) -> Result<(), AddNodeAddrError> { +887 // Connecting to ourselves is not supported. +888 snafu::ensure!(node_addr.node_id != self.node_id(), OwnAddressSnafu); +889 self.msock.add_node_addr(node_addr, source) +890 } +891 +892 // # Getter methods for properties of this Endpoint itself. +893 +894 /// Returns the secret_key of this endpoint. +895 pub fn secret_key(&self) -> &SecretKey { +896 &self.static_config.tls_config.secret_key +897 } +898 +899 /// Returns the node id of this endpoint. +900 /// +901 /// This ID is the unique addressing information of this node and other peers must know +902 /// it to be able to connect to this node. +903 pub fn node_id(&self) -> NodeId { +904 self.static_config.tls_config.secret_key.public() +905 } +906 +907 /// Returns a [`Watcher`] for the current [`NodeAddr`] for this endpoint. +908 /// +909 /// The observed [`NodeAddr`] will have the current [`RelayUrl`] and direct addresses +910 /// as they would be returned by [`Endpoint::home_relay`] and [`Endpoint::direct_addresses`]. +911 /// +912 /// Use [`Watcher::initialized`] to wait for a [`NodeAddr`] that is ready to be connected to: +913 /// +914 /// ```no_run +915 /// # async fn wrapper() -> n0_snafu::Result { +916 /// use iroh::{Endpoint, Watcher}; +917 /// +918 /// let endpoint = Endpoint::builder() +919 /// .alpns(vec![b"my-alpn".to_vec()]) +920 /// .bind() +921 /// .await?; +922 /// let node_addr = endpoint.node_addr().initialized().await; +923 /// # let _ = node_addr; +924 /// # Ok(()) +925 /// # } +926 /// ``` +927 #[cfg(not(wasm_browser))] +928 pub fn node_addr(&self) -> impl n0_watcher::Watcher<Value = Option<NodeAddr>> + use<> { +929 let watch_addrs = self.direct_addresses(); +930 let watch_relay = self.home_relay(); +931 let node_id = self.node_id(); +932 +933 watch_addrs +934 .or(watch_relay) +935 .map(move |(addrs, mut relays)| match addrs { +936 Some(addrs) => Some(NodeAddr::from_parts( +937 node_id, +938 relays.pop(), +939 addrs.into_iter().map(|x| x.addr), +940 )), +941 None => relays.pop().map(|relay_url| { +942 NodeAddr::from_parts(node_id, Some(relay_url), std::iter::empty()) +943 }), +944 }) +945 .expect("watchable is alive - cannot be disconnected yet") +946 } +947 +948 /// Returns a [`Watcher`] for the current [`NodeAddr`] for this endpoint. +949 /// +950 /// When compiled to Wasm, this function returns a watcher that initializes +951 /// with a [`NodeAddr`] that only contains a relay URL, but no direct addresses, +952 /// as there are no APIs for directly using sockets in browsers. +953 #[cfg(wasm_browser)] +954 pub fn node_addr(&self) -> impl n0_watcher::Watcher<Value = Option<NodeAddr>> + use<> { +955 // In browsers, there will never be any direct addresses, so we wait +956 // for the home relay instead. This makes the `NodeAddr` have *some* way +957 // of connecting to us. +958 let watch_relay = self.home_relay(); +959 let node_id = self.node_id(); +960 watch_relay +961 .map(move |mut relays| { +962 relays.pop().map(|relay_url| { +963 NodeAddr::from_parts(node_id, Some(relay_url), std::iter::empty()) +964 }) +965 }) +966 .expect("watchable is alive - cannot be disconnected yet") +967 } +968 +969 /// Returns a [`Watcher`] for the [`RelayUrl`] of the Relay server used as home relay. +970 /// +971 /// Every endpoint has a home Relay server which it chooses as the server with the +972 /// lowest latency out of the configured servers provided by [`Builder::relay_mode`]. +973 /// This is the server other iroh nodes can use to reliably establish a connection +974 /// to this node. +975 /// +976 /// The watcher stores `None` if we are not connected to any Relay server. +977 /// +978 /// Note that this will store `None` right after the [`Endpoint`] is created since it takes +979 /// some time to connect to find and connect to the home relay server. +980 /// +981 /// # Examples +982 /// +983 /// To wait for a home relay connection to be established, use [`Watcher::initialized`]: +984 /// ```no_run +985 /// use iroh::{Endpoint, Watcher}; +986 /// +987 /// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap(); +988 /// # rt.block_on(async move { +989 /// let mep = Endpoint::builder().bind().await.unwrap(); +990 /// let _relay_url = mep.home_relay().initialized().await; +991 /// # }); +992 /// ``` +993 pub fn home_relay(&self) -> impl n0_watcher::Watcher<Value = Vec<RelayUrl>> + use<> { +994 self.msock.home_relay() +995 } +996 +997 /// Returns a [`Watcher`] for the direct addresses of this [`Endpoint`]. +998 /// +999 /// The direct addresses of the [`Endpoint`] are those that could be used by other +1000 /// iroh nodes to establish direct connectivity, depending on the network +1001 /// situation. The yielded lists of direct addresses contain both the locally-bound +1002 /// addresses and the [`Endpoint`]'s publicly reachable addresses discovered through +1003 /// mechanisms such as [QAD] and port mapping. Hence usually only a subset of these +1004 /// will be applicable to a certain remote iroh node. +1005 /// +1006 /// The [`Endpoint`] continuously monitors the direct addresses for changes as its own +1007 /// location in the network might change. Whenever changes are detected this stream +1008 /// will yield a new list of direct addresses. +1009 /// +1010 /// When issuing the first call to this method the first direct address discovery might +1011 /// still be underway, in this case the [`Watcher`] might not be initialized with [`Some`] +1012 /// value yet. Once the first set of local direct addresses are discovered the [`Watcher`] +1013 /// will always return [`Some`] set of direct addresses immediately, which are the most +1014 /// recently discovered direct addresses. +1015 /// +1016 /// # Examples +1017 /// +1018 /// To get the first set of direct addresses use [`Watcher::initialized`]: +1019 /// ```no_run +1020 /// use iroh::{Endpoint, Watcher as _}; +1021 /// +1022 /// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap(); +1023 /// # rt.block_on(async move { +1024 /// let ep = Endpoint::builder().bind().await.unwrap(); +1025 /// let _addrs = ep.direct_addresses().initialized().await; +1026 /// # }); +1027 /// ``` +1028 /// +1029 /// [QAD]: https://www.ietf.org/archive/id/draft-ietf-quic-address-discovery-00.html +1030 pub fn direct_addresses(&self) -> n0_watcher::Direct<Option<BTreeSet<DirectAddr>>> { +1031 self.msock.direct_addresses() +1032 } +1033 +1034 /// Returns a [`Watcher`] for any net-reports run from this [`Endpoint`]. +1035 /// +1036 /// A `net-report` checks the network conditions of the [`Endpoint`], such as +1037 /// whether it is connected to the internet via Ipv4 and/or Ipv6, its NAT +1038 /// status, its latency to the relay servers, and its public addresses. +1039 /// +1040 /// The [`Endpoint`] continuously runs `net-reports` to monitor if network +1041 /// conditions have changed. This [`Watcher`] will return the latest result +1042 /// of the `net-report`. +1043 /// +1044 /// When issuing the first call to this method the first report might +1045 /// still be underway, in this case the [`Watcher`] might not be initialized +1046 /// with [`Some`] value yet. Once the net-report has been successfully +1047 /// run, the [`Watcher`] will always return [`Some`] report immediately, which +1048 /// is the most recently run `net-report`. +1049 /// +1050 /// # Examples +1051 /// +1052 /// To get the first report use [`Watcher::initialized`]: +1053 /// ```no_run +1054 /// use iroh::{Endpoint, Watcher as _}; +1055 /// +1056 /// # let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap(); +1057 /// # rt.block_on(async move { +1058 /// let ep = Endpoint::builder().bind().await.unwrap(); +1059 /// let _report = ep.net_report().initialized().await; +1060 /// # }); +1061 /// ``` +1062 #[doc(hidden)] +1063 pub fn net_report(&self) -> impl Watcher<Value = Option<Report>> + use<> { +1064 self.msock.net_report() +1065 } +1066 +1067 /// Returns the local socket addresses on which the underlying sockets are bound. +1068 /// +1069 /// The [`Endpoint`] always binds on an IPv4 address and also tries to bind on an IPv6 +1070 /// address if available. +1071 pub fn bound_sockets(&self) -> Vec<SocketAddr> { +1072 self.msock +1073 .local_addr() +1074 .into_iter() +1075 .filter_map(|addr| addr.into_socket_addr()) +1076 .collect() +1077 } +1078 +1079 // # Getter methods for information about other nodes. +1080 +1081 /// Returns information about the remote node identified by a [`NodeId`]. +1082 /// +1083 /// The [`Endpoint`] keeps some information about remote iroh nodes, which it uses to find +1084 /// the best path to a node. Having information on a remote node, however, does not mean we have +1085 /// ever connected to it to or even whether a connection is even possible. The information about a +1086 /// remote node will change over time, as the [`Endpoint`] learns more about the node. Future +1087 /// calls may return different information. Furthermore, node information may even be +1088 /// completely evicted as it becomes stale. +1089 /// +1090 /// See also [`Endpoint::remote_info_iter`] which returns information on all nodes known +1091 /// by this [`Endpoint`]. +1092 pub fn remote_info(&self, node_id: NodeId) -> Option<RemoteInfo> { +1093 self.msock.remote_info(node_id) +1094 } +1095 +1096 /// Returns information about all the remote nodes this [`Endpoint`] knows about. +1097 /// +1098 /// This returns the same information as [`Endpoint::remote_info`] for each node known to this +1099 /// [`Endpoint`]. +1100 /// +1101 /// The [`Endpoint`] keeps some information about remote iroh nodes, which it uses to find +1102 /// the best path to a node. This returns all the nodes it knows about, regardless of whether a +1103 /// connection was ever made or is even possible. +1104 /// +1105 /// See also [`Endpoint::remote_info`] to only retrieve information about a single node. +1106 pub fn remote_info_iter(&self) -> impl Iterator<Item = RemoteInfo> + use<> { +1107 self.msock.list_remote_infos().into_iter() +1108 } +1109 +1110 /// Returns a stream of all remote nodes discovered through the endpoint's discovery services. +1111 /// +1112 /// Whenever a node is discovered via the endpoint's discovery service, the corresponding +1113 /// [`DiscoveryEvent`] is yielded from this stream. This includes nodes discovered actively +1114 /// through [`Discovery::resolve`], which is invoked automatically when calling +1115 /// [`Endpoint::connect`] for a [`NodeId`] unknown to the endpoint. It also includes +1116 /// nodes that the endpoint discovers passively from discovery services that implement +1117 /// [`Discovery::subscribe`], which e.g. [`MdnsDiscovery`] does. +1118 /// +1119 /// The stream does not yield information about nodes that are added manually to the endpoint's +1120 /// addressbook by calling [`Endpoint::add_node_addr`] or by supplying a full [`NodeAddr`] to +1121 /// [`Endpoint::connect`]. It also does not yield information about nodes that we only +1122 /// know about because they connected to us. When using the [`StaticProvider`] discovery, +1123 /// discovery info is only emitted once connecting to a node added to the static provider, not +1124 /// at the time of adding it to the static provider. +1125 /// +1126 /// The stream should be processed in a loop. If the stream is not processed fast enough, +1127 /// [`Lagged`] may be yielded, indicating that items were missed. +1128 /// +1129 /// See also [`Endpoint::remote_info_iter`], which returns an iterator over all remotes +1130 /// the endpoint knows about at a specific point in time. +1131 /// +1132 /// [`MdnsDiscovery`]: crate::discovery::mdns::MdnsDiscovery +1133 /// [`StaticProvider`]: crate::discovery::static_provider::StaticProvider +1134 pub fn discovery_stream(&self) -> impl Stream<Item = Result<DiscoveryEvent, Lagged>> + use<> { +1135 self.msock.discovery_subscribers().subscribe() +1136 } +1137 +1138 // # Methods for less common getters. +1139 // +1140 // Partially they return things passed into the builder. +1141 +1142 /// Returns a [`Watcher`] that reports the current connection type and any changes for +1143 /// given remote node. +1144 /// +1145 /// This watcher allows observing a stream of [`ConnectionType`] items by calling +1146 /// [`Watcher::stream()`]. If the underlying connection to a remote node changes, it will +1147 /// yield a new item. These connection changes are when the connection switches between +1148 /// using the Relay server and a direct connection. +1149 /// +1150 /// Note that this does not guarantee each connection change is yielded in the stream. +1151 /// If the connection type changes several times before this stream is polled, only the +1152 /// last recorded state is returned. This can be observed e.g. right at the start of a +1153 /// connection when the switch from a relayed to a direct connection can be so fast that +1154 /// the relayed state is never exposed. +1155 /// +1156 /// If there is currently a connection with the remote node, then using [`Watcher::get`] +1157 /// will immediately return either [`ConnectionType::Relay`], [`ConnectionType::Direct`] +1158 /// or [`ConnectionType::Mixed`]. +1159 /// +1160 /// It is possible for the connection type to be [`ConnectionType::None`] if you've +1161 /// recently connected to this node id but previous methods of reaching the node have +1162 /// become inaccessible. +1163 /// +1164 /// Will return `None` if we do not have any address information for the given `node_id`. +1165 pub fn conn_type(&self, node_id: NodeId) -> Option<n0_watcher::Direct<ConnectionType>> { +1166 self.msock.conn_type(node_id) +1167 } +1168 +1169 /// Returns the DNS resolver used in this [`Endpoint`]. +1170 /// +1171 /// See [`Builder::dns_resolver`]. +1172 #[cfg(not(wasm_browser))] +1173 pub fn dns_resolver(&self) -> &DnsResolver { +1174 self.msock.dns_resolver() +1175 } +1176 +1177 /// Returns the discovery mechanism, if configured. +1178 /// +1179 /// See [`Builder::discovery`]. +1180 pub fn discovery(&self) -> Option<&dyn Discovery> { +1181 self.msock.discovery() +1182 } +1183 +1184 /// Returns metrics collected for this endpoint. +1185 /// +1186 /// The endpoint internally collects various metrics about its operation. +1187 /// The returned [`EndpointMetrics`] struct contains all of these metrics. +1188 /// +1189 /// You can access individual metrics directly by using the public fields: +1190 /// ```rust +1191 /// # use std::collections::BTreeMap; +1192 /// # use iroh::endpoint::Endpoint; +1193 /// # async fn wrapper() -> n0_snafu::Result { +1194 /// let endpoint = Endpoint::builder().bind().await?; +1195 /// assert_eq!(endpoint.metrics().magicsock.recv_datagrams.get(), 0); +1196 /// # Ok(()) +1197 /// # } +1198 /// ``` +1199 /// +1200 /// [`EndpointMetrics`] implements [`MetricsGroupSet`], and each field +1201 /// implements [`MetricsGroup`]. These traits provide methods to iterate over +1202 /// the groups in the set, and over the individual metrics in each group, without having +1203 /// to access each field manually. With these methods, it is straightforward to collect +1204 /// all metrics into a map or push their values to a metrics collector. +1205 /// +1206 /// For example, the following snippet collects all metrics into a map: +1207 /// ```rust +1208 /// # use std::collections::BTreeMap; +1209 /// # use iroh_metrics::{Metric, MetricsGroup, MetricValue, MetricsGroupSet}; +1210 /// # use iroh::endpoint::Endpoint; +1211 /// # async fn wrapper() -> n0_snafu::Result { +1212 /// let endpoint = Endpoint::builder().bind().await?; +1213 /// let metrics: BTreeMap<String, MetricValue> = endpoint +1214 /// .metrics() +1215 /// .iter() +1216 /// .map(|(group, metric)| { +1217 /// let name = [group, metric.name()].join(":"); +1218 /// (name, metric.value()) +1219 /// }) +1220 /// .collect(); +1221 /// +1222 /// assert_eq!(metrics["magicsock:recv_datagrams"], MetricValue::Counter(0)); +1223 /// # Ok(()) +1224 /// # } +1225 /// ``` +1226 /// +1227 /// The metrics can also be encoded into the OpenMetrics text format, as used by Prometheus. +1228 /// To do so, use the [`iroh_metrics::Registry`], add the endpoint metrics to the +1229 /// registry with [`Registry::register_all`], and encode the metrics to a string with +1230 /// [`encode_openmetrics_to_string`]: +1231 /// ```rust +1232 /// # use iroh_metrics::{Registry, MetricsSource}; +1233 /// # use iroh::endpoint::Endpoint; +1234 /// # async fn wrapper() -> n0_snafu::Result { +1235 /// let endpoint = Endpoint::builder().bind().await?; +1236 /// let mut registry = Registry::default(); +1237 /// registry.register_all(endpoint.metrics()); +1238 /// let s = registry.encode_openmetrics_to_string()?; +1239 /// assert!(s.contains(r#"TYPE magicsock_recv_datagrams counter"#)); +1240 /// assert!(s.contains(r#"magicsock_recv_datagrams_total 0"#)); +1241 /// # Ok(()) +1242 /// # } +1243 /// ``` +1244 /// +1245 /// Through a registry, you can also add labels or prefixes to metrics with +1246 /// [`Registry::sub_registry_with_label`] or [`Registry::sub_registry_with_prefix`]. +1247 /// Furthermore, [`iroh_metrics::service`] provides functions to easily start services +1248 /// to serve the metrics with a HTTP server, dump them to a file, or push them +1249 /// to a Prometheus gateway. +1250 /// +1251 /// For example, the following snippet launches an HTTP server that serves the metrics in the +1252 /// OpenMetrics text format: +1253 /// ```no_run +1254 /// # use std::{sync::{Arc, RwLock}, time::Duration}; +1255 /// # use iroh_metrics::{Registry, MetricsSource}; +1256 /// # use iroh::endpoint::Endpoint; +1257 /// # use n0_snafu::ResultExt; +1258 /// # async fn wrapper() -> n0_snafu::Result { +1259 /// // Create a registry, wrapped in a read-write lock so that we can register and serve +1260 /// // the metrics independently. +1261 /// let registry = Arc::new(RwLock::new(Registry::default())); +1262 /// // Spawn a task to serve the metrics on an OpenMetrics HTTP endpoint. +1263 /// let metrics_task = tokio::task::spawn({ +1264 /// let registry = registry.clone(); +1265 /// async move { +1266 /// let addr = "0.0.0.0:9100".parse().unwrap(); +1267 /// iroh_metrics::service::start_metrics_server(addr, registry).await +1268 /// } +1269 /// }); +1270 /// +1271 /// // Spawn an endpoint and add the metrics to the registry. +1272 /// let endpoint = Endpoint::builder().bind().await?; +1273 /// registry.write().unwrap().register_all(endpoint.metrics()); +1274 /// +1275 /// // Wait for the metrics server to bind, then fetch the metrics via HTTP. +1276 /// tokio::time::sleep(Duration::from_millis(500)); +1277 /// let res = reqwest::get("http://localhost:9100/metrics") +1278 /// .await +1279 /// .context("get")? +1280 /// .text() +1281 /// .await +1282 /// .context("text")?; +1283 /// +1284 /// assert!(res.contains(r#"TYPE magicsock_recv_datagrams counter"#)); +1285 /// assert!(res.contains(r#"magicsock_recv_datagrams_total 0"#)); +1286 /// # metrics_task.abort(); +1287 /// # Ok(()) +1288 /// # } +1289 /// ``` +1290 /// +1291 /// [`Registry`]: iroh_metrics::Registry +1292 /// [`Registry::register_all`]: iroh_metrics::Registry::register_all +1293 /// [`Registry::sub_registry_with_label`]: iroh_metrics::Registry::sub_registry_with_label +1294 /// [`Registry::sub_registry_with_prefix`]: iroh_metrics::Registry::sub_registry_with_prefix +1295 /// [`encode_openmetrics_to_string`]: iroh_metrics::MetricsSource::encode_openmetrics_to_string +1296 /// [`MetricsGroup`]: iroh_metrics::MetricsGroup +1297 /// [`MetricsGroupSet`]: iroh_metrics::MetricsGroupSet +1298 #[cfg(feature = "metrics")] +1299 pub fn metrics(&self) -> &EndpointMetrics { +1300 &self.msock.metrics +1301 } +1302 +1303 // # Methods for less common state updates. +1304 +1305 /// Notifies the system of potential network changes. +1306 /// +1307 /// On many systems iroh is able to detect network changes by itself, however +1308 /// some systems like android do not expose this functionality to native code. +1309 /// Android does however provide this functionality to Java code. This +1310 /// function allows for notifying iroh of any potential network changes like +1311 /// this. +1312 /// +1313 /// Even when the network did not change, or iroh was already able to detect +1314 /// the network change itself, there is no harm in calling this function. +1315 pub async fn network_change(&self) { +1316 self.msock.network_change().await; +1317 } +1318 +1319 // # Methods to update internal state. +1320 +1321 /// Sets the initial user-defined data to be published in discovery services for this node. +1322 /// +1323 /// If the user-defined data passed to this function is different to the previous one, +1324 /// the endpoint will republish its node info to the configured discovery services. +1325 /// +1326 /// See also [`Builder::user_data_for_discovery`] for setting an initial value when +1327 /// building the endpoint. +1328 pub fn set_user_data_for_discovery(&self, user_data: Option<UserData>) { +1329 self.msock.set_user_data_for_discovery(user_data); +1330 } +1331 +1332 // # Methods for terminating the endpoint. +1333 +1334 /// Closes the QUIC endpoint and the magic socket. +1335 /// +1336 /// This will close any remaining open [`Connection`]s with an error code +1337 /// of `0` and an empty reason. Though it is best practice to close those +1338 /// explicitly before with a custom error code and reason. +1339 /// +1340 /// It will then make a best effort to wait for all close notifications to be +1341 /// acknowledged by the peers, re-transmitting them if needed. This ensures the +1342 /// peers are aware of the closed connections instead of having to wait for a timeout +1343 /// on the connection. Once all connections are closed or timed out, the future +1344 /// finishes. +1345 /// +1346 /// The maximum time-out that this future will wait for depends on QUIC transport +1347 /// configurations of non-drained connections at the time of calling, and their current +1348 /// estimates of round trip time. With default parameters and a conservative estimate +1349 /// of round trip time, this call's future should take 3 seconds to resolve in cases of +1350 /// bad connectivity or failed connections. In the usual case, this call's future should +1351 /// return much more quickly. +1352 /// +1353 /// It is highly recommended you *do* wait for this close call to finish, if possible. +1354 /// Not doing so will make connections that were still open while closing the endpoint +1355 /// time out on the remote end. Thus remote ends will assume connections to have failed +1356 /// even if all application data was transmitted successfully. +1357 /// +1358 /// Note: Someone used to closing TCP sockets might wonder why it is necessary to wait +1359 /// for timeouts when closing QUIC endpoints, while they don't have to do this for TCP +1360 /// sockets. This is due to QUIC and its acknowledgments being implemented in user-land, +1361 /// while TCP sockets usually get closed and drained by the operating system in the +1362 /// kernel during the "Time-Wait" period of the TCP socket. +1363 /// +1364 /// Be aware however that the underlying UDP sockets are only closed once all clones of +1365 /// the the respective [`Endpoint`] are dropped. +1366 pub async fn close(&self) { +1367 if self.is_closed() { +1368 return; +1369 } +1370 +1371 tracing::debug!("Connections closed"); +1372 self.msock.close().await; +1373 } +1374 +1375 /// Check if this endpoint is still alive, or already closed. +1376 pub fn is_closed(&self) -> bool { +1377 self.msock.is_closed() +1378 } +1379 +1380 // # Remaining private methods +1381 +1382 /// Return the quic mapped address for this `node_id` and possibly start discovery +1383 /// services if discovery is enabled on this magic endpoint. +1384 /// +1385 /// This will launch discovery in all cases except if: +1386 /// 1) we do not have discovery enabled +1387 /// 2) we have discovery enabled, but already have at least one verified, unexpired +1388 /// addresses for this `node_id` +1389 /// +1390 /// # Errors +1391 /// +1392 /// This method may fail if we have no way of dialing the node. This can occur if +1393 /// we were given no dialing information in the [`NodeAddr`] and no discovery +1394 /// services were configured or if discovery failed to fetch any dialing information. +1395 async fn get_mapping_addr_and_maybe_start_discovery( +1396 &self, +1397 node_addr: NodeAddr, +1398 ) -> Result<(NodeIdMappedAddr, Option<DiscoveryTask>), GetMappingAddressError> { +1399 let node_id = node_addr.node_id; +1400 +1401 // Only return a mapped addr if we have some way of dialing this node, in other +1402 // words, we have either a relay URL or at least one direct address. +1403 let addr = if self.msock.has_send_address(node_id) { +1404 self.msock.get_mapping_addr(node_id) +1405 } else { +1406 None +1407 }; +1408 match addr { +1409 Some(addr) => { +1410 // We have some way of dialing this node, but that doesn't actually mean +1411 // we can actually connect to any of these addresses. +1412 // Therefore, we will invoke the discovery service if we haven't received from the +1413 // endpoint on any of the existing paths recently. +1414 // If the user provided addresses in this connect call, we will add a delay +1415 // followed by a recheck before starting the discovery, to give the magicsocket a +1416 // chance to test the newly provided addresses. +1417 let delay = (!node_addr.is_empty()).then_some(DISCOVERY_WAIT_PERIOD); +1418 let discovery = DiscoveryTask::maybe_start_after_delay(self, node_id, delay) +1419 .ok() +1420 .flatten(); +1421 Ok((addr, discovery)) +1422 } +1423 +1424 None => { +1425 // We have no known addresses or relay URLs for this node. +1426 // So, we start a discovery task and wait for the first result to arrive, and +1427 // only then continue, because otherwise we wouldn't have any +1428 // path to the remote endpoint. +1429 let res = DiscoveryTask::start(self.clone(), node_id); +1430 let mut discovery = res.context(get_mapping_address_error::DiscoveryStartSnafu)?; +1431 discovery +1432 .first_arrived() +1433 .await +1434 .context(get_mapping_address_error::DiscoverSnafu)?; +1435 if let Some(addr) = self.msock.get_mapping_addr(node_id) { +1436 Ok((addr, Some(discovery))) +1437 } else { +1438 Err(get_mapping_address_error::NoAddressSnafu.build()) +1439 } +1440 } +1441 } +1442 } +1443 +1444 /// Returns a reference to the subscribers channel for discovery events. +1445 pub(crate) fn discovery_subscribers(&self) -> &DiscoverySubscribers { +1446 self.msock.discovery_subscribers() +1447 } +1448 +1449 #[cfg(test)] +1450 pub(crate) fn magic_sock(&self) -> Handle { +1451 self.msock.clone() +1452 } +1453 #[cfg(test)] +1454 pub(crate) fn endpoint(&self) -> &quinn::Endpoint { +1455 self.msock.endpoint() +1456 } +1457} +1458 +1459/// Options for the [`Endpoint::connect_with_opts`] function. +1460#[derive(Default, Debug, Clone)] +1461pub struct ConnectOptions { +1462 transport_config: Option<Arc<TransportConfig>>, +1463 additional_alpns: Vec<Vec<u8>>, +1464} +1465 +1466impl ConnectOptions { +1467 /// Initializes new connection options. +1468 /// +1469 /// By default, the connection will use the same options +1470 /// as [`Endpoint::connect`], e.g. a default [`TransportConfig`]. +1471 pub fn new() -> Self { +1472 Self::default() +1473 } +1474 +1475 /// Sets the QUIC transport config options for this connection. +1476 pub fn with_transport_config(mut self, transport_config: Arc<TransportConfig>) -> Self { +1477 self.transport_config = Some(transport_config); +1478 self +1479 } +1480 +1481 /// Sets [ALPN] identifiers that should be signaled as supported on connection, *in +1482 /// addition* to the main [ALPN] identifier used in [`Endpoint::connect_with_opts`]. +1483 /// +1484 /// This allows connecting to servers that may only support older versions of your +1485 /// protocol. In this case, you would add the older [ALPN] identifiers with this +1486 /// function. +1487 /// +1488 /// You'll know the final negotiated [ALPN] identifier once your connection was +1489 /// established using [`Connection::alpn`], or even slightly earlier in the +1490 /// handshake by using [`Connecting::alpn`]. +1491 /// The negotiated [ALPN] identifier may be any of the [ALPN] identifiers in this +1492 /// list or the main [ALPN] used in [`Endpoint::connect_with_opts`]. +1493 /// +1494 /// The [ALPN] identifier order on the connect side doesn't matter, since it's the +1495 /// accept side that determines the protocol. +1496 /// +1497 /// For setting the supported [ALPN] identifiers on the accept side, see the endpoint +1498 /// builder's [`Builder::alpns`] function. +1499 /// +1500 /// [ALPN]: https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation +1501 pub fn with_additional_alpns(mut self, alpns: Vec<Vec<u8>>) -> Self { +1502 self.additional_alpns = alpns; +1503 self +1504 } +1505} +1506 +1507/// Future produced by [`Endpoint::accept`]. +1508#[derive(derive_more::Debug)] +1509#[pin_project] +1510pub struct Accept<'a> { +1511 #[pin] +1512 #[debug("quinn::Accept")] +1513 inner: quinn::Accept<'a>, +1514 ep: Endpoint, +1515} +1516 +1517impl Future for Accept<'_> { +1518 type Output = Option<Incoming>; +1519 +1520 fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { +1521 let this = self.project(); +1522 match this.inner.poll(cx) { +1523 Poll::Pending => Poll::Pending, +1524 Poll::Ready(None) => Poll::Ready(None), +1525 Poll::Ready(Some(inner)) => Poll::Ready(Some(Incoming { +1526 inner, +1527 ep: this.ep.clone(), +1528 })), +1529 } +1530 } +1531} +1532 +1533/// An incoming connection for which the server has not yet begun its parts of the +1534/// handshake. +1535#[derive(Debug)] +1536pub struct Incoming { +1537 inner: quinn::Incoming, +1538 ep: Endpoint, +1539} +1540 +1541impl Incoming { +1542 /// Attempts to accept this incoming connection (an error may still occur). +1543 /// +1544 /// Errors occurring here are likely not caused by the application or remote. The QUIC +1545 /// connection listens on a normal UDP socket and any reachable network endpoint can +1546 /// send datagrams to it, solicited or not. Even if the first few bytes look like a +1547 /// QUIC packet, it might not even be a QUIC packet that is being received. +1548 /// +1549 /// Thus it is common to simply log the errors here and accept them as something which +1550 /// can happen. +1551 pub fn accept(self) -> Result<Connecting, ConnectionError> { +1552 self.inner.accept().map(|conn| Connecting { +1553 inner: conn, +1554 ep: self.ep, +1555 remote_node_id: None, +1556 _discovery_drop_guard: None, +1557 }) +1558 } +1559 +1560 /// Accepts this incoming connection using a custom configuration. +1561 /// +1562 /// See [`accept()`] for more details. +1563 /// +1564 /// [`accept()`]: Incoming::accept +1565 pub fn accept_with( +1566 self, +1567 server_config: Arc<ServerConfig>, +1568 ) -> Result<Connecting, ConnectionError> { +1569 self.inner +1570 .accept_with(server_config) +1571 .map(|conn| Connecting { +1572 inner: conn, +1573 ep: self.ep, +1574 remote_node_id: None, +1575 _discovery_drop_guard: None, +1576 }) +1577 } +1578 +1579 /// Rejects this incoming connection attempt. +1580 pub fn refuse(self) { +1581 self.inner.refuse() +1582 } +1583 +1584 /// Responds with a retry packet. +1585 /// +1586 /// This requires the client to retry with address validation. +1587 /// +1588 /// Errors if `remote_address_validated()` is true. +1589 #[allow(clippy::result_large_err)] +1590 pub fn retry(self) -> Result<(), RetryError> { +1591 self.inner.retry() +1592 } +1593 +1594 /// Ignores this incoming connection attempt, not sending any packet in response. +1595 pub fn ignore(self) { +1596 self.inner.ignore() +1597 } +1598 +1599 /// Returns the local IP address which was used when the peer established the +1600 /// connection. +1601 pub fn local_ip(&self) -> Option<IpAddr> { +1602 self.inner.local_ip() +1603 } +1604 +1605 /// Returns the peer's UDP address. +1606 pub fn remote_address(&self) -> SocketAddr { +1607 self.inner.remote_address() +1608 } +1609 +1610 /// Whether the socket address that is initiating this connection has been validated. +1611 /// +1612 /// This means that the sender of the initial packet has proved that they can receive +1613 /// traffic sent to `self.remote_address()`. +1614 pub fn remote_address_validated(&self) -> bool { +1615 self.inner.remote_address_validated() +1616 } +1617} +1618 +1619impl IntoFuture for Incoming { +1620 type Output = Result<Connection, ConnectionError>; +1621 type IntoFuture = IncomingFuture; +1622 +1623 fn into_future(self) -> Self::IntoFuture { +1624 IncomingFuture { +1625 inner: self.inner.into_future(), +1626 ep: self.ep, +1627 } +1628 } +1629} +1630 +1631/// Adaptor to let [`Incoming`] be `await`ed like a [`Connecting`]. +1632#[derive(Debug)] +1633#[pin_project] +1634pub struct IncomingFuture { +1635 #[pin] +1636 inner: quinn::IncomingFuture, +1637 ep: Endpoint, +1638} +1639 +1640impl Future for IncomingFuture { +1641 type Output = Result<Connection, ConnectionError>; +1642 +1643 fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { +1644 let this = self.project(); +1645 match this.inner.poll(cx) { +1646 Poll::Pending => Poll::Pending, +1647 Poll::Ready(Err(err)) => Poll::Ready(Err(err)), +1648 Poll::Ready(Ok(inner)) => { +1649 let conn = Connection { inner }; +1650 try_send_rtt_msg(&conn, this.ep, None); +1651 Poll::Ready(Ok(conn)) +1652 } +1653 } +1654 } +1655} +1656 +1657/// In-progress connection attempt future +1658#[derive(derive_more::Debug)] +1659#[pin_project] +1660pub struct Connecting { +1661 #[pin] +1662 inner: quinn::Connecting, +1663 ep: Endpoint, +1664 remote_node_id: Option<NodeId>, +1665 /// We run discovery as long as we haven't established a connection yet. +1666 #[debug("Option<DiscoveryTask>")] +1667 _discovery_drop_guard: Option<DiscoveryTask>, +1668} +1669 +1670#[allow(missing_docs)] +1671#[common_fields({ +1672 backtrace: Option<snafu::Backtrace>, +1673 #[snafu(implicit)] +1674 span_trace: n0_snafu::SpanTrace, +1675})] +1676#[derive(Debug, Snafu)] +1677#[non_exhaustive] +1678pub enum AlpnError { +1679 #[snafu(transparent)] +1680 ConnectionError { source: ConnectionError }, +1681 #[snafu(display("No ALPN available"))] +1682 Unavailable {}, +1683 #[snafu(display("Unknown handshake type"))] +1684 UnknownHandshake {}, +1685} +1686 +1687impl Connecting { +1688 /// Converts this [`Connecting`] into a 0-RTT or 0.5-RTT connection at the cost of weakened +1689 /// security. +1690 /// +1691 /// Returns `Ok` immediately if the local endpoint is able to attempt sending 0/0.5-RTT data. +1692 /// If so, the returned [`Connection`] can be used to send application data without waiting for +1693 /// the rest of the handshake to complete, at the cost of weakened cryptographic security +1694 /// guarantees. The returned [`ZeroRttAccepted`] future resolves when the handshake does +1695 /// complete, at which point subsequently opened streams and written data will have full +1696 /// cryptographic protection. +1697 /// +1698 /// Once the [`ZeroRttAccepted`] future completed, a full handshake has been carried through +1699 /// and any data sent and any streams opened on the [`Connection`] will operate with the same +1700 /// security as on normal 1-RTT connections. +1701 /// +1702 /// ## Outgoing +1703 /// +1704 /// For outgoing connections, the initial attempt to convert to a [`Connection`] which sends +1705 /// 0-RTT data will attempt to resume a previous TLS session. However, **the remote endpoint +1706 /// may not actually _accept_ the 0-RTT data**--yet still accept the connection attempt in +1707 /// general. This possibility is conveyed through the [`ZeroRttAccepted`] future--when the +1708 /// handshake completes, it resolves to true if the 0-RTT data was accepted and false if it was +1709 /// rejected. If it was rejected, the existence of streams opened and other application data +1710 /// sent prior to the handshake completing will not be conveyed to the remote application, and +1711 /// local operations on them will return `ZeroRttRejected` errors. +1712 /// +1713 /// A server may reject 0-RTT data at its discretion, but accepting 0-RTT data requires the +1714 /// relevant resumption state to be stored in the server, which servers may limit or lose for +1715 /// various reasons including not persisting resumption state across server restarts. +1716 /// +1717 /// ## Incoming +1718 /// +1719 /// For incoming connections, conversion to 0.5-RTT will always fully succeed. `into_0rtt` will +1720 /// always return `Ok` and the [`ZeroRttAccepted`] will always resolve to true. +1721 /// +1722 /// ## Security +1723 /// +1724 /// On outgoing connections, this enables transmission of 0-RTT data, which is vulnerable to +1725 /// replay attacks, and should therefore never invoke non-idempotent operations. +1726 /// +1727 /// On incoming connections, this enables transmission of 0.5-RTT data, which may be sent +1728 /// before TLS client authentication has occurred, and should therefore not be used to send +1729 /// data for which client authentication is being used. +1730 /// +1731 /// You can use [`RecvStream::is_0rtt`] to check whether a stream has been opened in 0-RTT +1732 /// and thus whether parts of the stream are operating under this reduced security level. +1733 #[allow(clippy::result_large_err)] +1734 pub fn into_0rtt(self) -> Result<(Connection, ZeroRttAccepted), Self> { +1735 match self.inner.into_0rtt() { +1736 Ok((inner, zrtt_accepted)) => { +1737 let conn = Connection { inner }; +1738 let zrtt_accepted = ZeroRttAccepted { +1739 inner: zrtt_accepted, +1740 _discovery_drop_guard: self._discovery_drop_guard, +1741 }; +1742 // This call is why `self.remote_node_id` was introduced. +1743 // When we `Connecting::into_0rtt`, then we don't yet have `handshake_data` +1744 // in our `Connection`, thus `try_send_rtt_msg` won't be able to pick up +1745 // `Connection::remote_node_id`. +1746 // Instead, we provide `self.remote_node_id` here - we know it in advance, +1747 // after all. +1748 try_send_rtt_msg(&conn, &self.ep, self.remote_node_id); +1749 Ok((conn, zrtt_accepted)) +1750 } +1751 Err(inner) => Err(Self { +1752 inner, +1753 ep: self.ep, +1754 remote_node_id: self.remote_node_id, +1755 _discovery_drop_guard: self._discovery_drop_guard, +1756 }), +1757 } +1758 } +1759 +1760 /// Parameters negotiated during the handshake +1761 pub async fn handshake_data(&mut self) -> Result<Box<dyn Any>, ConnectionError> { +1762 self.inner.handshake_data().await +1763 } +1764 +1765 /// Extracts the ALPN protocol from the peer's handshake data. +1766 pub async fn alpn(&mut self) -> Result<Vec<u8>, AlpnError> { +1767 let data = self.handshake_data().await?; +1768 match data.downcast::<quinn::crypto::rustls::HandshakeData>() { +1769 Ok(data) => match data.protocol { +1770 Some(protocol) => Ok(protocol), +1771 None => Err(UnavailableSnafu.build()), +1772 }, +1773 Err(_) => Err(UnknownHandshakeSnafu.build()), +1774 } +1775 } +1776} +1777 +1778impl Future for Connecting { +1779 type Output = Result<Connection, ConnectionError>; +1780 +1781 fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { +1782 let this = self.project(); +1783 match this.inner.poll(cx) { +1784 Poll::Pending => Poll::Pending, +1785 Poll::Ready(Err(err)) => Poll::Ready(Err(err)), +1786 Poll::Ready(Ok(inner)) => { +1787 let conn = Connection { inner }; +1788 try_send_rtt_msg(&conn, this.ep, *this.remote_node_id); +1789 Poll::Ready(Ok(conn)) +1790 } +1791 } +1792 } +1793} +1794 +1795/// Future that completes when a connection is fully established. +1796/// +1797/// For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting +1798/// value is meaningless. +1799#[derive(derive_more::Debug)] +1800#[debug("ZeroRttAccepted")] +1801pub struct ZeroRttAccepted { +1802 inner: quinn::ZeroRttAccepted, +1803 /// When we call `Connecting::into_0rtt`, we don't want to stop discovery, so we transfer the task +1804 /// to this future. +1805 /// When `quinn::ZeroRttAccepted` resolves, we've successfully received data from the remote. +1806 /// Thus, that's the right time to drop discovery to preserve the behaviour similar to +1807 /// `Connecting` -> `Connection` without 0-RTT. +1808 /// Should we eventually decide to keep the discovery task alive for the duration of the whole +1809 /// `Connection`, then this task should be transferred to the `Connection` instead of here. +1810 _discovery_drop_guard: Option<DiscoveryTask>, +1811} +1812 +1813impl Future for ZeroRttAccepted { +1814 type Output = bool; +1815 fn poll(mut self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll<Self::Output> { +1816 Pin::new(&mut self.inner).poll(cx) +1817 } +1818} +1819 +1820/// A QUIC connection. +1821/// +1822/// If all references to a connection (including every clone of the Connection handle, +1823/// streams of incoming streams, and the various stream types) have been dropped, then the +1824/// connection will be automatically closed with an error_code of 0 and an empty reason. You +1825/// can also close the connection explicitly by calling [`Connection::close`]. +1826/// +1827/// Closing the connection immediately abandons efforts to deliver data to the peer. Upon +1828/// receiving CONNECTION_CLOSE the peer may drop any stream data not yet delivered to the +1829/// application. [`Connection::close`] describes in more detail how to gracefully close a +1830/// connection without losing application data. +1831/// +1832/// May be cloned to obtain another handle to the same connection. +1833#[derive(Debug, Clone)] +1834pub struct Connection { +1835 inner: quinn::Connection, +1836} +1837 +1838#[allow(missing_docs)] +1839#[derive(Debug, Snafu)] +1840#[snafu(display("Protocol error: no remote id available"))] +1841pub struct RemoteNodeIdError { +1842 backtrace: Option<snafu::Backtrace>, +1843} +1844 +1845impl Connection { +1846 /// Initiates a new outgoing unidirectional stream. +1847 /// +1848 /// Streams are cheap and instantaneous to open unless blocked by flow control. As a +1849 /// consequence, the peer won’t be notified that a stream has been opened until the +1850 /// stream is actually used. +1851 #[inline] +1852 pub fn open_uni(&self) -> OpenUni<'_> { +1853 self.inner.open_uni() +1854 } +1855 +1856 /// Initiates a new outgoing bidirectional stream. +1857 /// +1858 /// Streams are cheap and instantaneous to open unless blocked by flow control. As a +1859 /// consequence, the peer won't be notified that a stream has been opened until the +1860 /// stream is actually used. Calling [`open_bi`] then waiting on the [`RecvStream`] +1861 /// without writing anything to [`SendStream`] will never succeed. +1862 /// +1863 /// [`open_bi`]: Connection::open_bi +1864 #[inline] +1865 pub fn open_bi(&self) -> OpenBi<'_> { +1866 self.inner.open_bi() +1867 } +1868 +1869 /// Accepts the next incoming uni-directional stream. +1870 #[inline] +1871 pub fn accept_uni(&self) -> AcceptUni<'_> { +1872 self.inner.accept_uni() +1873 } +1874 +1875 /// Accept the next incoming bidirectional stream. +1876 /// +1877 /// **Important Note**: The peer that calls [`open_bi`] must write to its [`SendStream`] +1878 /// before the peer `Connection` is able to accept the stream using +1879 /// `accept_bi()`. Calling [`open_bi`] then waiting on the [`RecvStream`] without +1880 /// writing anything to the connected [`SendStream`] will never succeed. +1881 /// +1882 /// [`open_bi`]: Connection::open_bi +1883 #[inline] +1884 pub fn accept_bi(&self) -> AcceptBi<'_> { +1885 self.inner.accept_bi() +1886 } +1887 +1888 /// Receives an application datagram. +1889 #[inline] +1890 pub fn read_datagram(&self) -> ReadDatagram<'_> { +1891 self.inner.read_datagram() +1892 } +1893 +1894 /// Wait for the connection to be closed for any reason. +1895 /// +1896 /// Despite the return type's name, closed connections are often not an error condition +1897 /// at the application layer. Cases that might be routine include +1898 /// [`ConnectionError::LocallyClosed`] and [`ConnectionError::ApplicationClosed`]. +1899 #[inline] +1900 pub async fn closed(&self) -> ConnectionError { +1901 self.inner.closed().await +1902 } +1903 +1904 /// If the connection is closed, the reason why. +1905 /// +1906 /// Returns `None` if the connection is still open. +1907 #[inline] +1908 pub fn close_reason(&self) -> Option<ConnectionError> { +1909 self.inner.close_reason() +1910 } +1911 +1912 /// Closes the connection immediately. +1913 /// +1914 /// Pending operations will fail immediately with [`ConnectionError::LocallyClosed`]. No +1915 /// more data is sent to the peer and the peer may drop buffered data upon receiving the +1916 /// CONNECTION_CLOSE frame. +1917 /// +1918 /// `error_code` and `reason` are not interpreted, and are provided directly to the +1919 /// peer. +1920 /// +1921 /// `reason` will be truncated to fit in a single packet with overhead; to improve odds +1922 /// that it is preserved in full, it should be kept under 1KiB. +1923 /// +1924 /// # Gracefully closing a connection +1925 /// +1926 /// Only the peer last receiving application data can be certain that all data is +1927 /// delivered. The only reliable action it can then take is to close the connection, +1928 /// potentially with a custom error code. The delivery of the final CONNECTION_CLOSE +1929 /// frame is very likely if both endpoints stay online long enough, calling +1930 /// [`Endpoint::close`] will wait to provide sufficient time. Otherwise, the remote peer +1931 /// will time out the connection, provided that the idle timeout is not disabled. +1932 /// +1933 /// The sending side can not guarantee all stream data is delivered to the remote +1934 /// application. It only knows the data is delivered to the QUIC stack of the remote +1935 /// endpoint. Once the local side sends a CONNECTION_CLOSE frame in response to calling +1936 /// [`close`] the remote endpoint may drop any data it received but is as yet +1937 /// undelivered to the application, including data that was acknowledged as received to +1938 /// the local endpoint. +1939 /// +1940 /// [`close`]: Connection::close +1941 #[inline] +1942 pub fn close(&self, error_code: VarInt, reason: &[u8]) { +1943 self.inner.close(error_code, reason) +1944 } +1945 +1946 /// Transmits `data` as an unreliable, unordered application datagram. +1947 /// +1948 /// Application datagrams are a low-level primitive. They may be lost or delivered out +1949 /// of order, and `data` must both fit inside a single QUIC packet and be smaller than +1950 /// the maximum dictated by the peer. +1951 #[inline] +1952 pub fn send_datagram(&self, data: bytes::Bytes) -> Result<(), SendDatagramError> { +1953 self.inner.send_datagram(data) +1954 } +1955 +1956 // TODO: It seems `SendDatagram` is not yet exposed by quinn. This has been fixed +1957 // upstream and will be in the next release. +1958 // /// Transmits `data` as an unreliable, unordered application datagram +1959 // /// +1960 // /// Unlike [`send_datagram()`], this method will wait for buffer space during congestion +1961 // /// conditions, which effectively prioritizes old datagrams over new datagrams. +1962 // /// +1963 // /// See [`send_datagram()`] for details. +1964 // /// +1965 // /// [`send_datagram()`]: Connection::send_datagram +1966 // #[inline] +1967 // pub fn send_datagram_wait(&self, data: bytes::Bytes) -> SendDatagram<'_> { +1968 // self.inner.send_datagram_wait(data) +1969 // } +1970 +1971 /// Computes the maximum size of datagrams that may be passed to [`send_datagram`]. +1972 /// +1973 /// Returns `None` if datagrams are unsupported by the peer or disabled locally. +1974 /// +1975 /// This may change over the lifetime of a connection according to variation in the path +1976 /// MTU estimate. The peer can also enforce an arbitrarily small fixed limit, but if the +1977 /// peer's limit is large this is guaranteed to be a little over a kilobyte at minimum. +1978 /// +1979 /// Not necessarily the maximum size of received datagrams. +1980 /// +1981 /// [`send_datagram`]: Self::send_datagram +1982 #[inline] +1983 pub fn max_datagram_size(&self) -> Option<usize> { +1984 self.inner.max_datagram_size() +1985 } +1986 +1987 /// Bytes available in the outgoing datagram buffer. +1988 /// +1989 /// When greater than zero, calling [`send_datagram`] with a +1990 /// datagram of at most this size is guaranteed not to cause older datagrams to be +1991 /// dropped. +1992 /// +1993 /// [`send_datagram`]: Self::send_datagram +1994 #[inline] +1995 pub fn datagram_send_buffer_space(&self) -> usize { +1996 self.inner.datagram_send_buffer_space() +1997 } +1998 +1999 /// Current best estimate of this connection's latency (round-trip-time). +2000 #[inline] +2001 pub fn rtt(&self) -> Duration { +2002 self.inner.rtt() +2003 } +2004 +2005 /// Returns connection statistics. +2006 #[inline] +2007 pub fn stats(&self) -> ConnectionStats { +2008 self.inner.stats() +2009 } +2010 +2011 /// Current state of the congestion control algorithm, for debugging purposes. +2012 #[inline] +2013 pub fn congestion_state(&self) -> Box<dyn quinn_proto::congestion::Controller> { +2014 self.inner.congestion_state() +2015 } +2016 +2017 /// Parameters negotiated during the handshake. +2018 /// +2019 /// Guaranteed to return `Some` on fully established connections or after +2020 /// [`Connecting::handshake_data()`] succeeds. See that method's documentations for +2021 /// details on the returned value. +2022 /// +2023 /// [`Connection::handshake_data()`]: crate::endpoint::Connecting::handshake_data +2024 #[inline] +2025 pub fn handshake_data(&self) -> Option<Box<dyn Any>> { +2026 self.inner.handshake_data() +2027 } +2028 +2029 /// Extracts the ALPN protocol from the peer's handshake data. +2030 pub fn alpn(&self) -> Option<Vec<u8>> { +2031 let data = self.handshake_data()?; +2032 match data.downcast::<quinn::crypto::rustls::HandshakeData>() { +2033 Ok(data) => data.protocol, +2034 Err(_) => None, +2035 } +2036 } +2037 +2038 /// Cryptographic identity of the peer. +2039 /// +2040 /// The dynamic type returned is determined by the configured [`Session`]. For the +2041 /// default `rustls` session, the return value can be [`downcast`] to a +2042 /// <code>Vec<[rustls::pki_types::CertificateDer]></code> +2043 /// +2044 /// [`Session`]: quinn_proto::crypto::Session +2045 /// [`downcast`]: Box::downcast +2046 #[inline] +2047 pub fn peer_identity(&self) -> Option<Box<dyn Any>> { +2048 self.inner.peer_identity() +2049 } +2050 +2051 /// Returns the [`NodeId`] from the peer's TLS certificate. +2052 /// +2053 /// The [`PublicKey`] of a node is also known as a [`NodeId`]. This [`PublicKey`] is +2054 /// included in the TLS certificate presented during the handshake when connecting. +2055 /// This function allows you to get the [`NodeId`] of the remote node of this +2056 /// connection. +2057 /// +2058 /// [`PublicKey`]: iroh_base::PublicKey +2059 // TODO: Would be nice if this could be infallible. +2060 pub fn remote_node_id(&self) -> Result<NodeId, RemoteNodeIdError> { +2061 let data = self.peer_identity(); +2062 match data { +2063 None => { +2064 warn!("no peer certificate found"); +2065 Err(RemoteNodeIdSnafu.build()) +2066 } +2067 Some(data) => match data.downcast::<Vec<rustls::pki_types::CertificateDer>>() { +2068 Ok(certs) => { +2069 if certs.len() != 1 { +2070 warn!( +2071 "expected a single peer certificate, but {} found", +2072 certs.len() +2073 ); +2074 return Err(RemoteNodeIdSnafu.build()); +2075 } +2076 +2077 let peer_id = VerifyingKey::from_public_key_der(&certs[0]) +2078 .map_err(|_| RemoteNodeIdSnafu.build())? +2079 .into(); +2080 Ok(peer_id) +2081 } +2082 Err(err) => { +2083 warn!("invalid peer certificate: {:?}", err); +2084 Err(RemoteNodeIdSnafu.build()) +2085 } +2086 }, +2087 } +2088 } +2089 +2090 /// A stable identifier for this connection. +2091 /// +2092 /// Peer addresses and connection IDs can change, but this value will remain fixed for +2093 /// the lifetime of the connection. +2094 #[inline] +2095 pub fn stable_id(&self) -> usize { +2096 self.inner.stable_id() +2097 } +2098 +2099 /// Derives keying material from this connection's TLS session secrets. +2100 /// +2101 /// When both peers call this method with the same `label` and `context` +2102 /// arguments and `output` buffers of equal length, they will get the +2103 /// same sequence of bytes in `output`. These bytes are cryptographically +2104 /// strong and pseudorandom, and are suitable for use as keying material. +2105 /// +2106 /// See [RFC5705](https://tools.ietf.org/html/rfc5705) for more information. +2107 #[inline] +2108 pub fn export_keying_material( +2109 &self, +2110 output: &mut [u8], +2111 label: &[u8], +2112 context: &[u8], +2113 ) -> Result<(), quinn_proto::crypto::ExportKeyingMaterialError> { +2114 self.inner.export_keying_material(output, label, context) +2115 } +2116 +2117 /// Modifies the number of unidirectional streams that may be concurrently opened. +2118 /// +2119 /// No streams may be opened by the peer unless fewer than `count` are already +2120 /// open. Large `count`s increase both minimum and worst-case memory consumption. +2121 #[inline] +2122 pub fn set_max_concurrent_uni_streams(&self, count: VarInt) { +2123 self.inner.set_max_concurrent_uni_streams(count) +2124 } +2125 +2126 /// See [`quinn_proto::TransportConfig::receive_window`]. +2127 #[inline] +2128 pub fn set_receive_window(&self, receive_window: VarInt) { +2129 self.inner.set_receive_window(receive_window) +2130 } +2131 +2132 /// Modifies the number of bidirectional streams that may be concurrently opened. +2133 /// +2134 /// No streams may be opened by the peer unless fewer than `count` are already +2135 /// open. Large `count`s increase both minimum and worst-case memory consumption. +2136 #[inline] +2137 pub fn set_max_concurrent_bi_streams(&self, count: VarInt) { +2138 self.inner.set_max_concurrent_bi_streams(count) +2139 } +2140} +2141 +2142/// Try send a message to the rtt-actor. +2143/// +2144/// If we can't notify the actor that will impact performance a little, but we can still +2145/// function. +2146fn try_send_rtt_msg(conn: &Connection, magic_ep: &Endpoint, remote_node_id: Option<NodeId>) { +2147 // If we can't notify the rtt-actor that's not great but not critical. +2148 let Some(node_id) = remote_node_id.or_else(|| conn.remote_node_id().ok()) else { +2149 warn!(?conn, "failed to get remote node id"); +2150 return; +2151 }; +2152 let Some(conn_type_changes) = magic_ep.conn_type(node_id) else { +2153 warn!(?conn, "failed to create conn_type stream"); +2154 return; +2155 }; +2156 let rtt_msg = RttMessage::NewConnection { +2157 connection: conn.inner.weak_handle(), +2158 conn_type_changes: conn_type_changes.stream(), +2159 node_id, +2160 }; +2161 if let Err(err) = magic_ep.rtt_actor.msg_tx.try_send(rtt_msg) { +2162 warn!(?conn, "rtt-actor not reachable: {err:#}"); +2163 } +2164} +2165 +2166/// Read a proxy url from the environment, in this order +2167/// +2168/// - `HTTP_PROXY` +2169/// - `http_proxy` +2170/// - `HTTPS_PROXY` +2171/// - `https_proxy` +2172fn proxy_url_from_env() -> Option<Url> { +2173 if let Some(url) = std::env::var("HTTP_PROXY") +2174 .ok() +2175 .and_then(|s| s.parse::<Url>().ok()) +2176 { +2177 if is_cgi() { +2178 warn!("HTTP_PROXY environment variable ignored in CGI"); +2179 } else { +2180 return Some(url); +2181 } +2182 } +2183 if let Some(url) = std::env::var("http_proxy") +2184 .ok() +2185 .and_then(|s| s.parse::<Url>().ok()) +2186 { +2187 return Some(url); +2188 } +2189 if let Some(url) = std::env::var("HTTPS_PROXY") +2190 .ok() +2191 .and_then(|s| s.parse::<Url>().ok()) +2192 { +2193 return Some(url); +2194 } +2195 if let Some(url) = std::env::var("https_proxy") +2196 .ok() +2197 .and_then(|s| s.parse::<Url>().ok()) +2198 { +2199 return Some(url); +2200 } +2201 +2202 None +2203} +2204 +2205/// Configuration of the relay servers for an [`Endpoint`]. +2206#[derive(Debug, Clone, PartialEq, Eq)] +2207pub enum RelayMode { +2208 /// Disable relay servers completely. +2209 Disabled, +2210 /// Use the default relay map, with production relay servers from n0. +2211 /// +2212 /// See [`crate::defaults::prod`] for the severs used. +2213 Default, +2214 /// Use the staging relay servers from n0. +2215 Staging, +2216 /// Use a custom relay map. +2217 Custom(RelayMap), +2218} +2219 +2220impl RelayMode { +2221 /// Returns the relay map for this mode. +2222 pub fn relay_map(&self) -> RelayMap { +2223 match self { +2224 RelayMode::Disabled => RelayMap::empty(), +2225 RelayMode::Default => crate::defaults::prod::default_relay_map(), +2226 RelayMode::Staging => crate::defaults::staging::default_relay_map(), +2227 RelayMode::Custom(relay_map) => relay_map.clone(), +2228 } +2229 } +2230} +2231 +2232/// Environment variable to force the use of staging relays. +2233pub const ENV_FORCE_STAGING_RELAYS: &str = "IROH_FORCE_STAGING_RELAYS"; +2234 +2235/// Returns `true` if the use of staging relays is forced. +2236pub fn force_staging_infra() -> bool { +2237 matches!(std::env::var(ENV_FORCE_STAGING_RELAYS), Ok(value) if !value.is_empty()) +2238} +2239 +2240/// Returns the default relay mode. +2241/// +2242/// If the `IROH_FORCE_STAGING_RELAYS` environment variable is non empty, it will return `RelayMode::Staging`. +2243/// Otherwise, it will return `RelayMode::Default`. +2244pub fn default_relay_mode() -> RelayMode { +2245 // Use staging in testing +2246 match force_staging_infra() { +2247 true => RelayMode::Staging, +2248 false => RelayMode::Default, +2249 } +2250} +2251 +2252/// Check if we are being executed in a CGI context. +2253/// +2254/// If so, a malicious client can send the `Proxy:` header, and it will +2255/// be in the `HTTP_PROXY` env var. So we don't use it :) +2256fn is_cgi() -> bool { +2257 std::env::var_os("REQUEST_METHOD").is_some() +2258} +2259 +2260// TODO: These tests could still be flaky, lets fix that: +2261// https://github.com/n0-computer/iroh/issues/1183 +2262#[cfg(test)] +2263mod tests { +2264 use std::{ +2265 net::SocketAddr, +2266 time::{Duration, Instant}, +2267 }; +2268 +2269 use iroh_base::{NodeAddr, NodeId, SecretKey}; +2270 use n0_future::{BufferedStreamExt, StreamExt, stream, task::AbortOnDropHandle}; +2271 use n0_snafu::{Error, Result, ResultExt}; +2272 use n0_watcher::Watcher; +2273 use quinn::ConnectionError; +2274 use rand::SeedableRng; +2275 use tracing::{Instrument, error_span, info, info_span}; +2276 use tracing_test::traced_test; +2277 +2278 use super::Endpoint; +2279 use crate::{ +2280 RelayMode, +2281 discovery::static_provider::StaticProvider, +2282 endpoint::{ConnectOptions, Connection, ConnectionType, RemoteInfo}, +2283 protocol::{AcceptError, ProtocolHandler, Router}, +2284 test_utils::{run_relay_server, run_relay_server_with}, +2285 }; +2286 +2287 const TEST_ALPN: &[u8] = b"n0/iroh/test"; +2288 +2289 #[tokio::test] +2290 #[traced_test] +2291 async fn test_connect_self() -> Result { +2292 let ep = Endpoint::builder() +2293 .alpns(vec![TEST_ALPN.to_vec()]) +2294 .bind() +2295 .await +2296 .unwrap(); +2297 let my_addr = ep.node_addr().initialized().await; +2298 let res = ep.connect(my_addr.clone(), TEST_ALPN).await; +2299 assert!(res.is_err()); +2300 let err = res.err().unwrap(); +2301 assert!(err.to_string().starts_with("Connecting to ourself")); +2302 +2303 let res = ep.add_node_addr(my_addr); +2304 assert!(res.is_err()); +2305 let err = res.err().unwrap(); +2306 assert!(err.to_string().starts_with("Adding our own address")); +2307 Ok(()) +2308 } +2309 +2310 #[tokio::test] +2311 #[traced_test] +2312 async fn endpoint_connect_close() -> Result { +2313 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2314 let (relay_map, relay_url, _guard) = run_relay_server().await?; +2315 let server_secret_key = SecretKey::generate(&mut rng); +2316 let server_peer_id = server_secret_key.public(); +2317 +2318 // Wait for the endpoint to be started to make sure it's up before clients try to connect +2319 let ep = Endpoint::builder() +2320 .secret_key(server_secret_key) +2321 .alpns(vec![TEST_ALPN.to_vec()]) +2322 .relay_mode(RelayMode::Custom(relay_map.clone())) +2323 .insecure_skip_relay_cert_verify(true) +2324 .bind() +2325 .await?; +2326 // Wait for the endpoint to be reachable via relay +2327 ep.home_relay().initialized().await; +2328 +2329 let server = tokio::spawn( +2330 async move { +2331 info!("accepting connection"); +2332 let incoming = ep.accept().await.e()?; +2333 let conn = incoming.await.e()?; +2334 let mut stream = conn.accept_uni().await.e()?; +2335 let mut buf = [0u8; 5]; +2336 stream.read_exact(&mut buf).await.e()?; +2337 info!("Accepted 1 stream, received {buf:?}. Closing now."); +2338 // close the connection +2339 conn.close(7u8.into(), b"bye"); +2340 +2341 let res = conn.accept_uni().await; +2342 assert_eq!(res.unwrap_err(), quinn::ConnectionError::LocallyClosed); +2343 +2344 let res = stream.read_to_end(10).await; +2345 assert_eq!( +2346 res.unwrap_err(), +2347 quinn::ReadToEndError::Read(quinn::ReadError::ConnectionLost( +2348 quinn::ConnectionError::LocallyClosed +2349 )) +2350 ); +2351 info!("server test completed"); +2352 Ok::<_, Error>(()) +2353 } +2354 .instrument(info_span!("test-server")), +2355 ); +2356 +2357 let client = tokio::spawn( +2358 async move { +2359 let ep = Endpoint::builder() +2360 .alpns(vec![TEST_ALPN.to_vec()]) +2361 .relay_mode(RelayMode::Custom(relay_map)) +2362 .insecure_skip_relay_cert_verify(true) +2363 .bind() +2364 .await?; +2365 info!("client connecting"); +2366 let node_addr = NodeAddr::new(server_peer_id).with_relay_url(relay_url); +2367 let conn = ep.connect(node_addr, TEST_ALPN).await?; +2368 let mut stream = conn.open_uni().await.e()?; +2369 +2370 // First write is accepted by server. We need this bit of synchronisation +2371 // because if the server closes after simply accepting the connection we can +2372 // not be sure our .open_uni() call would succeed as it may already receive +2373 // the error. +2374 stream.write_all(b"hello").await.e()?; +2375 +2376 info!("waiting for closed"); +2377 // Remote now closes the connection, we should see an error sometime soon. +2378 let err = conn.closed().await; +2379 let expected_err = +2380 quinn::ConnectionError::ApplicationClosed(quinn::ApplicationClose { +2381 error_code: 7u8.into(), +2382 reason: b"bye".to_vec().into(), +2383 }); +2384 assert_eq!(err, expected_err); +2385 +2386 info!("opening new - expect it to fail"); +2387 let res = conn.open_uni().await; +2388 assert_eq!(res.unwrap_err(), expected_err); +2389 info!("client test completed"); +2390 Ok::<_, Error>(()) +2391 } +2392 .instrument(info_span!("test-client")), +2393 ); +2394 +2395 let (server, client) = tokio::time::timeout( +2396 Duration::from_secs(30), +2397 n0_future::future::zip(server, client), +2398 ) +2399 .await +2400 .e()?; +2401 server.e()??; +2402 client.e()??; +2403 Ok(()) +2404 } +2405 +2406 /// Test that peers are properly restored +2407 #[tokio::test] +2408 #[traced_test] +2409 async fn restore_peers() -> Result { +2410 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2411 let secret_key = SecretKey::generate(&mut rng); +2412 +2413 /// Create an endpoint for the test. +2414 async fn new_endpoint( +2415 secret_key: SecretKey, +2416 nodes: Option<Vec<NodeAddr>>, +2417 ) -> Result<Endpoint> { +2418 let mut transport_config = quinn::TransportConfig::default(); +2419 transport_config.max_idle_timeout(Some(Duration::from_secs(10).try_into().unwrap())); +2420 +2421 let mut builder = Endpoint::builder() +2422 .secret_key(secret_key.clone()) +2423 .transport_config(transport_config); +2424 if let Some(nodes) = nodes { +2425 builder = builder.known_nodes(nodes); +2426 } +2427 Ok(builder.alpns(vec![TEST_ALPN.to_vec()]).bind().await?) +2428 } +2429 +2430 // create the peer that will be added to the peer map +2431 let peer_id = SecretKey::generate(&mut rng).public(); +2432 let direct_addr: SocketAddr = +2433 (std::net::IpAddr::V4(std::net::Ipv4Addr::LOCALHOST), 8758u16).into(); +2434 let node_addr = NodeAddr::new(peer_id).with_direct_addresses([direct_addr]); +2435 +2436 info!("setting up first endpoint"); +2437 // first time, create a magic endpoint without peers but a peers file and add addressing +2438 // information for a peer +2439 let endpoint = new_endpoint(secret_key.clone(), None).await?; +2440 assert_eq!(endpoint.remote_info_iter().count(), 0); +2441 endpoint.add_node_addr(node_addr.clone())?; +2442 +2443 // Grab the current addrs +2444 let node_addrs: Vec<NodeAddr> = endpoint.remote_info_iter().map(Into::into).collect(); +2445 assert_eq!(node_addrs.len(), 1); +2446 assert_eq!(node_addrs[0], node_addr); +2447 +2448 info!("closing endpoint"); +2449 // close the endpoint and restart it +2450 endpoint.close().await; +2451 +2452 info!("restarting endpoint"); +2453 // now restart it and check the addressing info of the peer +2454 let endpoint = new_endpoint(secret_key, Some(node_addrs)).await?; +2455 let RemoteInfo { mut addrs, .. } = endpoint.remote_info(peer_id).e()?; +2456 let conn_addr = addrs.pop().unwrap().addr; +2457 assert_eq!(conn_addr, direct_addr); +2458 Ok(()) +2459 } +2460 +2461 #[tokio::test] +2462 #[traced_test] +2463 async fn endpoint_relay_connect_loop() -> Result { +2464 let test_start = Instant::now(); +2465 let n_clients = 5; +2466 let n_chunks_per_client = 2; +2467 let chunk_size = 10; +2468 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); +2469 let (relay_map, relay_url, _relay_guard) = run_relay_server().await.unwrap(); +2470 let server_secret_key = SecretKey::generate(&mut rng); +2471 let server_node_id = server_secret_key.public(); +2472 +2473 // Make sure the server is bound before having clients connect to it: +2474 let ep = Endpoint::builder() +2475 .insecure_skip_relay_cert_verify(true) +2476 .secret_key(server_secret_key) +2477 .alpns(vec![TEST_ALPN.to_vec()]) +2478 .relay_mode(RelayMode::Custom(relay_map.clone())) +2479 .bind() +2480 .await?; +2481 // Also make sure the server has a working relay connection +2482 ep.home_relay().initialized().await; +2483 +2484 info!(time = ?test_start.elapsed(), "test setup done"); +2485 +2486 // The server accepts the connections of the clients sequentially. +2487 let server = tokio::spawn( +2488 async move { +2489 let eps = ep.bound_sockets(); +2490 +2491 info!(me = %ep.node_id().fmt_short(), eps = ?eps, "server listening on"); +2492 for i in 0..n_clients { +2493 let round_start = Instant::now(); +2494 info!("[server] round {i}"); +2495 let incoming = ep.accept().await.e()?; +2496 let conn = incoming.await.e()?; +2497 let node_id = conn.remote_node_id()?; +2498 info!(%i, peer = %node_id.fmt_short(), "accepted connection"); +2499 let (mut send, mut recv) = conn.accept_bi().await.e()?; +2500 let mut buf = vec![0u8; chunk_size]; +2501 for _i in 0..n_chunks_per_client { +2502 recv.read_exact(&mut buf).await.e()?; +2503 send.write_all(&buf).await.e()?; +2504 } +2505 send.finish().e()?; +2506 conn.closed().await; // we're the last to send data, so we wait for the other side to close +2507 info!(%i, peer = %node_id.fmt_short(), "finished"); +2508 info!("[server] round {i} done in {:?}", round_start.elapsed()); +2509 } +2510 Ok::<_, Error>(()) +2511 } +2512 .instrument(error_span!("server")), +2513 ); +2514 +2515 let start = Instant::now(); +2516 +2517 for i in 0..n_clients { +2518 let round_start = Instant::now(); +2519 info!("[client] round {i}"); +2520 let client_secret_key = SecretKey::generate(&mut rng); +2521 async { +2522 info!("client binding"); +2523 let ep = Endpoint::builder() +2524 .alpns(vec![TEST_ALPN.to_vec()]) +2525 .insecure_skip_relay_cert_verify(true) +2526 .relay_mode(RelayMode::Custom(relay_map.clone())) +2527 .secret_key(client_secret_key) +2528 .bind() +2529 .await?; +2530 let eps = ep.bound_sockets(); +2531 +2532 info!(me = %ep.node_id().fmt_short(), eps=?eps, "client bound"); +2533 let node_addr = NodeAddr::new(server_node_id).with_relay_url(relay_url.clone()); +2534 info!(to = ?node_addr, "client connecting"); +2535 let conn = ep.connect(node_addr, TEST_ALPN).await.e()?; +2536 info!("client connected"); +2537 let (mut send, mut recv) = conn.open_bi().await.e()?; +2538 +2539 for i in 0..n_chunks_per_client { +2540 let mut buf = vec![i; chunk_size]; +2541 send.write_all(&buf).await.e()?; +2542 recv.read_exact(&mut buf).await.e()?; +2543 assert_eq!(buf, vec![i; chunk_size]); +2544 } +2545 // we're the last to receive data, so we close +2546 conn.close(0u32.into(), b"bye!"); +2547 info!("client finished"); +2548 ep.close().await; +2549 info!("client closed"); +2550 Ok::<_, Error>(()) +2551 } +2552 .instrument(error_span!("client", %i)) +2553 .await?; +2554 info!("[client] round {i} done in {:?}", round_start.elapsed()); +2555 } +2556 +2557 server.await.e()??; +2558 +2559 // We appear to have seen this being very slow at times. So ensure we fail if this +2560 // test is too slow. We're only making two connections transferring very little +2561 // data, this really shouldn't take long. +2562 if start.elapsed() > Duration::from_secs(15) { +2563 panic!("Test too slow, something went wrong"); +2564 } 2565 -2566 #[tokio::test] -2567 #[traced_test] -2568 async fn endpoint_send_relay() -> Result { -2569 let (relay_map, _relay_url, _guard) = run_relay_server().await?; -2570 let client = Endpoint::builder() -2571 .insecure_skip_relay_cert_verify(true) -2572 .relay_mode(RelayMode::Custom(relay_map.clone())) -2573 .bind() -2574 .await?; -2575 let server = Endpoint::builder() -2576 .insecure_skip_relay_cert_verify(true) -2577 .relay_mode(RelayMode::Custom(relay_map)) -2578 .alpns(vec![TEST_ALPN.to_vec()]) -2579 .bind() -2580 .await?; -2581 -2582 let task = tokio::spawn({ -2583 let server = server.clone(); -2584 async move { -2585 let Some(conn) = server.accept().await else { -2586 snafu::whatever!("Expected an incoming connection"); -2587 }; -2588 let conn = conn.await.e()?; -2589 let (mut send, mut recv) = conn.accept_bi().await.e()?; -2590 let data = recv.read_to_end(1000).await.e()?; -2591 send.write_all(&data).await.e()?; -2592 send.finish().e()?; -2593 conn.closed().await; -2594 -2595 Ok::<_, Error>(()) -2596 } -2597 }); -2598 -2599 let addr = server.node_addr().initialized().await; -2600 let conn = client.connect(addr, TEST_ALPN).await?; -2601 let (mut send, mut recv) = conn.open_bi().await.e()?; -2602 send.write_all(b"Hello, world!").await.e()?; -2603 send.finish().e()?; -2604 let data = recv.read_to_end(1000).await.e()?; -2605 conn.close(0u32.into(), b"bye!"); -2606 -2607 task.await.e()??; -2608 -2609 client.close().await; -2610 server.close().await; +2566 Ok(()) +2567 } +2568 +2569 #[tokio::test] +2570 #[traced_test] +2571 async fn endpoint_send_relay() -> Result { +2572 let (relay_map, _relay_url, _guard) = run_relay_server().await?; +2573 let client = Endpoint::builder() +2574 .insecure_skip_relay_cert_verify(true) +2575 .relay_mode(RelayMode::Custom(relay_map.clone())) +2576 .bind() +2577 .await?; +2578 let server = Endpoint::builder() +2579 .insecure_skip_relay_cert_verify(true) +2580 .relay_mode(RelayMode::Custom(relay_map)) +2581 .alpns(vec![TEST_ALPN.to_vec()]) +2582 .bind() +2583 .await?; +2584 +2585 let task = tokio::spawn({ +2586 let server = server.clone(); +2587 async move { +2588 let Some(conn) = server.accept().await else { +2589 snafu::whatever!("Expected an incoming connection"); +2590 }; +2591 let conn = conn.await.e()?; +2592 let (mut send, mut recv) = conn.accept_bi().await.e()?; +2593 let data = recv.read_to_end(1000).await.e()?; +2594 send.write_all(&data).await.e()?; +2595 send.finish().e()?; +2596 conn.closed().await; +2597 +2598 Ok::<_, Error>(()) +2599 } +2600 }); +2601 +2602 let addr = server.node_addr().initialized().await; +2603 let conn = client.connect(addr, TEST_ALPN).await?; +2604 let (mut send, mut recv) = conn.open_bi().await.e()?; +2605 send.write_all(b"Hello, world!").await.e()?; +2606 send.finish().e()?; +2607 let data = recv.read_to_end(1000).await.e()?; +2608 conn.close(0u32.into(), b"bye!"); +2609 +2610 task.await.e()??; 2611 -2612 assert_eq!(&data, b"Hello, world!"); -2613 -2614 Ok(()) -2615 } +2612 client.close().await; +2613 server.close().await; +2614 +2615 assert_eq!(&data, b"Hello, world!"); 2616 -2617 #[tokio::test] -2618 #[traced_test] -2619 async fn endpoint_bidi_send_recv() -> Result { -2620 let ep1 = Endpoint::builder() -2621 .alpns(vec![TEST_ALPN.to_vec()]) -2622 .relay_mode(RelayMode::Disabled); -2623 -2624 let ep1 = ep1.bind().await?; -2625 let ep2 = Endpoint::builder() -2626 .alpns(vec![TEST_ALPN.to_vec()]) -2627 .relay_mode(RelayMode::Disabled); -2628 -2629 let ep2 = ep2.bind().await?; -2630 -2631 let ep1_nodeaddr = ep1.node_addr().initialized().await; -2632 let ep2_nodeaddr = ep2.node_addr().initialized().await; -2633 ep1.add_node_addr(ep2_nodeaddr.clone())?; -2634 ep2.add_node_addr(ep1_nodeaddr.clone())?; -2635 let ep1_nodeid = ep1.node_id(); -2636 let ep2_nodeid = ep2.node_id(); -2637 eprintln!("node id 1 {ep1_nodeid}"); -2638 eprintln!("node id 2 {ep2_nodeid}"); -2639 -2640 async fn connect_hello(ep: Endpoint, dst: NodeAddr) -> Result { -2641 let conn = ep.connect(dst, TEST_ALPN).await?; -2642 let (mut send, mut recv) = conn.open_bi().await.e()?; -2643 info!("sending hello"); -2644 send.write_all(b"hello").await.e()?; -2645 send.finish().e()?; -2646 info!("receiving world"); -2647 let m = recv.read_to_end(100).await.e()?; -2648 assert_eq!(m, b"world"); -2649 conn.close(1u8.into(), b"done"); -2650 Ok(()) -2651 } -2652 -2653 async fn accept_world(ep: Endpoint, src: NodeId) -> Result { -2654 let incoming = ep.accept().await.e()?; -2655 let mut iconn = incoming.accept().e()?; -2656 let alpn = iconn.alpn().await?; -2657 let conn = iconn.await.e()?; -2658 let node_id = conn.remote_node_id()?; -2659 assert_eq!(node_id, src); -2660 assert_eq!(alpn, TEST_ALPN); -2661 let (mut send, mut recv) = conn.accept_bi().await.e()?; -2662 info!("receiving hello"); -2663 let m = recv.read_to_end(100).await.e()?; -2664 assert_eq!(m, b"hello"); -2665 info!("sending hello"); -2666 send.write_all(b"world").await.e()?; -2667 send.finish().e()?; -2668 match conn.closed().await { -2669 ConnectionError::ApplicationClosed(closed) => { -2670 assert_eq!(closed.error_code, 1u8.into()); -2671 Ok(()) -2672 } -2673 _ => panic!("wrong close error"), -2674 } -2675 } -2676 -2677 let p1_accept = tokio::spawn(accept_world(ep1.clone(), ep2_nodeid).instrument(info_span!( -2678 "p1_accept", -2679 ep1 = %ep1.node_id().fmt_short(), -2680 dst = %ep2_nodeid.fmt_short(), -2681 ))); -2682 let p2_accept = tokio::spawn(accept_world(ep2.clone(), ep1_nodeid).instrument(info_span!( -2683 "p2_accept", -2684 ep2 = %ep2.node_id().fmt_short(), -2685 dst = %ep1_nodeid.fmt_short(), -2686 ))); -2687 let p1_connect = tokio::spawn(connect_hello(ep1.clone(), ep2_nodeaddr).instrument( -2688 info_span!( -2689 "p1_connect", -2690 ep1 = %ep1.node_id().fmt_short(), -2691 dst = %ep2_nodeid.fmt_short(), -2692 ), -2693 )); -2694 let p2_connect = tokio::spawn(connect_hello(ep2.clone(), ep1_nodeaddr).instrument( -2695 info_span!( -2696 "p2_connect", -2697 ep2 = %ep2.node_id().fmt_short(), -2698 dst = %ep1_nodeid.fmt_short(), -2699 ), -2700 )); -2701 -2702 p1_accept.await.e()??; -2703 p2_accept.await.e()??; -2704 p1_connect.await.e()??; -2705 p2_connect.await.e()??; -2706 -2707 Ok(()) -2708 } +2617 Ok(()) +2618 } +2619 +2620 #[tokio::test] +2621 #[traced_test] +2622 async fn endpoint_bidi_send_recv() -> Result { +2623 let ep1 = Endpoint::builder() +2624 .alpns(vec![TEST_ALPN.to_vec()]) +2625 .relay_mode(RelayMode::Disabled); +2626 +2627 let ep1 = ep1.bind().await?; +2628 let ep2 = Endpoint::builder() +2629 .alpns(vec![TEST_ALPN.to_vec()]) +2630 .relay_mode(RelayMode::Disabled); +2631 +2632 let ep2 = ep2.bind().await?; +2633 +2634 let ep1_nodeaddr = ep1.node_addr().initialized().await; +2635 let ep2_nodeaddr = ep2.node_addr().initialized().await; +2636 ep1.add_node_addr(ep2_nodeaddr.clone())?; +2637 ep2.add_node_addr(ep1_nodeaddr.clone())?; +2638 let ep1_nodeid = ep1.node_id(); +2639 let ep2_nodeid = ep2.node_id(); +2640 eprintln!("node id 1 {ep1_nodeid}"); +2641 eprintln!("node id 2 {ep2_nodeid}"); +2642 +2643 async fn connect_hello(ep: Endpoint, dst: NodeAddr) -> Result { +2644 let conn = ep.connect(dst, TEST_ALPN).await?; +2645 let (mut send, mut recv) = conn.open_bi().await.e()?; +2646 info!("sending hello"); +2647 send.write_all(b"hello").await.e()?; +2648 send.finish().e()?; +2649 info!("receiving world"); +2650 let m = recv.read_to_end(100).await.e()?; +2651 assert_eq!(m, b"world"); +2652 conn.close(1u8.into(), b"done"); +2653 Ok(()) +2654 } +2655 +2656 async fn accept_world(ep: Endpoint, src: NodeId) -> Result { +2657 let incoming = ep.accept().await.e()?; +2658 let mut iconn = incoming.accept().e()?; +2659 let alpn = iconn.alpn().await?; +2660 let conn = iconn.await.e()?; +2661 let node_id = conn.remote_node_id()?; +2662 assert_eq!(node_id, src); +2663 assert_eq!(alpn, TEST_ALPN); +2664 let (mut send, mut recv) = conn.accept_bi().await.e()?; +2665 info!("receiving hello"); +2666 let m = recv.read_to_end(100).await.e()?; +2667 assert_eq!(m, b"hello"); +2668 info!("sending hello"); +2669 send.write_all(b"world").await.e()?; +2670 send.finish().e()?; +2671 match conn.closed().await { +2672 ConnectionError::ApplicationClosed(closed) => { +2673 assert_eq!(closed.error_code, 1u8.into()); +2674 Ok(()) +2675 } +2676 _ => panic!("wrong close error"), +2677 } +2678 } +2679 +2680 let p1_accept = tokio::spawn(accept_world(ep1.clone(), ep2_nodeid).instrument(info_span!( +2681 "p1_accept", +2682 ep1 = %ep1.node_id().fmt_short(), +2683 dst = %ep2_nodeid.fmt_short(), +2684 ))); +2685 let p2_accept = tokio::spawn(accept_world(ep2.clone(), ep1_nodeid).instrument(info_span!( +2686 "p2_accept", +2687 ep2 = %ep2.node_id().fmt_short(), +2688 dst = %ep1_nodeid.fmt_short(), +2689 ))); +2690 let p1_connect = tokio::spawn(connect_hello(ep1.clone(), ep2_nodeaddr).instrument( +2691 info_span!( +2692 "p1_connect", +2693 ep1 = %ep1.node_id().fmt_short(), +2694 dst = %ep2_nodeid.fmt_short(), +2695 ), +2696 )); +2697 let p2_connect = tokio::spawn(connect_hello(ep2.clone(), ep1_nodeaddr).instrument( +2698 info_span!( +2699 "p2_connect", +2700 ep2 = %ep2.node_id().fmt_short(), +2701 dst = %ep1_nodeid.fmt_short(), +2702 ), +2703 )); +2704 +2705 p1_accept.await.e()??; +2706 p2_accept.await.e()??; +2707 p1_connect.await.e()??; +2708 p2_connect.await.e()??; 2709 -2710 #[tokio::test] -2711 #[traced_test] -2712 async fn endpoint_conn_type_becomes_direct() -> Result { -2713 const TIMEOUT: Duration = std::time::Duration::from_secs(15); -2714 let (relay_map, _relay_url, _relay_guard) = run_relay_server().await?; -2715 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); -2716 let ep1_secret_key = SecretKey::generate(&mut rng); -2717 let ep2_secret_key = SecretKey::generate(&mut rng); -2718 let ep1 = Endpoint::builder() -2719 .secret_key(ep1_secret_key) -2720 .insecure_skip_relay_cert_verify(true) -2721 .alpns(vec![TEST_ALPN.to_vec()]) -2722 .relay_mode(RelayMode::Custom(relay_map.clone())) -2723 .bind() -2724 .await?; -2725 let ep2 = Endpoint::builder() -2726 .secret_key(ep2_secret_key) -2727 .insecure_skip_relay_cert_verify(true) -2728 .alpns(vec![TEST_ALPN.to_vec()]) -2729 .relay_mode(RelayMode::Custom(relay_map)) -2730 .bind() -2731 .await?; -2732 -2733 async fn wait_for_conn_type_direct(ep: &Endpoint, node_id: NodeId) -> Result { -2734 let mut stream = ep.conn_type(node_id).expect("connection exists").stream(); -2735 let src = ep.node_id().fmt_short(); -2736 let dst = node_id.fmt_short(); -2737 while let Some(conn_type) = stream.next().await { -2738 tracing::info!(me = %src, dst = %dst, conn_type = ?conn_type); -2739 if matches!(conn_type, ConnectionType::Direct(_)) { -2740 return Ok(()); -2741 } -2742 } -2743 snafu::whatever!("conn_type stream ended before `ConnectionType::Direct`"); -2744 } -2745 -2746 async fn accept(ep: &Endpoint) -> Result<Connection> { -2747 let incoming = ep.accept().await.expect("ep closed"); -2748 let conn = incoming.await.e()?; -2749 let node_id = conn.remote_node_id()?; -2750 tracing::info!(node_id=%node_id.fmt_short(), "accepted connection"); -2751 Ok(conn) -2752 } -2753 -2754 let ep1_nodeid = ep1.node_id(); -2755 let ep2_nodeid = ep2.node_id(); +2710 Ok(()) +2711 } +2712 +2713 #[tokio::test] +2714 #[traced_test] +2715 async fn endpoint_conn_type_becomes_direct() -> Result { +2716 const TIMEOUT: Duration = std::time::Duration::from_secs(15); +2717 let (relay_map, _relay_url, _relay_guard) = run_relay_server().await?; +2718 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(42); +2719 let ep1_secret_key = SecretKey::generate(&mut rng); +2720 let ep2_secret_key = SecretKey::generate(&mut rng); +2721 let ep1 = Endpoint::builder() +2722 .secret_key(ep1_secret_key) +2723 .insecure_skip_relay_cert_verify(true) +2724 .alpns(vec![TEST_ALPN.to_vec()]) +2725 .relay_mode(RelayMode::Custom(relay_map.clone())) +2726 .bind() +2727 .await?; +2728 let ep2 = Endpoint::builder() +2729 .secret_key(ep2_secret_key) +2730 .insecure_skip_relay_cert_verify(true) +2731 .alpns(vec![TEST_ALPN.to_vec()]) +2732 .relay_mode(RelayMode::Custom(relay_map)) +2733 .bind() +2734 .await?; +2735 +2736 async fn wait_for_conn_type_direct(ep: &Endpoint, node_id: NodeId) -> Result { +2737 let mut stream = ep.conn_type(node_id).expect("connection exists").stream(); +2738 let src = ep.node_id().fmt_short(); +2739 let dst = node_id.fmt_short(); +2740 while let Some(conn_type) = stream.next().await { +2741 tracing::info!(me = %src, dst = %dst, conn_type = ?conn_type); +2742 if matches!(conn_type, ConnectionType::Direct(_)) { +2743 return Ok(()); +2744 } +2745 } +2746 snafu::whatever!("conn_type stream ended before `ConnectionType::Direct`"); +2747 } +2748 +2749 async fn accept(ep: &Endpoint) -> Result<Connection> { +2750 let incoming = ep.accept().await.expect("ep closed"); +2751 let conn = incoming.await.e()?; +2752 let node_id = conn.remote_node_id()?; +2753 tracing::info!(node_id=%node_id.fmt_short(), "accepted connection"); +2754 Ok(conn) +2755 } 2756 -2757 let ep1_nodeaddr = ep1.node_addr().initialized().await; -2758 tracing::info!( -2759 "node id 1 {ep1_nodeid}, relay URL {:?}", -2760 ep1_nodeaddr.relay_url() -2761 ); -2762 tracing::info!("node id 2 {ep2_nodeid}"); -2763 -2764 let ep1_side = tokio::time::timeout(TIMEOUT, async move { -2765 let conn = accept(&ep1).await?; -2766 let mut send = conn.open_uni().await.e()?; -2767 wait_for_conn_type_direct(&ep1, ep2_nodeid).await?; -2768 send.write_all(b"Conn is direct").await.e()?; -2769 send.finish().e()?; -2770 conn.closed().await; -2771 Ok::<(), Error>(()) -2772 }); -2773 -2774 let ep2_side = tokio::time::timeout(TIMEOUT, async move { -2775 let conn = ep2.connect(ep1_nodeaddr, TEST_ALPN).await?; -2776 let mut recv = conn.accept_uni().await.e()?; -2777 wait_for_conn_type_direct(&ep2, ep1_nodeid).await?; -2778 let read = recv.read_to_end(100).await.e()?; -2779 assert_eq!(read, b"Conn is direct".to_vec()); -2780 conn.close(0u32.into(), b"done"); -2781 conn.closed().await; -2782 Ok::<(), Error>(()) -2783 }); -2784 -2785 let res_ep1 = AbortOnDropHandle::new(tokio::spawn(ep1_side)); -2786 let res_ep2 = AbortOnDropHandle::new(tokio::spawn(ep2_side)); +2757 let ep1_nodeid = ep1.node_id(); +2758 let ep2_nodeid = ep2.node_id(); +2759 +2760 let ep1_nodeaddr = ep1.node_addr().initialized().await; +2761 tracing::info!( +2762 "node id 1 {ep1_nodeid}, relay URL {:?}", +2763 ep1_nodeaddr.relay_url() +2764 ); +2765 tracing::info!("node id 2 {ep2_nodeid}"); +2766 +2767 let ep1_side = tokio::time::timeout(TIMEOUT, async move { +2768 let conn = accept(&ep1).await?; +2769 let mut send = conn.open_uni().await.e()?; +2770 wait_for_conn_type_direct(&ep1, ep2_nodeid).await?; +2771 send.write_all(b"Conn is direct").await.e()?; +2772 send.finish().e()?; +2773 conn.closed().await; +2774 Ok::<(), Error>(()) +2775 }); +2776 +2777 let ep2_side = tokio::time::timeout(TIMEOUT, async move { +2778 let conn = ep2.connect(ep1_nodeaddr, TEST_ALPN).await?; +2779 let mut recv = conn.accept_uni().await.e()?; +2780 wait_for_conn_type_direct(&ep2, ep1_nodeid).await?; +2781 let read = recv.read_to_end(100).await.e()?; +2782 assert_eq!(read, b"Conn is direct".to_vec()); +2783 conn.close(0u32.into(), b"done"); +2784 conn.closed().await; +2785 Ok::<(), Error>(()) +2786 }); 2787 -2788 let (r1, r2) = tokio::try_join!(res_ep1, res_ep2).e()?; -2789 r1.e()??; -2790 r2.e()??; -2791 -2792 Ok(()) -2793 } +2788 let res_ep1 = AbortOnDropHandle::new(tokio::spawn(ep1_side)); +2789 let res_ep2 = AbortOnDropHandle::new(tokio::spawn(ep2_side)); +2790 +2791 let (r1, r2) = tokio::try_join!(res_ep1, res_ep2).e()?; +2792 r1.e()??; +2793 r2.e()??; 2794 -2795 #[tokio::test] -2796 #[traced_test] -2797 async fn test_direct_addresses_no_qad_relay() -> Result { -2798 let (relay_map, _, _guard) = run_relay_server_with(false).await.unwrap(); -2799 -2800 let ep = Endpoint::builder() -2801 .alpns(vec![TEST_ALPN.to_vec()]) -2802 .relay_mode(RelayMode::Custom(relay_map)) -2803 .insecure_skip_relay_cert_verify(true) -2804 .bind() -2805 .await?; -2806 -2807 tokio::time::timeout(Duration::from_secs(10), ep.direct_addresses().initialized()) -2808 .await -2809 .e()?; -2810 Ok(()) -2811 } -2812 -2813 async fn spawn_0rtt_server(secret_key: SecretKey, log_span: tracing::Span) -> Result<Endpoint> { -2814 let server = Endpoint::builder() -2815 .secret_key(secret_key) -2816 .alpns(vec![TEST_ALPN.to_vec()]) -2817 .relay_mode(RelayMode::Disabled) -2818 .bind() -2819 .await?; -2820 -2821 // Gets aborted via the endpoint closing causing an `Err` -2822 // a simple echo server -2823 tokio::spawn({ -2824 let server = server.clone(); -2825 async move { -2826 while let Some(incoming) = server.accept().await { -2827 let connecting = incoming.accept().e()?; -2828 let conn = match connecting.into_0rtt() { -2829 Ok((conn, _)) => { -2830 info!("0rtt accepted"); -2831 conn -2832 } -2833 Err(connecting) => { -2834 info!("0rtt denied"); -2835 connecting.await.e()? -2836 } -2837 }; -2838 let (mut send, mut recv) = conn.accept_bi().await.e()?; -2839 let data = recv.read_to_end(10_000_000).await.e()?; -2840 send.write_all(&data).await.e()?; -2841 send.finish().e()?; -2842 -2843 // Stay alive until the other side closes the connection. -2844 conn.closed().await; -2845 } -2846 Ok::<_, Error>(()) -2847 } -2848 .instrument(log_span) -2849 }); -2850 -2851 Ok(server) -2852 } +2795 Ok(()) +2796 } +2797 +2798 #[tokio::test] +2799 #[traced_test] +2800 async fn test_direct_addresses_no_qad_relay() -> Result { +2801 let (relay_map, _, _guard) = run_relay_server_with(false).await.unwrap(); +2802 +2803 let ep = Endpoint::builder() +2804 .alpns(vec![TEST_ALPN.to_vec()]) +2805 .relay_mode(RelayMode::Custom(relay_map)) +2806 .insecure_skip_relay_cert_verify(true) +2807 .bind() +2808 .await?; +2809 +2810 tokio::time::timeout(Duration::from_secs(10), ep.direct_addresses().initialized()) +2811 .await +2812 .e()?; +2813 Ok(()) +2814 } +2815 +2816 async fn spawn_0rtt_server(secret_key: SecretKey, log_span: tracing::Span) -> Result<Endpoint> { +2817 let server = Endpoint::builder() +2818 .secret_key(secret_key) +2819 .alpns(vec![TEST_ALPN.to_vec()]) +2820 .relay_mode(RelayMode::Disabled) +2821 .bind() +2822 .await?; +2823 +2824 // Gets aborted via the endpoint closing causing an `Err` +2825 // a simple echo server +2826 tokio::spawn({ +2827 let server = server.clone(); +2828 async move { +2829 while let Some(incoming) = server.accept().await { +2830 let connecting = incoming.accept().e()?; +2831 let conn = match connecting.into_0rtt() { +2832 Ok((conn, _)) => { +2833 info!("0rtt accepted"); +2834 conn +2835 } +2836 Err(connecting) => { +2837 info!("0rtt denied"); +2838 connecting.await.e()? +2839 } +2840 }; +2841 let (mut send, mut recv) = conn.accept_bi().await.e()?; +2842 let data = recv.read_to_end(10_000_000).await.e()?; +2843 send.write_all(&data).await.e()?; +2844 send.finish().e()?; +2845 +2846 // Stay alive until the other side closes the connection. +2847 conn.closed().await; +2848 } +2849 Ok::<_, Error>(()) +2850 } +2851 .instrument(log_span) +2852 }); 2853 -2854 async fn connect_client_0rtt_expect_err(client: &Endpoint, server_addr: NodeAddr) -> Result { -2855 let conn = client -2856 .connect_with_opts(server_addr, TEST_ALPN, ConnectOptions::new()) -2857 .await? -2858 .into_0rtt() -2859 .expect_err("expected 0rtt to fail") -2860 .await -2861 .e()?; -2862 -2863 let (mut send, mut recv) = conn.open_bi().await.e()?; -2864 send.write_all(b"hello").await.e()?; -2865 send.finish().e()?; -2866 let received = recv.read_to_end(1_000).await.e()?; -2867 assert_eq!(&received, b"hello"); -2868 conn.close(0u32.into(), b"thx"); -2869 Ok(()) -2870 } -2871 -2872 async fn connect_client_0rtt_expect_ok( -2873 client: &Endpoint, -2874 server_addr: NodeAddr, -2875 expect_server_accepts: bool, -2876 ) -> Result { -2877 let (conn, accepted_0rtt) = client -2878 .connect_with_opts(server_addr, TEST_ALPN, ConnectOptions::new()) -2879 .await? -2880 .into_0rtt() -2881 .ok() -2882 .e()?; -2883 -2884 // This is how we send data in 0-RTT: -2885 let (mut send, recv) = conn.open_bi().await.e()?; -2886 send.write_all(b"hello").await.e()?; -2887 send.finish().e()?; -2888 // When this resolves, we've gotten a response from the server about whether the 0-RTT data above was accepted: -2889 let accepted = accepted_0rtt.await; -2890 assert_eq!(accepted, expect_server_accepts); -2891 let mut recv = if accepted { -2892 recv -2893 } else { -2894 // in this case we need to re-send data by re-creating the connection. -2895 let (mut send, recv) = conn.open_bi().await.e()?; -2896 send.write_all(b"hello").await.e()?; -2897 send.finish().e()?; -2898 recv -2899 }; -2900 let received = recv.read_to_end(1_000).await.e()?; -2901 assert_eq!(&received, b"hello"); -2902 conn.close(0u32.into(), b"thx"); -2903 Ok(()) -2904 } -2905 -2906 #[tokio::test] -2907 #[traced_test] -2908 async fn test_0rtt() -> Result { -2909 let client = Endpoint::builder() -2910 .relay_mode(RelayMode::Disabled) -2911 .bind() -2912 .await?; -2913 let server = -2914 spawn_0rtt_server(SecretKey::generate(rand::rng()), info_span!("server")).await?; -2915 -2916 connect_client_0rtt_expect_err(&client, server.node_addr().initialized().await).await?; -2917 // The second 0rtt attempt should work -2918 connect_client_0rtt_expect_ok(&client, server.node_addr().initialized().await, true) -2919 .await?; -2920 -2921 client.close().await; -2922 server.close().await; -2923 -2924 Ok(()) -2925 } -2926 -2927 // We have this test, as this would've failed at some point. -2928 // This effectively tests that we correctly categorize the TLS session tickets we -2929 // receive into the respective "bucket" for the recipient. -2930 #[tokio::test] -2931 #[traced_test] -2932 async fn test_0rtt_non_consecutive() -> Result { -2933 let client = Endpoint::builder() -2934 .relay_mode(RelayMode::Disabled) -2935 .bind() -2936 .await?; -2937 let server = -2938 spawn_0rtt_server(SecretKey::generate(rand::rng()), info_span!("server")).await?; -2939 -2940 connect_client_0rtt_expect_err(&client, server.node_addr().initialized().await).await?; -2941 -2942 // connecting with another endpoint should not interfere with our -2943 // TLS session ticket cache for the first endpoint: -2944 let another = -2945 spawn_0rtt_server(SecretKey::generate(rand::rng()), info_span!("another")).await?; -2946 connect_client_0rtt_expect_err(&client, another.node_addr().initialized().await).await?; -2947 another.close().await; -2948 -2949 connect_client_0rtt_expect_ok(&client, server.node_addr().initialized().await, true) -2950 .await?; -2951 -2952 client.close().await; -2953 server.close().await; -2954 -2955 Ok(()) -2956 } -2957 -2958 // Test whether 0-RTT is possible after a restart: -2959 #[tokio::test] -2960 #[traced_test] -2961 async fn test_0rtt_after_server_restart() -> Result { -2962 let client = Endpoint::builder() -2963 .relay_mode(RelayMode::Disabled) -2964 .bind() -2965 .await?; -2966 let server_key = SecretKey::generate(rand::rng()); -2967 let server = spawn_0rtt_server(server_key.clone(), info_span!("server-initial")).await?; -2968 -2969 connect_client_0rtt_expect_err(&client, server.node_addr().initialized().await).await?; -2970 connect_client_0rtt_expect_ok(&client, server.node_addr().initialized().await, true) +2854 Ok(server) +2855 } +2856 +2857 async fn connect_client_0rtt_expect_err(client: &Endpoint, server_addr: NodeAddr) -> Result { +2858 let conn = client +2859 .connect_with_opts(server_addr, TEST_ALPN, ConnectOptions::new()) +2860 .await? +2861 .into_0rtt() +2862 .expect_err("expected 0rtt to fail") +2863 .await +2864 .e()?; +2865 +2866 let (mut send, mut recv) = conn.open_bi().await.e()?; +2867 send.write_all(b"hello").await.e()?; +2868 send.finish().e()?; +2869 let received = recv.read_to_end(1_000).await.e()?; +2870 assert_eq!(&received, b"hello"); +2871 conn.close(0u32.into(), b"thx"); +2872 Ok(()) +2873 } +2874 +2875 async fn connect_client_0rtt_expect_ok( +2876 client: &Endpoint, +2877 server_addr: NodeAddr, +2878 expect_server_accepts: bool, +2879 ) -> Result { +2880 let (conn, accepted_0rtt) = client +2881 .connect_with_opts(server_addr, TEST_ALPN, ConnectOptions::new()) +2882 .await? +2883 .into_0rtt() +2884 .ok() +2885 .e()?; +2886 +2887 // This is how we send data in 0-RTT: +2888 let (mut send, recv) = conn.open_bi().await.e()?; +2889 send.write_all(b"hello").await.e()?; +2890 send.finish().e()?; +2891 // When this resolves, we've gotten a response from the server about whether the 0-RTT data above was accepted: +2892 let accepted = accepted_0rtt.await; +2893 assert_eq!(accepted, expect_server_accepts); +2894 let mut recv = if accepted { +2895 recv +2896 } else { +2897 // in this case we need to re-send data by re-creating the connection. +2898 let (mut send, recv) = conn.open_bi().await.e()?; +2899 send.write_all(b"hello").await.e()?; +2900 send.finish().e()?; +2901 recv +2902 }; +2903 let received = recv.read_to_end(1_000).await.e()?; +2904 assert_eq!(&received, b"hello"); +2905 conn.close(0u32.into(), b"thx"); +2906 Ok(()) +2907 } +2908 +2909 #[tokio::test] +2910 #[traced_test] +2911 async fn test_0rtt() -> Result { +2912 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2913 +2914 let client = Endpoint::builder() +2915 .relay_mode(RelayMode::Disabled) +2916 .bind() +2917 .await?; +2918 let server = spawn_0rtt_server(SecretKey::generate(&mut rng), info_span!("server")).await?; +2919 +2920 connect_client_0rtt_expect_err(&client, server.node_addr().initialized().await).await?; +2921 // The second 0rtt attempt should work +2922 connect_client_0rtt_expect_ok(&client, server.node_addr().initialized().await, true) +2923 .await?; +2924 +2925 client.close().await; +2926 server.close().await; +2927 +2928 Ok(()) +2929 } +2930 +2931 // We have this test, as this would've failed at some point. +2932 // This effectively tests that we correctly categorize the TLS session tickets we +2933 // receive into the respective "bucket" for the recipient. +2934 #[tokio::test] +2935 #[traced_test] +2936 async fn test_0rtt_non_consecutive() -> Result { +2937 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2938 +2939 let client = Endpoint::builder() +2940 .relay_mode(RelayMode::Disabled) +2941 .bind() +2942 .await?; +2943 let server = spawn_0rtt_server(SecretKey::generate(&mut rng), info_span!("server")).await?; +2944 +2945 connect_client_0rtt_expect_err(&client, server.node_addr().initialized().await).await?; +2946 +2947 // connecting with another endpoint should not interfere with our +2948 // TLS session ticket cache for the first endpoint: +2949 let another = +2950 spawn_0rtt_server(SecretKey::generate(&mut rng), info_span!("another")).await?; +2951 connect_client_0rtt_expect_err(&client, another.node_addr().initialized().await).await?; +2952 another.close().await; +2953 +2954 connect_client_0rtt_expect_ok(&client, server.node_addr().initialized().await, true) +2955 .await?; +2956 +2957 client.close().await; +2958 server.close().await; +2959 +2960 Ok(()) +2961 } +2962 +2963 // Test whether 0-RTT is possible after a restart: +2964 #[tokio::test] +2965 #[traced_test] +2966 async fn test_0rtt_after_server_restart() -> Result { +2967 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2968 let client = Endpoint::builder() +2969 .relay_mode(RelayMode::Disabled) +2970 .bind() 2971 .await?; -2972 -2973 server.close().await; +2972 let server_key = SecretKey::generate(&mut rng); +2973 let server = spawn_0rtt_server(server_key.clone(), info_span!("server-initial")).await?; 2974 -2975 let server = spawn_0rtt_server(server_key, info_span!("server-restart")).await?; -2976 -2977 // we expect the client to *believe* it can 0-RTT connect to the server (hence expect_ok), -2978 // but the server will reject the early data because it discarded necessary state -2979 // to decrypt it when restarting. -2980 connect_client_0rtt_expect_ok(&client, server.node_addr().initialized().await, false) -2981 .await?; +2975 connect_client_0rtt_expect_err(&client, server.node_addr().initialized().await).await?; +2976 connect_client_0rtt_expect_ok(&client, server.node_addr().initialized().await, true) +2977 .await?; +2978 +2979 server.close().await; +2980 +2981 let server = spawn_0rtt_server(server_key, info_span!("server-restart")).await?; 2982 -2983 client.close().await; -2984 -2985 Ok(()) -2986 } -2987 -2988 #[cfg_attr(target_os = "windows", ignore = "flaky")] -2989 #[tokio::test] -2990 #[traced_test] -2991 async fn graceful_close() -> Result { -2992 let client = Endpoint::builder().bind().await?; -2993 let server = Endpoint::builder() -2994 .alpns(vec![TEST_ALPN.to_vec()]) -2995 .bind() -2996 .await?; -2997 let server_addr = server.node_addr().initialized().await; -2998 let server_task = tokio::spawn(async move { -2999 let incoming = server.accept().await.e()?; -3000 let conn = incoming.await.e()?; -3001 let (mut send, mut recv) = conn.accept_bi().await.e()?; -3002 let msg = recv.read_to_end(1_000).await.e()?; -3003 send.write_all(&msg).await.e()?; -3004 send.finish().e()?; -3005 let close_reason = conn.closed().await; -3006 Ok::<_, Error>(close_reason) -3007 }); -3008 -3009 let conn = client.connect(server_addr, TEST_ALPN).await?; -3010 let (mut send, mut recv) = conn.open_bi().await.e()?; -3011 send.write_all(b"Hello, world!").await.e()?; -3012 send.finish().e()?; -3013 recv.read_to_end(1_000).await.e()?; -3014 conn.close(42u32.into(), b"thanks, bye!"); -3015 client.close().await; -3016 -3017 let close_err = server_task.await.e()??; -3018 let ConnectionError::ApplicationClosed(app_close) = close_err else { -3019 panic!("Unexpected close reason: {close_err:?}"); -3020 }; -3021 -3022 assert_eq!(app_close.error_code, 42u32.into()); -3023 assert_eq!(app_close.reason.as_ref(), b"thanks, bye!"); -3024 -3025 Ok(()) -3026 } +2983 // we expect the client to *believe* it can 0-RTT connect to the server (hence expect_ok), +2984 // but the server will reject the early data because it discarded necessary state +2985 // to decrypt it when restarting. +2986 connect_client_0rtt_expect_ok(&client, server.node_addr().initialized().await, false) +2987 .await?; +2988 +2989 client.close().await; +2990 +2991 Ok(()) +2992 } +2993 +2994 #[cfg_attr(target_os = "windows", ignore = "flaky")] +2995 #[tokio::test] +2996 #[traced_test] +2997 async fn graceful_close() -> Result { +2998 let client = Endpoint::builder().bind().await?; +2999 let server = Endpoint::builder() +3000 .alpns(vec![TEST_ALPN.to_vec()]) +3001 .bind() +3002 .await?; +3003 let server_addr = server.node_addr().initialized().await; +3004 let server_task = tokio::spawn(async move { +3005 let incoming = server.accept().await.e()?; +3006 let conn = incoming.await.e()?; +3007 let (mut send, mut recv) = conn.accept_bi().await.e()?; +3008 let msg = recv.read_to_end(1_000).await.e()?; +3009 send.write_all(&msg).await.e()?; +3010 send.finish().e()?; +3011 let close_reason = conn.closed().await; +3012 Ok::<_, Error>(close_reason) +3013 }); +3014 +3015 let conn = client.connect(server_addr, TEST_ALPN).await?; +3016 let (mut send, mut recv) = conn.open_bi().await.e()?; +3017 send.write_all(b"Hello, world!").await.e()?; +3018 send.finish().e()?; +3019 recv.read_to_end(1_000).await.e()?; +3020 conn.close(42u32.into(), b"thanks, bye!"); +3021 client.close().await; +3022 +3023 let close_err = server_task.await.e()??; +3024 let ConnectionError::ApplicationClosed(app_close) = close_err else { +3025 panic!("Unexpected close reason: {close_err:?}"); +3026 }; 3027 -3028 #[cfg(feature = "metrics")] -3029 #[tokio::test] -3030 #[traced_test] -3031 async fn metrics_smoke() -> Result { -3032 use iroh_metrics::{MetricsSource, Registry}; +3028 assert_eq!(app_close.error_code, 42u32.into()); +3029 assert_eq!(app_close.reason.as_ref(), b"thanks, bye!"); +3030 +3031 Ok(()) +3032 } 3033 -3034 let secret_key = SecretKey::from_bytes(&[0u8; 32]); -3035 let client = Endpoint::builder() -3036 .secret_key(secret_key) -3037 .relay_mode(RelayMode::Disabled) -3038 .bind() -3039 .await?; -3040 let secret_key = SecretKey::from_bytes(&[1u8; 32]); -3041 let server = Endpoint::builder() +3034 #[cfg(feature = "metrics")] +3035 #[tokio::test] +3036 #[traced_test] +3037 async fn metrics_smoke() -> Result { +3038 use iroh_metrics::{MetricsSource, Registry}; +3039 +3040 let secret_key = SecretKey::from_bytes(&[0u8; 32]); +3041 let client = Endpoint::builder() 3042 .secret_key(secret_key) 3043 .relay_mode(RelayMode::Disabled) -3044 .alpns(vec![TEST_ALPN.to_vec()]) -3045 .bind() -3046 .await?; -3047 let server_addr = server.node_addr().initialized().await; -3048 let server_task = tokio::task::spawn(async move { -3049 let conn = server.accept().await.e()?.accept().e()?.await.e()?; -3050 let mut uni = conn.accept_uni().await.e()?; -3051 uni.read_to_end(10).await.e()?; -3052 drop(conn); -3053 Ok::<_, Error>(server) -3054 }); -3055 let conn = client.connect(server_addr, TEST_ALPN).await?; -3056 let mut uni = conn.open_uni().await.e()?; -3057 uni.write_all(b"helloworld").await.e()?; -3058 uni.finish().e()?; -3059 conn.closed().await; -3060 drop(conn); -3061 let server = server_task.await.e()??; -3062 -3063 let m = client.metrics(); -3064 assert_eq!(m.magicsock.num_direct_conns_added.get(), 1); -3065 assert_eq!(m.magicsock.connection_became_direct.get(), 1); -3066 assert_eq!(m.magicsock.connection_handshake_success.get(), 1); -3067 assert_eq!(m.magicsock.nodes_contacted_directly.get(), 1); -3068 assert!(m.magicsock.recv_datagrams.get() > 0); -3069 -3070 let m = server.metrics(); -3071 assert_eq!(m.magicsock.num_direct_conns_added.get(), 1); -3072 assert_eq!(m.magicsock.connection_became_direct.get(), 1); +3044 .bind() +3045 .await?; +3046 let secret_key = SecretKey::from_bytes(&[1u8; 32]); +3047 let server = Endpoint::builder() +3048 .secret_key(secret_key) +3049 .relay_mode(RelayMode::Disabled) +3050 .alpns(vec![TEST_ALPN.to_vec()]) +3051 .bind() +3052 .await?; +3053 let server_addr = server.node_addr().initialized().await; +3054 let server_task = tokio::task::spawn(async move { +3055 let conn = server.accept().await.e()?.accept().e()?.await.e()?; +3056 let mut uni = conn.accept_uni().await.e()?; +3057 uni.read_to_end(10).await.e()?; +3058 drop(conn); +3059 Ok::<_, Error>(server) +3060 }); +3061 let conn = client.connect(server_addr, TEST_ALPN).await?; +3062 let mut uni = conn.open_uni().await.e()?; +3063 uni.write_all(b"helloworld").await.e()?; +3064 uni.finish().e()?; +3065 conn.closed().await; +3066 drop(conn); +3067 let server = server_task.await.e()??; +3068 +3069 let m = client.metrics(); +3070 assert_eq!(m.magicsock.num_direct_conns_added.get(), 1); +3071 assert_eq!(m.magicsock.connection_became_direct.get(), 1); +3072 assert_eq!(m.magicsock.connection_handshake_success.get(), 1); 3073 assert_eq!(m.magicsock.nodes_contacted_directly.get(), 1); -3074 assert_eq!(m.magicsock.connection_handshake_success.get(), 1); -3075 assert!(m.magicsock.recv_datagrams.get() > 0); -3076 -3077 // test openmetrics encoding with labeled subregistries per endpoint -3078 fn register_endpoint(registry: &mut Registry, endpoint: &Endpoint) { -3079 let id = endpoint.node_id().fmt_short(); -3080 let sub_registry = registry.sub_registry_with_label("id", id.to_string()); -3081 sub_registry.register_all(endpoint.metrics()); -3082 } -3083 let mut registry = Registry::default(); -3084 register_endpoint(&mut registry, &client); -3085 register_endpoint(&mut registry, &server); -3086 let s = registry.encode_openmetrics_to_string()?; -3087 assert!(s.contains(r#"magicsock_nodes_contacted_directly_total{id="3b6a27bcce"} 1"#)); -3088 assert!(s.contains(r#"magicsock_nodes_contacted_directly_total{id="8a88e3dd74"} 1"#)); -3089 Ok(()) -3090 } -3091 -3092 /// Configures the accept side to take `accept_alpns` ALPNs, then connects to it with `primary_connect_alpn` -3093 /// with `secondary_connect_alpns` set, and finally returns the negotiated ALPN. -3094 async fn alpn_connection_test( -3095 accept_alpns: Vec<Vec<u8>>, -3096 primary_connect_alpn: &[u8], -3097 secondary_connect_alpns: Vec<Vec<u8>>, -3098 ) -> Result<Option<Vec<u8>>> { -3099 let client = Endpoint::builder() -3100 .relay_mode(RelayMode::Disabled) -3101 .bind() -3102 .await?; -3103 let server = Endpoint::builder() -3104 .relay_mode(RelayMode::Disabled) -3105 .alpns(accept_alpns) -3106 .bind() -3107 .await?; -3108 let server_addr = server.node_addr().initialized().await; -3109 let server_task = tokio::spawn({ -3110 let server = server.clone(); -3111 async move { -3112 let incoming = server.accept().await.e()?; -3113 let conn = incoming.await.e()?; -3114 conn.close(0u32.into(), b"bye!"); -3115 Ok::<_, n0_snafu::Error>(conn.alpn()) -3116 } -3117 }); -3118 -3119 let conn = client -3120 .connect_with_opts( -3121 server_addr, -3122 primary_connect_alpn, -3123 ConnectOptions::new().with_additional_alpns(secondary_connect_alpns), -3124 ) -3125 .await?; -3126 let conn = conn.await.e()?; -3127 let client_alpn = conn.alpn(); -3128 conn.closed().await; -3129 client.close().await; -3130 server.close().await; -3131 -3132 let server_alpn = server_task.await.e()??; -3133 -3134 assert_eq!(client_alpn, server_alpn); -3135 -3136 Ok(server_alpn) -3137 } -3138 -3139 #[tokio::test] -3140 #[traced_test] -3141 async fn connect_multiple_alpn_negotiated() -> Result { -3142 const ALPN_ONE: &[u8] = b"alpn/1"; -3143 const ALPN_TWO: &[u8] = b"alpn/2"; +3074 assert!(m.magicsock.recv_datagrams.get() > 0); +3075 +3076 let m = server.metrics(); +3077 assert_eq!(m.magicsock.num_direct_conns_added.get(), 1); +3078 assert_eq!(m.magicsock.connection_became_direct.get(), 1); +3079 assert_eq!(m.magicsock.nodes_contacted_directly.get(), 1); +3080 assert_eq!(m.magicsock.connection_handshake_success.get(), 1); +3081 assert!(m.magicsock.recv_datagrams.get() > 0); +3082 +3083 // test openmetrics encoding with labeled subregistries per endpoint +3084 fn register_endpoint(registry: &mut Registry, endpoint: &Endpoint) { +3085 let id = endpoint.node_id().fmt_short(); +3086 let sub_registry = registry.sub_registry_with_label("id", id.to_string()); +3087 sub_registry.register_all(endpoint.metrics()); +3088 } +3089 let mut registry = Registry::default(); +3090 register_endpoint(&mut registry, &client); +3091 register_endpoint(&mut registry, &server); +3092 let s = registry.encode_openmetrics_to_string()?; +3093 assert!(s.contains(r#"magicsock_nodes_contacted_directly_total{id="3b6a27bcce"} 1"#)); +3094 assert!(s.contains(r#"magicsock_nodes_contacted_directly_total{id="8a88e3dd74"} 1"#)); +3095 Ok(()) +3096 } +3097 +3098 /// Configures the accept side to take `accept_alpns` ALPNs, then connects to it with `primary_connect_alpn` +3099 /// with `secondary_connect_alpns` set, and finally returns the negotiated ALPN. +3100 async fn alpn_connection_test( +3101 accept_alpns: Vec<Vec<u8>>, +3102 primary_connect_alpn: &[u8], +3103 secondary_connect_alpns: Vec<Vec<u8>>, +3104 ) -> Result<Option<Vec<u8>>> { +3105 let client = Endpoint::builder() +3106 .relay_mode(RelayMode::Disabled) +3107 .bind() +3108 .await?; +3109 let server = Endpoint::builder() +3110 .relay_mode(RelayMode::Disabled) +3111 .alpns(accept_alpns) +3112 .bind() +3113 .await?; +3114 let server_addr = server.node_addr().initialized().await; +3115 let server_task = tokio::spawn({ +3116 let server = server.clone(); +3117 async move { +3118 let incoming = server.accept().await.e()?; +3119 let conn = incoming.await.e()?; +3120 conn.close(0u32.into(), b"bye!"); +3121 Ok::<_, n0_snafu::Error>(conn.alpn()) +3122 } +3123 }); +3124 +3125 let conn = client +3126 .connect_with_opts( +3127 server_addr, +3128 primary_connect_alpn, +3129 ConnectOptions::new().with_additional_alpns(secondary_connect_alpns), +3130 ) +3131 .await?; +3132 let conn = conn.await.e()?; +3133 let client_alpn = conn.alpn(); +3134 conn.closed().await; +3135 client.close().await; +3136 server.close().await; +3137 +3138 let server_alpn = server_task.await.e()??; +3139 +3140 assert_eq!(client_alpn, server_alpn); +3141 +3142 Ok(server_alpn) +3143 } 3144 -3145 assert_eq!( -3146 alpn_connection_test( -3147 // Prefer version 2 over version 1 on the accept side -3148 vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], -3149 ALPN_TWO, -3150 vec![ALPN_ONE.to_vec()], -3151 ) -3152 .await?, -3153 Some(ALPN_TWO.to_vec()), -3154 "accept side prefers version 2 over 1" -3155 ); -3156 -3157 assert_eq!( -3158 alpn_connection_test( -3159 // Only support the old version -3160 vec![ALPN_ONE.to_vec()], -3161 ALPN_TWO, -3162 vec![ALPN_ONE.to_vec()], -3163 ) -3164 .await?, -3165 Some(ALPN_ONE.to_vec()), -3166 "accept side only supports the old version" -3167 ); -3168 -3169 assert_eq!( -3170 alpn_connection_test( -3171 vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], -3172 ALPN_ONE, -3173 vec![ALPN_TWO.to_vec()], -3174 ) -3175 .await?, -3176 Some(ALPN_TWO.to_vec()), -3177 "connect side ALPN order doesn't matter" -3178 ); -3179 -3180 assert_eq!( -3181 alpn_connection_test(vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], ALPN_ONE, vec![],) -3182 .await?, -3183 Some(ALPN_ONE.to_vec()), -3184 "connect side only supports the old version" -3185 ); -3186 -3187 Ok(()) -3188 } -3189 -3190 #[tokio::test] -3191 #[traced_test] -3192 async fn watch_net_report() -> Result { -3193 let endpoint = Endpoint::builder() -3194 .relay_mode(RelayMode::Staging) -3195 .bind() -3196 .await?; -3197 -3198 // can get a first report -3199 endpoint.net_report().updated().await?; -3200 -3201 Ok(()) -3202 } +3145 #[tokio::test] +3146 #[traced_test] +3147 async fn connect_multiple_alpn_negotiated() -> Result { +3148 const ALPN_ONE: &[u8] = b"alpn/1"; +3149 const ALPN_TWO: &[u8] = b"alpn/2"; +3150 +3151 assert_eq!( +3152 alpn_connection_test( +3153 // Prefer version 2 over version 1 on the accept side +3154 vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], +3155 ALPN_TWO, +3156 vec![ALPN_ONE.to_vec()], +3157 ) +3158 .await?, +3159 Some(ALPN_TWO.to_vec()), +3160 "accept side prefers version 2 over 1" +3161 ); +3162 +3163 assert_eq!( +3164 alpn_connection_test( +3165 // Only support the old version +3166 vec![ALPN_ONE.to_vec()], +3167 ALPN_TWO, +3168 vec![ALPN_ONE.to_vec()], +3169 ) +3170 .await?, +3171 Some(ALPN_ONE.to_vec()), +3172 "accept side only supports the old version" +3173 ); +3174 +3175 assert_eq!( +3176 alpn_connection_test( +3177 vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], +3178 ALPN_ONE, +3179 vec![ALPN_TWO.to_vec()], +3180 ) +3181 .await?, +3182 Some(ALPN_TWO.to_vec()), +3183 "connect side ALPN order doesn't matter" +3184 ); +3185 +3186 assert_eq!( +3187 alpn_connection_test(vec![ALPN_TWO.to_vec(), ALPN_ONE.to_vec()], ALPN_ONE, vec![],) +3188 .await?, +3189 Some(ALPN_ONE.to_vec()), +3190 "connect side only supports the old version" +3191 ); +3192 +3193 Ok(()) +3194 } +3195 +3196 #[tokio::test] +3197 #[traced_test] +3198 async fn watch_net_report() -> Result { +3199 let endpoint = Endpoint::builder() +3200 .relay_mode(RelayMode::Staging) +3201 .bind() +3202 .await?; 3203 -3204 /// Tests that initial connection establishment isn't extremely slow compared -3205 /// to subsequent connections. -3206 /// -3207 /// This is a time based test, but uses a very large ratio to reduce flakiness. -3208 /// It also does a number of connections to average out any anomalies. -3209 #[tokio::test] -3210 #[traced_test] -3211 async fn connect_multi_time() -> Result { -3212 let n = 32; -3213 -3214 const NOOP_ALPN: &[u8] = b"noop"; -3215 -3216 #[derive(Debug, Clone)] -3217 struct Noop; -3218 -3219 impl ProtocolHandler for Noop { -3220 async fn accept(&self, connection: Connection) -> Result<(), AcceptError> { -3221 connection.closed().await; -3222 Ok(()) -3223 } -3224 } -3225 -3226 async fn noop_server() -> Result<(Router, NodeAddr)> { -3227 let endpoint = Endpoint::builder() -3228 .relay_mode(RelayMode::Disabled) -3229 .bind() -3230 .await -3231 .e()?; -3232 let addr = endpoint.node_addr().initialized().await; -3233 let router = Router::builder(endpoint).accept(NOOP_ALPN, Noop).spawn(); -3234 Ok((router, addr)) -3235 } -3236 -3237 let routers = stream::iter(0..n) -3238 .map(|_| noop_server()) -3239 .buffered_unordered(32) -3240 .collect::<Vec<_>>() -3241 .await -3242 .into_iter() -3243 .collect::<Result<Vec<_>, _>>() -3244 .e()?; -3245 -3246 let addrs = routers -3247 .iter() -3248 .map(|(_, addr)| addr.clone()) -3249 .collect::<Vec<_>>(); -3250 let ids = addrs.iter().map(|addr| addr.node_id).collect::<Vec<_>>(); -3251 let discovery = StaticProvider::from_node_info(addrs); -3252 let endpoint = Endpoint::builder() -3253 .relay_mode(RelayMode::Disabled) -3254 .discovery(discovery) -3255 .bind() -3256 .await -3257 .e()?; -3258 // wait for the endpoint to be initialized. This should not be needed, -3259 // but we don't want to measure endpoint init time but connection time -3260 // from a fully initialized endpoint. -3261 endpoint.node_addr().initialized().await; -3262 let t0 = Instant::now(); -3263 for id in &ids { -3264 let conn = endpoint.connect(*id, NOOP_ALPN).await?; -3265 conn.close(0u32.into(), b"done"); -3266 } -3267 let dt0 = t0.elapsed().as_secs_f64(); -3268 let t1 = Instant::now(); +3204 // can get a first report +3205 endpoint.net_report().updated().await?; +3206 +3207 Ok(()) +3208 } +3209 +3210 /// Tests that initial connection establishment isn't extremely slow compared +3211 /// to subsequent connections. +3212 /// +3213 /// This is a time based test, but uses a very large ratio to reduce flakiness. +3214 /// It also does a number of connections to average out any anomalies. +3215 #[tokio::test] +3216 #[traced_test] +3217 async fn connect_multi_time() -> Result { +3218 let n = 32; +3219 +3220 const NOOP_ALPN: &[u8] = b"noop"; +3221 +3222 #[derive(Debug, Clone)] +3223 struct Noop; +3224 +3225 impl ProtocolHandler for Noop { +3226 async fn accept(&self, connection: Connection) -> Result<(), AcceptError> { +3227 connection.closed().await; +3228 Ok(()) +3229 } +3230 } +3231 +3232 async fn noop_server() -> Result<(Router, NodeAddr)> { +3233 let endpoint = Endpoint::builder() +3234 .relay_mode(RelayMode::Disabled) +3235 .bind() +3236 .await +3237 .e()?; +3238 let addr = endpoint.node_addr().initialized().await; +3239 let router = Router::builder(endpoint).accept(NOOP_ALPN, Noop).spawn(); +3240 Ok((router, addr)) +3241 } +3242 +3243 let routers = stream::iter(0..n) +3244 .map(|_| noop_server()) +3245 .buffered_unordered(32) +3246 .collect::<Vec<_>>() +3247 .await +3248 .into_iter() +3249 .collect::<Result<Vec<_>, _>>() +3250 .e()?; +3251 +3252 let addrs = routers +3253 .iter() +3254 .map(|(_, addr)| addr.clone()) +3255 .collect::<Vec<_>>(); +3256 let ids = addrs.iter().map(|addr| addr.node_id).collect::<Vec<_>>(); +3257 let discovery = StaticProvider::from_node_info(addrs); +3258 let endpoint = Endpoint::builder() +3259 .relay_mode(RelayMode::Disabled) +3260 .discovery(discovery) +3261 .bind() +3262 .await +3263 .e()?; +3264 // wait for the endpoint to be initialized. This should not be needed, +3265 // but we don't want to measure endpoint init time but connection time +3266 // from a fully initialized endpoint. +3267 endpoint.node_addr().initialized().await; +3268 let t0 = Instant::now(); 3269 for id in &ids { 3270 let conn = endpoint.connect(*id, NOOP_ALPN).await?; 3271 conn.close(0u32.into(), b"done"); 3272 } -3273 let dt1 = t1.elapsed().as_secs_f64(); -3274 -3275 assert!(dt0 / dt1 < 20.0, "First round: {dt0}s, second round {dt1}s"); -3276 Ok(()) -3277 } -3278}
\ No newline at end of file +3273 let dt0 = t0.elapsed().as_secs_f64(); +3274 let t1 = Instant::now(); +3275 for id in &ids { +3276 let conn = endpoint.connect(*id, NOOP_ALPN).await?; +3277 conn.close(0u32.into(), b"done"); +3278 } +3279 let dt1 = t1.elapsed().as_secs_f64(); +3280 +3281 assert!(dt0 / dt1 < 20.0, "First round: {dt0}s, second round {dt1}s"); +3282 Ok(()) +3283 } +3284}

\ No newline at end of file diff --git a/pr/3465/docs/src/iroh/key.rs.html b/pr/3465/docs/src/iroh/key.rs.html index 551e2586ef..b6c7d2225d 100644 --- a/pr/3465/docs/src/iroh/key.rs.html +++ b/pr/3465/docs/src/iroh/key.rs.html @@ -81,76 +81,79 @@ 81 82#[cfg(test)] 83mod tests { -84 use super::*; +84 use rand::SeedableRng; 85 -86 fn shared(this: &iroh_base::SecretKey, other: &iroh_base::PublicKey) -> SharedSecret { -87 let secret_key = secret_ed_box(this.secret()); -88 let public_key = public_ed_box(&other.public()); -89 -90 SharedSecret::new(&secret_key, &public_key) -91 } -92 -93 #[test] -94 fn test_seal_open_roundtrip() { -95 let mut rng = rand::rng(); -96 let key_a = iroh_base::SecretKey::generate(&mut rng); -97 let key_b = iroh_base::SecretKey::generate(&mut rng); -98 -99 println!("a -> a"); -100 seal_open_roundtrip(&key_a, &key_a); -101 println!("b -> b"); -102 seal_open_roundtrip(&key_b, &key_b); -103 -104 println!("a -> b"); -105 seal_open_roundtrip(&key_a, &key_b); -106 println!("b -> a"); -107 seal_open_roundtrip(&key_b, &key_a); -108 } -109 -110 fn seal_open_roundtrip(key_a: &iroh_base::SecretKey, key_b: &iroh_base::SecretKey) { -111 let msg = b"super secret message!!!!".to_vec(); -112 let shared_a = shared(key_a, &key_b.public()); -113 let mut sealed_message = msg.clone(); -114 shared_a.seal(&mut sealed_message); -115 -116 let shared_b = shared(key_b, &key_a.public()); -117 let mut decrypted_message = sealed_message.clone(); -118 shared_b.open(&mut decrypted_message).unwrap(); -119 assert_eq!(&msg[..], &decrypted_message); -120 } -121 -122 #[test] -123 fn test_roundtrip_public_key() { -124 let key = crypto_box::SecretKey::generate(&mut rand::rng()); -125 let public_bytes = *key.public_key().as_bytes(); -126 let public_key_back = crypto_box::PublicKey::from(public_bytes); -127 assert_eq!(key.public_key(), public_key_back); -128 } -129 -130 #[test] -131 fn test_same_public_key_api() { -132 let key = iroh_base::SecretKey::generate(rand::rng()); -133 let public_key1: crypto_box::PublicKey = public_ed_box(&key.public().public()); -134 let public_key2: crypto_box::PublicKey = secret_ed_box(key.secret()).public_key(); -135 -136 assert_eq!(public_key1, public_key2); -137 } +86 use super::*; +87 +88 fn shared(this: &iroh_base::SecretKey, other: &iroh_base::PublicKey) -> SharedSecret { +89 let secret_key = secret_ed_box(this.secret()); +90 let public_key = public_ed_box(&other.public()); +91 +92 SharedSecret::new(&secret_key, &public_key) +93 } +94 +95 #[test] +96 fn test_seal_open_roundtrip() { +97 let mut rng = rand::rng(); +98 let key_a = iroh_base::SecretKey::generate(&mut rng); +99 let key_b = iroh_base::SecretKey::generate(&mut rng); +100 +101 println!("a -> a"); +102 seal_open_roundtrip(&key_a, &key_a); +103 println!("b -> b"); +104 seal_open_roundtrip(&key_b, &key_b); +105 +106 println!("a -> b"); +107 seal_open_roundtrip(&key_a, &key_b); +108 println!("b -> a"); +109 seal_open_roundtrip(&key_b, &key_a); +110 } +111 +112 fn seal_open_roundtrip(key_a: &iroh_base::SecretKey, key_b: &iroh_base::SecretKey) { +113 let msg = b"super secret message!!!!".to_vec(); +114 let shared_a = shared(key_a, &key_b.public()); +115 let mut sealed_message = msg.clone(); +116 shared_a.seal(&mut sealed_message); +117 +118 let shared_b = shared(key_b, &key_a.public()); +119 let mut decrypted_message = sealed_message.clone(); +120 shared_b.open(&mut decrypted_message).unwrap(); +121 assert_eq!(&msg[..], &decrypted_message); +122 } +123 +124 #[test] +125 fn test_roundtrip_public_key() { +126 let key = crypto_box::SecretKey::generate(&mut rand::rng()); +127 let public_bytes = *key.public_key().as_bytes(); +128 let public_key_back = crypto_box::PublicKey::from(public_bytes); +129 assert_eq!(key.public_key(), public_key_back); +130 } +131 +132 #[test] +133 fn test_same_public_key_api() { +134 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +135 let key = iroh_base::SecretKey::generate(&mut rng); +136 let public_key1: crypto_box::PublicKey = public_ed_box(&key.public().public()); +137 let public_key2: crypto_box::PublicKey = secret_ed_box(key.secret()).public_key(); 138 -139 #[test] -140 fn test_same_public_key_low_level() { -141 let mut rng = rand::rng(); -142 let key = ed25519_dalek::SigningKey::generate(&mut rng); -143 let public_key1 = { -144 let m = key.verifying_key().to_montgomery(); -145 crypto_box::PublicKey::from(m) -146 }; -147 -148 let public_key2 = { -149 let s = key.to_scalar(); -150 let cs = crypto_box::SecretKey::from(s); -151 cs.public_key() -152 }; -153 -154 assert_eq!(public_key1, public_key2); -155 } -156}
\ No newline at end of file +139 assert_eq!(public_key1, public_key2); +140 } +141 +142 #[test] +143 fn test_same_public_key_low_level() { +144 let mut rng = rand::rng(); +145 let key = ed25519_dalek::SigningKey::generate(&mut rng); +146 let public_key1 = { +147 let m = key.verifying_key().to_montgomery(); +148 crypto_box::PublicKey::from(m) +149 }; +150 +151 let public_key2 = { +152 let s = key.to_scalar(); +153 let cs = crypto_box::SecretKey::from(s); +154 cs.public_key() +155 }; +156 +157 assert_eq!(public_key1, public_key2); +158 } +159}

\ No newline at end of file diff --git a/pr/3465/docs/src/iroh/magicsock.rs.html b/pr/3465/docs/src/iroh/magicsock.rs.html index 68a78db7fa..4c6ba8a483 100644 --- a/pr/3465/docs/src/iroh/magicsock.rs.html +++ b/pr/3465/docs/src/iroh/magicsock.rs.html @@ -2536,7 +2536,7 @@ 2536 use n0_snafu::{Result, ResultExt}; 2537 use n0_watcher::Watcher; 2538 use quinn::ServerConfig; -2539 use rand::{Rng, RngCore}; +2539 use rand::{Rng, RngCore, SeedableRng}; 2540 use tokio::task::JoinSet; 2541 use tokio_util::task::AbortOnDropHandle; 2542 use tracing::{Instrument, error, info, info_span, instrument}; @@ -2555,885 +2555,887 @@ 2555 2556 impl Default for Options { 2557 fn default() -> Self { -2558 let secret_key = SecretKey::generate(rand::rng()); -2559 let server_config = make_default_server_config(&secret_key); -2560 Options { -2561 addr_v4: None, -2562 addr_v6: None, -2563 secret_key, -2564 relay_map: RelayMap::empty(), -2565 node_map: None, -2566 discovery: None, -2567 proxy_url: None, -2568 dns_resolver: DnsResolver::new(), -2569 server_config, -2570 #[cfg(any(test, feature = "test-utils"))] -2571 insecure_skip_relay_cert_verify: false, -2572 #[cfg(any(test, feature = "test-utils"))] -2573 path_selection: PathSelection::default(), -2574 discovery_user_data: None, -2575 metrics: Default::default(), -2576 } -2577 } -2578 } -2579 -2580 /// Generate a server config with no ALPNS and a default transport configuration -2581 fn make_default_server_config(secret_key: &SecretKey) -> ServerConfig { -2582 let quic_server_config = -2583 crate::tls::TlsConfig::new(secret_key.clone(), DEFAULT_MAX_TLS_TICKETS) -2584 .make_server_config(vec![], false); -2585 let mut server_config = ServerConfig::with_crypto(Arc::new(quic_server_config)); -2586 server_config.transport_config(Arc::new(quinn::TransportConfig::default())); -2587 server_config -2588 } -2589 -2590 impl MagicSock { -2591 #[track_caller] -2592 pub fn add_test_addr(&self, node_addr: NodeAddr) { -2593 self.add_node_addr( -2594 node_addr, -2595 Source::NamedApp { -2596 name: "test".into(), -2597 }, -2598 ) -2599 .unwrap() -2600 } -2601 } -2602 -2603 /// Magicsock plus wrappers for sending packets -2604 #[derive(Clone)] -2605 struct MagicStack { -2606 secret_key: SecretKey, -2607 endpoint: Endpoint, -2608 } -2609 -2610 impl MagicStack { -2611 async fn new(relay_mode: RelayMode) -> Self { -2612 let secret_key = SecretKey::generate(rand::rng()); -2613 -2614 let mut transport_config = quinn::TransportConfig::default(); -2615 transport_config.max_idle_timeout(Some(Duration::from_secs(10).try_into().unwrap())); -2616 -2617 let endpoint = Endpoint::builder() -2618 .secret_key(secret_key.clone()) -2619 .transport_config(transport_config) -2620 .relay_mode(relay_mode) -2621 .alpns(vec![ALPN.to_vec()]) -2622 .bind() -2623 .await -2624 .unwrap(); -2625 -2626 Self { -2627 secret_key, -2628 endpoint, -2629 } -2630 } -2631 -2632 fn tracked_endpoints(&self) -> Vec<PublicKey> { -2633 self.endpoint -2634 .magic_sock() -2635 .list_remote_infos() -2636 .into_iter() -2637 .map(|ep| ep.node_id) -2638 .collect() -2639 } -2640 -2641 fn public(&self) -> PublicKey { -2642 self.secret_key.public() -2643 } -2644 } -2645 -2646 /// Monitors endpoint changes and plumbs things together. -2647 /// -2648 /// This is a way of connecting endpoints without a relay server. Whenever the local -2649 /// endpoints of a magic endpoint change this address is added to the other magic -2650 /// sockets. This function will await until the endpoints are connected the first time -2651 /// before returning. -2652 /// -2653 /// When the returned drop guard is dropped, the tasks doing this updating are stopped. -2654 #[instrument(skip_all)] -2655 async fn mesh_stacks(stacks: Vec<MagicStack>) -> Result<JoinSet<()>> { -2656 /// Registers endpoint addresses of a node to all other nodes. -2657 fn update_direct_addrs( -2658 stacks: &[MagicStack], -2659 my_idx: usize, -2660 new_addrs: BTreeSet<DirectAddr>, -2661 ) { -2662 let me = &stacks[my_idx]; -2663 for (i, m) in stacks.iter().enumerate() { -2664 if i == my_idx { -2665 continue; -2666 } -2667 -2668 let addr = NodeAddr { -2669 node_id: me.public(), -2670 relay_url: None, -2671 direct_addresses: new_addrs.iter().map(|ep| ep.addr).collect(), -2672 }; -2673 m.endpoint.magic_sock().add_test_addr(addr); -2674 } -2675 } -2676 -2677 // For each node, start a task which monitors its local endpoints and registers them -2678 // with the other nodes as local endpoints become known. -2679 let mut tasks = JoinSet::new(); -2680 for (my_idx, m) in stacks.iter().enumerate() { -2681 let m = m.clone(); -2682 let stacks = stacks.clone(); -2683 tasks.spawn(async move { -2684 let me = m.endpoint.node_id().fmt_short(); -2685 let mut stream = m.endpoint.direct_addresses().stream().filter_map(|i| i); -2686 while let Some(new_eps) = stream.next().await { -2687 info!(%me, "conn{} endpoints update: {:?}", my_idx + 1, new_eps); -2688 update_direct_addrs(&stacks, my_idx, new_eps); -2689 } -2690 }); -2691 } -2692 -2693 // Wait for all nodes to be registered with each other. -2694 time::timeout(Duration::from_secs(10), async move { -2695 let all_node_ids: Vec<_> = stacks.iter().map(|ms| ms.endpoint.node_id()).collect(); -2696 loop { -2697 let mut ready = Vec::with_capacity(stacks.len()); -2698 for ms in stacks.iter() { -2699 let endpoints = ms.tracked_endpoints(); -2700 let my_node_id = ms.endpoint.node_id(); -2701 let all_nodes_meshed = all_node_ids -2702 .iter() -2703 .filter(|node_id| **node_id != my_node_id) -2704 .all(|node_id| endpoints.contains(node_id)); -2705 ready.push(all_nodes_meshed); -2706 } -2707 if ready.iter().all(|meshed| *meshed) { -2708 break; -2709 } -2710 time::sleep(Duration::from_millis(200)).await; -2711 } -2712 }) -2713 .await -2714 .context("timeout")?; -2715 info!("all nodes meshed"); -2716 Ok(tasks) -2717 } -2718 -2719 #[instrument(skip_all, fields(me = %ep.endpoint.node_id().fmt_short()))] -2720 async fn echo_receiver(ep: MagicStack, loss: ExpectedLoss) -> Result { -2721 info!("accepting conn"); -2722 let conn = ep.endpoint.accept().await.expect("no conn"); -2723 -2724 info!("connecting"); -2725 let conn = conn.await.context("connecting")?; -2726 info!("accepting bi"); -2727 let (mut send_bi, mut recv_bi) = conn.accept_bi().await.context("accept bi")?; -2728 -2729 info!("reading"); -2730 let val = recv_bi -2731 .read_to_end(usize::MAX) -2732 .await -2733 .context("read to end")?; -2734 -2735 info!("replying"); -2736 for chunk in val.chunks(12) { -2737 send_bi.write_all(chunk).await.context("write all")?; -2738 } -2739 -2740 info!("finishing"); -2741 send_bi.finish().context("finish")?; -2742 send_bi.stopped().await.context("stopped")?; -2743 -2744 let stats = conn.stats(); -2745 info!("stats: {:#?}", stats); -2746 // TODO: ensure panics in this function are reported ok -2747 if matches!(loss, ExpectedLoss::AlmostNone) { -2748 assert!( -2749 stats.path.lost_packets < 10, -2750 "[receiver] should not loose many packets", -2751 ); -2752 } -2753 -2754 info!("close"); -2755 conn.close(0u32.into(), b"done"); -2756 info!("wait idle"); -2757 ep.endpoint.endpoint().wait_idle().await; -2758 -2759 Ok(()) -2760 } -2761 -2762 #[instrument(skip_all, fields(me = %ep.endpoint.node_id().fmt_short()))] -2763 async fn echo_sender( -2764 ep: MagicStack, -2765 dest_id: PublicKey, -2766 msg: &[u8], -2767 loss: ExpectedLoss, -2768 ) -> Result { -2769 info!("connecting to {}", dest_id.fmt_short()); -2770 let dest = NodeAddr::new(dest_id); -2771 let conn = ep.endpoint.connect(dest, ALPN).await?; -2772 -2773 info!("opening bi"); -2774 let (mut send_bi, mut recv_bi) = conn.open_bi().await.context("open bi")?; -2775 -2776 info!("writing message"); -2777 send_bi.write_all(msg).await.context("write all")?; -2778 -2779 info!("finishing"); -2780 send_bi.finish().context("finish")?; -2781 send_bi.stopped().await.context("stopped")?; -2782 -2783 info!("reading_to_end"); -2784 let val = recv_bi -2785 .read_to_end(usize::MAX) -2786 .await -2787 .context("read to end")?; -2788 assert_eq!( -2789 val, -2790 msg, -2791 "[sender] expected {}, got {}", -2792 HEXLOWER.encode(msg), -2793 HEXLOWER.encode(&val) -2794 ); -2795 -2796 let stats = conn.stats(); -2797 info!("stats: {:#?}", stats); -2798 if matches!(loss, ExpectedLoss::AlmostNone) { -2799 assert!( -2800 stats.path.lost_packets < 10, -2801 "[sender] should not loose many packets", -2802 ); -2803 } -2804 -2805 info!("close"); -2806 conn.close(0u32.into(), b"done"); -2807 info!("wait idle"); -2808 ep.endpoint.endpoint().wait_idle().await; -2809 Ok(()) -2810 } -2811 -2812 #[derive(Debug, Copy, Clone)] -2813 enum ExpectedLoss { -2814 AlmostNone, -2815 YeahSure, -2816 } -2817 -2818 /// Runs a roundtrip between the [`echo_sender`] and [`echo_receiver`]. -2819 async fn run_roundtrip( -2820 sender: MagicStack, -2821 receiver: MagicStack, -2822 payload: &[u8], -2823 loss: ExpectedLoss, -2824 ) { -2825 let send_node_id = sender.endpoint.node_id(); -2826 let recv_node_id = receiver.endpoint.node_id(); -2827 info!("\nroundtrip: {send_node_id:#} -> {recv_node_id:#}"); -2828 -2829 let receiver_task = tokio::spawn(echo_receiver(receiver, loss)); -2830 let sender_res = echo_sender(sender, recv_node_id, payload, loss).await; -2831 let sender_is_err = match sender_res { -2832 Ok(()) => false, -2833 Err(err) => { -2834 eprintln!("[sender] Error:\n{err:#?}"); -2835 true -2836 } -2837 }; -2838 let receiver_is_err = match receiver_task.await { -2839 Ok(Ok(())) => false, -2840 Ok(Err(err)) => { -2841 eprintln!("[receiver] Error:\n{err:#?}"); -2842 true -2843 } -2844 Err(joinerr) => { -2845 if joinerr.is_panic() { -2846 std::panic::resume_unwind(joinerr.into_panic()); -2847 } else { -2848 eprintln!("[receiver] Error:\n{joinerr:#?}"); -2849 } -2850 true -2851 } -2852 }; -2853 if sender_is_err || receiver_is_err { -2854 panic!("Sender or receiver errored"); -2855 } -2856 } -2857 -2858 #[tokio::test(flavor = "multi_thread")] -2859 #[traced_test] -2860 async fn test_two_devices_roundtrip_quinn_magic() -> Result { -2861 let m1 = MagicStack::new(RelayMode::Disabled).await; -2862 let m2 = MagicStack::new(RelayMode::Disabled).await; -2863 -2864 let _guard = mesh_stacks(vec![m1.clone(), m2.clone()]).await?; +2558 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2559 let secret_key = SecretKey::generate(&mut rng); +2560 let server_config = make_default_server_config(&secret_key); +2561 Options { +2562 addr_v4: None, +2563 addr_v6: None, +2564 secret_key, +2565 relay_map: RelayMap::empty(), +2566 node_map: None, +2567 discovery: None, +2568 proxy_url: None, +2569 dns_resolver: DnsResolver::new(), +2570 server_config, +2571 #[cfg(any(test, feature = "test-utils"))] +2572 insecure_skip_relay_cert_verify: false, +2573 #[cfg(any(test, feature = "test-utils"))] +2574 path_selection: PathSelection::default(), +2575 discovery_user_data: None, +2576 metrics: Default::default(), +2577 } +2578 } +2579 } +2580 +2581 /// Generate a server config with no ALPNS and a default transport configuration +2582 fn make_default_server_config(secret_key: &SecretKey) -> ServerConfig { +2583 let quic_server_config = +2584 crate::tls::TlsConfig::new(secret_key.clone(), DEFAULT_MAX_TLS_TICKETS) +2585 .make_server_config(vec![], false); +2586 let mut server_config = ServerConfig::with_crypto(Arc::new(quic_server_config)); +2587 server_config.transport_config(Arc::new(quinn::TransportConfig::default())); +2588 server_config +2589 } +2590 +2591 impl MagicSock { +2592 #[track_caller] +2593 pub fn add_test_addr(&self, node_addr: NodeAddr) { +2594 self.add_node_addr( +2595 node_addr, +2596 Source::NamedApp { +2597 name: "test".into(), +2598 }, +2599 ) +2600 .unwrap() +2601 } +2602 } +2603 +2604 /// Magicsock plus wrappers for sending packets +2605 #[derive(Clone)] +2606 struct MagicStack { +2607 secret_key: SecretKey, +2608 endpoint: Endpoint, +2609 } +2610 +2611 impl MagicStack { +2612 async fn new(relay_mode: RelayMode) -> Self { +2613 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +2614 let secret_key = SecretKey::generate(&mut rng); +2615 +2616 let mut transport_config = quinn::TransportConfig::default(); +2617 transport_config.max_idle_timeout(Some(Duration::from_secs(10).try_into().unwrap())); +2618 +2619 let endpoint = Endpoint::builder() +2620 .secret_key(secret_key.clone()) +2621 .transport_config(transport_config) +2622 .relay_mode(relay_mode) +2623 .alpns(vec![ALPN.to_vec()]) +2624 .bind() +2625 .await +2626 .unwrap(); +2627 +2628 Self { +2629 secret_key, +2630 endpoint, +2631 } +2632 } +2633 +2634 fn tracked_endpoints(&self) -> Vec<PublicKey> { +2635 self.endpoint +2636 .magic_sock() +2637 .list_remote_infos() +2638 .into_iter() +2639 .map(|ep| ep.node_id) +2640 .collect() +2641 } +2642 +2643 fn public(&self) -> PublicKey { +2644 self.secret_key.public() +2645 } +2646 } +2647 +2648 /// Monitors endpoint changes and plumbs things together. +2649 /// +2650 /// This is a way of connecting endpoints without a relay server. Whenever the local +2651 /// endpoints of a magic endpoint change this address is added to the other magic +2652 /// sockets. This function will await until the endpoints are connected the first time +2653 /// before returning. +2654 /// +2655 /// When the returned drop guard is dropped, the tasks doing this updating are stopped. +2656 #[instrument(skip_all)] +2657 async fn mesh_stacks(stacks: Vec<MagicStack>) -> Result<JoinSet<()>> { +2658 /// Registers endpoint addresses of a node to all other nodes. +2659 fn update_direct_addrs( +2660 stacks: &[MagicStack], +2661 my_idx: usize, +2662 new_addrs: BTreeSet<DirectAddr>, +2663 ) { +2664 let me = &stacks[my_idx]; +2665 for (i, m) in stacks.iter().enumerate() { +2666 if i == my_idx { +2667 continue; +2668 } +2669 +2670 let addr = NodeAddr { +2671 node_id: me.public(), +2672 relay_url: None, +2673 direct_addresses: new_addrs.iter().map(|ep| ep.addr).collect(), +2674 }; +2675 m.endpoint.magic_sock().add_test_addr(addr); +2676 } +2677 } +2678 +2679 // For each node, start a task which monitors its local endpoints and registers them +2680 // with the other nodes as local endpoints become known. +2681 let mut tasks = JoinSet::new(); +2682 for (my_idx, m) in stacks.iter().enumerate() { +2683 let m = m.clone(); +2684 let stacks = stacks.clone(); +2685 tasks.spawn(async move { +2686 let me = m.endpoint.node_id().fmt_short(); +2687 let mut stream = m.endpoint.direct_addresses().stream().filter_map(|i| i); +2688 while let Some(new_eps) = stream.next().await { +2689 info!(%me, "conn{} endpoints update: {:?}", my_idx + 1, new_eps); +2690 update_direct_addrs(&stacks, my_idx, new_eps); +2691 } +2692 }); +2693 } +2694 +2695 // Wait for all nodes to be registered with each other. +2696 time::timeout(Duration::from_secs(10), async move { +2697 let all_node_ids: Vec<_> = stacks.iter().map(|ms| ms.endpoint.node_id()).collect(); +2698 loop { +2699 let mut ready = Vec::with_capacity(stacks.len()); +2700 for ms in stacks.iter() { +2701 let endpoints = ms.tracked_endpoints(); +2702 let my_node_id = ms.endpoint.node_id(); +2703 let all_nodes_meshed = all_node_ids +2704 .iter() +2705 .filter(|node_id| **node_id != my_node_id) +2706 .all(|node_id| endpoints.contains(node_id)); +2707 ready.push(all_nodes_meshed); +2708 } +2709 if ready.iter().all(|meshed| *meshed) { +2710 break; +2711 } +2712 time::sleep(Duration::from_millis(200)).await; +2713 } +2714 }) +2715 .await +2716 .context("timeout")?; +2717 info!("all nodes meshed"); +2718 Ok(tasks) +2719 } +2720 +2721 #[instrument(skip_all, fields(me = %ep.endpoint.node_id().fmt_short()))] +2722 async fn echo_receiver(ep: MagicStack, loss: ExpectedLoss) -> Result { +2723 info!("accepting conn"); +2724 let conn = ep.endpoint.accept().await.expect("no conn"); +2725 +2726 info!("connecting"); +2727 let conn = conn.await.context("connecting")?; +2728 info!("accepting bi"); +2729 let (mut send_bi, mut recv_bi) = conn.accept_bi().await.context("accept bi")?; +2730 +2731 info!("reading"); +2732 let val = recv_bi +2733 .read_to_end(usize::MAX) +2734 .await +2735 .context("read to end")?; +2736 +2737 info!("replying"); +2738 for chunk in val.chunks(12) { +2739 send_bi.write_all(chunk).await.context("write all")?; +2740 } +2741 +2742 info!("finishing"); +2743 send_bi.finish().context("finish")?; +2744 send_bi.stopped().await.context("stopped")?; +2745 +2746 let stats = conn.stats(); +2747 info!("stats: {:#?}", stats); +2748 // TODO: ensure panics in this function are reported ok +2749 if matches!(loss, ExpectedLoss::AlmostNone) { +2750 assert!( +2751 stats.path.lost_packets < 10, +2752 "[receiver] should not loose many packets", +2753 ); +2754 } +2755 +2756 info!("close"); +2757 conn.close(0u32.into(), b"done"); +2758 info!("wait idle"); +2759 ep.endpoint.endpoint().wait_idle().await; +2760 +2761 Ok(()) +2762 } +2763 +2764 #[instrument(skip_all, fields(me = %ep.endpoint.node_id().fmt_short()))] +2765 async fn echo_sender( +2766 ep: MagicStack, +2767 dest_id: PublicKey, +2768 msg: &[u8], +2769 loss: ExpectedLoss, +2770 ) -> Result { +2771 info!("connecting to {}", dest_id.fmt_short()); +2772 let dest = NodeAddr::new(dest_id); +2773 let conn = ep.endpoint.connect(dest, ALPN).await?; +2774 +2775 info!("opening bi"); +2776 let (mut send_bi, mut recv_bi) = conn.open_bi().await.context("open bi")?; +2777 +2778 info!("writing message"); +2779 send_bi.write_all(msg).await.context("write all")?; +2780 +2781 info!("finishing"); +2782 send_bi.finish().context("finish")?; +2783 send_bi.stopped().await.context("stopped")?; +2784 +2785 info!("reading_to_end"); +2786 let val = recv_bi +2787 .read_to_end(usize::MAX) +2788 .await +2789 .context("read to end")?; +2790 assert_eq!( +2791 val, +2792 msg, +2793 "[sender] expected {}, got {}", +2794 HEXLOWER.encode(msg), +2795 HEXLOWER.encode(&val) +2796 ); +2797 +2798 let stats = conn.stats(); +2799 info!("stats: {:#?}", stats); +2800 if matches!(loss, ExpectedLoss::AlmostNone) { +2801 assert!( +2802 stats.path.lost_packets < 10, +2803 "[sender] should not loose many packets", +2804 ); +2805 } +2806 +2807 info!("close"); +2808 conn.close(0u32.into(), b"done"); +2809 info!("wait idle"); +2810 ep.endpoint.endpoint().wait_idle().await; +2811 Ok(()) +2812 } +2813 +2814 #[derive(Debug, Copy, Clone)] +2815 enum ExpectedLoss { +2816 AlmostNone, +2817 YeahSure, +2818 } +2819 +2820 /// Runs a roundtrip between the [`echo_sender`] and [`echo_receiver`]. +2821 async fn run_roundtrip( +2822 sender: MagicStack, +2823 receiver: MagicStack, +2824 payload: &[u8], +2825 loss: ExpectedLoss, +2826 ) { +2827 let send_node_id = sender.endpoint.node_id(); +2828 let recv_node_id = receiver.endpoint.node_id(); +2829 info!("\nroundtrip: {send_node_id:#} -> {recv_node_id:#}"); +2830 +2831 let receiver_task = tokio::spawn(echo_receiver(receiver, loss)); +2832 let sender_res = echo_sender(sender, recv_node_id, payload, loss).await; +2833 let sender_is_err = match sender_res { +2834 Ok(()) => false, +2835 Err(err) => { +2836 eprintln!("[sender] Error:\n{err:#?}"); +2837 true +2838 } +2839 }; +2840 let receiver_is_err = match receiver_task.await { +2841 Ok(Ok(())) => false, +2842 Ok(Err(err)) => { +2843 eprintln!("[receiver] Error:\n{err:#?}"); +2844 true +2845 } +2846 Err(joinerr) => { +2847 if joinerr.is_panic() { +2848 std::panic::resume_unwind(joinerr.into_panic()); +2849 } else { +2850 eprintln!("[receiver] Error:\n{joinerr:#?}"); +2851 } +2852 true +2853 } +2854 }; +2855 if sender_is_err || receiver_is_err { +2856 panic!("Sender or receiver errored"); +2857 } +2858 } +2859 +2860 #[tokio::test(flavor = "multi_thread")] +2861 #[traced_test] +2862 async fn test_two_devices_roundtrip_quinn_magic() -> Result { +2863 let m1 = MagicStack::new(RelayMode::Disabled).await; +2864 let m2 = MagicStack::new(RelayMode::Disabled).await; 2865 -2866 for i in 0..5 { -2867 info!("\n-- round {i}"); -2868 run_roundtrip( -2869 m1.clone(), -2870 m2.clone(), -2871 b"hello m1", -2872 ExpectedLoss::AlmostNone, -2873 ) -2874 .await; -2875 run_roundtrip( -2876 m2.clone(), -2877 m1.clone(), -2878 b"hello m2", -2879 ExpectedLoss::AlmostNone, -2880 ) -2881 .await; -2882 -2883 info!("\n-- larger data"); -2884 let mut data = vec![0u8; 10 * 1024]; -2885 rand::rng().fill_bytes(&mut data); -2886 run_roundtrip(m1.clone(), m2.clone(), &data, ExpectedLoss::AlmostNone).await; -2887 run_roundtrip(m2.clone(), m1.clone(), &data, ExpectedLoss::AlmostNone).await; -2888 } -2889 -2890 Ok(()) -2891 } -2892 -2893 #[tokio::test] -2894 #[traced_test] -2895 async fn test_regression_network_change_rebind_wakes_connection_driver() -> n0_snafu::Result { -2896 let m1 = MagicStack::new(RelayMode::Disabled).await; -2897 let m2 = MagicStack::new(RelayMode::Disabled).await; -2898 -2899 println!("Net change"); -2900 m1.endpoint.magic_sock().force_network_change(true).await; -2901 tokio::time::sleep(Duration::from_secs(1)).await; // wait for socket rebinding -2902 -2903 let _guard = mesh_stacks(vec![m1.clone(), m2.clone()]).await?; +2866 let _guard = mesh_stacks(vec![m1.clone(), m2.clone()]).await?; +2867 +2868 for i in 0..5 { +2869 info!("\n-- round {i}"); +2870 run_roundtrip( +2871 m1.clone(), +2872 m2.clone(), +2873 b"hello m1", +2874 ExpectedLoss::AlmostNone, +2875 ) +2876 .await; +2877 run_roundtrip( +2878 m2.clone(), +2879 m1.clone(), +2880 b"hello m2", +2881 ExpectedLoss::AlmostNone, +2882 ) +2883 .await; +2884 +2885 info!("\n-- larger data"); +2886 let mut data = vec![0u8; 10 * 1024]; +2887 rand::rng().fill_bytes(&mut data); +2888 run_roundtrip(m1.clone(), m2.clone(), &data, ExpectedLoss::AlmostNone).await; +2889 run_roundtrip(m2.clone(), m1.clone(), &data, ExpectedLoss::AlmostNone).await; +2890 } +2891 +2892 Ok(()) +2893 } +2894 +2895 #[tokio::test] +2896 #[traced_test] +2897 async fn test_regression_network_change_rebind_wakes_connection_driver() -> n0_snafu::Result { +2898 let m1 = MagicStack::new(RelayMode::Disabled).await; +2899 let m2 = MagicStack::new(RelayMode::Disabled).await; +2900 +2901 println!("Net change"); +2902 m1.endpoint.magic_sock().force_network_change(true).await; +2903 tokio::time::sleep(Duration::from_secs(1)).await; // wait for socket rebinding 2904 -2905 let _handle = AbortOnDropHandle::new(tokio::spawn({ -2906 let endpoint = m2.endpoint.clone(); -2907 async move { -2908 while let Some(incoming) = endpoint.accept().await { -2909 println!("Incoming first conn!"); -2910 let conn = incoming.await.e()?; -2911 conn.closed().await; -2912 } -2913 -2914 Ok::<_, n0_snafu::Error>(()) -2915 } -2916 })); -2917 -2918 println!("first conn!"); -2919 let conn = m1 -2920 .endpoint -2921 .connect(m2.endpoint.node_addr().initialized().await, ALPN) -2922 .await?; -2923 println!("Closing first conn"); -2924 conn.close(0u32.into(), b"bye lolz"); -2925 conn.closed().await; -2926 println!("Closed first conn"); -2927 -2928 Ok(()) -2929 } -2930 -2931 #[tokio::test(flavor = "multi_thread")] -2932 #[traced_test] -2933 async fn test_two_devices_roundtrip_network_change() -> Result { -2934 time::timeout( -2935 Duration::from_secs(90), -2936 test_two_devices_roundtrip_network_change_impl(), -2937 ) -2938 .await -2939 .context("timeout")? -2940 } -2941 -2942 /// Same structure as `test_two_devices_roundtrip_quinn_magic`, but interrupts regularly -2943 /// with (simulated) network changes. -2944 async fn test_two_devices_roundtrip_network_change_impl() -> Result { -2945 let m1 = MagicStack::new(RelayMode::Disabled).await; -2946 let m2 = MagicStack::new(RelayMode::Disabled).await; -2947 -2948 let _guard = mesh_stacks(vec![m1.clone(), m2.clone()]).await?; +2905 let _guard = mesh_stacks(vec![m1.clone(), m2.clone()]).await?; +2906 +2907 let _handle = AbortOnDropHandle::new(tokio::spawn({ +2908 let endpoint = m2.endpoint.clone(); +2909 async move { +2910 while let Some(incoming) = endpoint.accept().await { +2911 println!("Incoming first conn!"); +2912 let conn = incoming.await.e()?; +2913 conn.closed().await; +2914 } +2915 +2916 Ok::<_, n0_snafu::Error>(()) +2917 } +2918 })); +2919 +2920 println!("first conn!"); +2921 let conn = m1 +2922 .endpoint +2923 .connect(m2.endpoint.node_addr().initialized().await, ALPN) +2924 .await?; +2925 println!("Closing first conn"); +2926 conn.close(0u32.into(), b"bye lolz"); +2927 conn.closed().await; +2928 println!("Closed first conn"); +2929 +2930 Ok(()) +2931 } +2932 +2933 #[tokio::test(flavor = "multi_thread")] +2934 #[traced_test] +2935 async fn test_two_devices_roundtrip_network_change() -> Result { +2936 time::timeout( +2937 Duration::from_secs(90), +2938 test_two_devices_roundtrip_network_change_impl(), +2939 ) +2940 .await +2941 .context("timeout")? +2942 } +2943 +2944 /// Same structure as `test_two_devices_roundtrip_quinn_magic`, but interrupts regularly +2945 /// with (simulated) network changes. +2946 async fn test_two_devices_roundtrip_network_change_impl() -> Result { +2947 let m1 = MagicStack::new(RelayMode::Disabled).await; +2948 let m2 = MagicStack::new(RelayMode::Disabled).await; 2949 -2950 let offset = || { -2951 let delay = rand::rng().random_range(10..=500); -2952 Duration::from_millis(delay) -2953 }; -2954 let rounds = 5; -2955 -2956 // Regular network changes to m1 only. -2957 let m1_network_change_guard = { -2958 let m1 = m1.clone(); -2959 let task = tokio::spawn(async move { -2960 loop { -2961 println!("[m1] network change"); -2962 m1.endpoint.magic_sock().force_network_change(true).await; -2963 time::sleep(offset()).await; -2964 } -2965 }); -2966 AbortOnDropHandle::new(task) -2967 }; -2968 -2969 for i in 0..rounds { -2970 println!("-- [m1 changes] round {}", i + 1); -2971 run_roundtrip(m1.clone(), m2.clone(), b"hello m1", ExpectedLoss::YeahSure).await; -2972 run_roundtrip(m2.clone(), m1.clone(), b"hello m2", ExpectedLoss::YeahSure).await; -2973 -2974 println!("-- [m1 changes] larger data"); -2975 let mut data = vec![0u8; 10 * 1024]; -2976 rand::rng().fill_bytes(&mut data); -2977 run_roundtrip(m1.clone(), m2.clone(), &data, ExpectedLoss::YeahSure).await; -2978 run_roundtrip(m2.clone(), m1.clone(), &data, ExpectedLoss::YeahSure).await; -2979 } -2980 -2981 std::mem::drop(m1_network_change_guard); +2950 let _guard = mesh_stacks(vec![m1.clone(), m2.clone()]).await?; +2951 +2952 let offset = || { +2953 let delay = rand::rng().random_range(10..=500); +2954 Duration::from_millis(delay) +2955 }; +2956 let rounds = 5; +2957 +2958 // Regular network changes to m1 only. +2959 let m1_network_change_guard = { +2960 let m1 = m1.clone(); +2961 let task = tokio::spawn(async move { +2962 loop { +2963 println!("[m1] network change"); +2964 m1.endpoint.magic_sock().force_network_change(true).await; +2965 time::sleep(offset()).await; +2966 } +2967 }); +2968 AbortOnDropHandle::new(task) +2969 }; +2970 +2971 for i in 0..rounds { +2972 println!("-- [m1 changes] round {}", i + 1); +2973 run_roundtrip(m1.clone(), m2.clone(), b"hello m1", ExpectedLoss::YeahSure).await; +2974 run_roundtrip(m2.clone(), m1.clone(), b"hello m2", ExpectedLoss::YeahSure).await; +2975 +2976 println!("-- [m1 changes] larger data"); +2977 let mut data = vec![0u8; 10 * 1024]; +2978 rand::rng().fill_bytes(&mut data); +2979 run_roundtrip(m1.clone(), m2.clone(), &data, ExpectedLoss::YeahSure).await; +2980 run_roundtrip(m2.clone(), m1.clone(), &data, ExpectedLoss::YeahSure).await; +2981 } 2982 -2983 // Regular network changes to m2 only. -2984 let m2_network_change_guard = { -2985 let m2 = m2.clone(); -2986 let task = tokio::spawn(async move { -2987 loop { -2988 println!("[m2] network change"); -2989 m2.endpoint.magic_sock().force_network_change(true).await; -2990 time::sleep(offset()).await; -2991 } -2992 }); -2993 AbortOnDropHandle::new(task) -2994 }; -2995 -2996 for i in 0..rounds { -2997 println!("-- [m2 changes] round {}", i + 1); -2998 run_roundtrip(m1.clone(), m2.clone(), b"hello m1", ExpectedLoss::YeahSure).await; -2999 run_roundtrip(m2.clone(), m1.clone(), b"hello m2", ExpectedLoss::YeahSure).await; -3000 -3001 println!("-- [m2 changes] larger data"); -3002 let mut data = vec![0u8; 10 * 1024]; -3003 rand::rng().fill_bytes(&mut data); -3004 run_roundtrip(m1.clone(), m2.clone(), &data, ExpectedLoss::YeahSure).await; -3005 run_roundtrip(m2.clone(), m1.clone(), &data, ExpectedLoss::YeahSure).await; -3006 } -3007 -3008 std::mem::drop(m2_network_change_guard); +2983 std::mem::drop(m1_network_change_guard); +2984 +2985 // Regular network changes to m2 only. +2986 let m2_network_change_guard = { +2987 let m2 = m2.clone(); +2988 let task = tokio::spawn(async move { +2989 loop { +2990 println!("[m2] network change"); +2991 m2.endpoint.magic_sock().force_network_change(true).await; +2992 time::sleep(offset()).await; +2993 } +2994 }); +2995 AbortOnDropHandle::new(task) +2996 }; +2997 +2998 for i in 0..rounds { +2999 println!("-- [m2 changes] round {}", i + 1); +3000 run_roundtrip(m1.clone(), m2.clone(), b"hello m1", ExpectedLoss::YeahSure).await; +3001 run_roundtrip(m2.clone(), m1.clone(), b"hello m2", ExpectedLoss::YeahSure).await; +3002 +3003 println!("-- [m2 changes] larger data"); +3004 let mut data = vec![0u8; 10 * 1024]; +3005 rand::rng().fill_bytes(&mut data); +3006 run_roundtrip(m1.clone(), m2.clone(), &data, ExpectedLoss::YeahSure).await; +3007 run_roundtrip(m2.clone(), m1.clone(), &data, ExpectedLoss::YeahSure).await; +3008 } 3009 -3010 // Regular network changes to both m1 and m2 only. -3011 let m1_m2_network_change_guard = { -3012 let m1 = m1.clone(); -3013 let m2 = m2.clone(); -3014 let task = tokio::spawn(async move { -3015 println!("-- [m1] network change"); -3016 m1.endpoint.magic_sock().force_network_change(true).await; -3017 println!("-- [m2] network change"); -3018 m2.endpoint.magic_sock().force_network_change(true).await; -3019 time::sleep(offset()).await; -3020 }); -3021 AbortOnDropHandle::new(task) -3022 }; -3023 -3024 for i in 0..rounds { -3025 println!("-- [m1 & m2 changes] round {}", i + 1); -3026 run_roundtrip(m1.clone(), m2.clone(), b"hello m1", ExpectedLoss::YeahSure).await; -3027 run_roundtrip(m2.clone(), m1.clone(), b"hello m2", ExpectedLoss::YeahSure).await; -3028 -3029 println!("-- [m1 & m2 changes] larger data"); -3030 let mut data = vec![0u8; 10 * 1024]; -3031 rand::rng().fill_bytes(&mut data); -3032 run_roundtrip(m1.clone(), m2.clone(), &data, ExpectedLoss::YeahSure).await; -3033 run_roundtrip(m2.clone(), m1.clone(), &data, ExpectedLoss::YeahSure).await; -3034 } -3035 -3036 std::mem::drop(m1_m2_network_change_guard); -3037 Ok(()) -3038 } -3039 -3040 #[tokio::test(flavor = "multi_thread")] -3041 #[traced_test] -3042 async fn test_two_devices_setup_teardown() -> Result { -3043 for i in 0..10 { -3044 println!("-- round {i}"); -3045 println!("setting up magic stack"); -3046 let m1 = MagicStack::new(RelayMode::Disabled).await; -3047 let m2 = MagicStack::new(RelayMode::Disabled).await; -3048 -3049 let _guard = mesh_stacks(vec![m1.clone(), m2.clone()]).await?; +3010 std::mem::drop(m2_network_change_guard); +3011 +3012 // Regular network changes to both m1 and m2 only. +3013 let m1_m2_network_change_guard = { +3014 let m1 = m1.clone(); +3015 let m2 = m2.clone(); +3016 let task = tokio::spawn(async move { +3017 println!("-- [m1] network change"); +3018 m1.endpoint.magic_sock().force_network_change(true).await; +3019 println!("-- [m2] network change"); +3020 m2.endpoint.magic_sock().force_network_change(true).await; +3021 time::sleep(offset()).await; +3022 }); +3023 AbortOnDropHandle::new(task) +3024 }; +3025 +3026 for i in 0..rounds { +3027 println!("-- [m1 & m2 changes] round {}", i + 1); +3028 run_roundtrip(m1.clone(), m2.clone(), b"hello m1", ExpectedLoss::YeahSure).await; +3029 run_roundtrip(m2.clone(), m1.clone(), b"hello m2", ExpectedLoss::YeahSure).await; +3030 +3031 println!("-- [m1 & m2 changes] larger data"); +3032 let mut data = vec![0u8; 10 * 1024]; +3033 rand::rng().fill_bytes(&mut data); +3034 run_roundtrip(m1.clone(), m2.clone(), &data, ExpectedLoss::YeahSure).await; +3035 run_roundtrip(m2.clone(), m1.clone(), &data, ExpectedLoss::YeahSure).await; +3036 } +3037 +3038 std::mem::drop(m1_m2_network_change_guard); +3039 Ok(()) +3040 } +3041 +3042 #[tokio::test(flavor = "multi_thread")] +3043 #[traced_test] +3044 async fn test_two_devices_setup_teardown() -> Result { +3045 for i in 0..10 { +3046 println!("-- round {i}"); +3047 println!("setting up magic stack"); +3048 let m1 = MagicStack::new(RelayMode::Disabled).await; +3049 let m2 = MagicStack::new(RelayMode::Disabled).await; 3050 -3051 println!("closing endpoints"); -3052 let msock1 = m1.endpoint.magic_sock(); -3053 let msock2 = m2.endpoint.magic_sock(); -3054 m1.endpoint.close().await; -3055 m2.endpoint.close().await; -3056 -3057 assert!(msock1.msock.is_closed()); -3058 assert!(msock2.msock.is_closed()); -3059 } -3060 Ok(()) -3061 } -3062 -3063 #[tokio::test] -3064 #[traced_test] -3065 async fn test_local_endpoints() { -3066 let ms = Handle::new(Default::default()).await.unwrap(); -3067 -3068 // See if we can get endpoints. -3069 let eps0 = ms.direct_addresses().initialized().await; -3070 println!("{eps0:?}"); -3071 assert!(!eps0.is_empty()); -3072 -3073 // Getting the endpoints again immediately should give the same results. -3074 let eps1 = ms.direct_addresses().initialized().await; -3075 println!("{eps1:?}"); -3076 assert_eq!(eps0, eps1); -3077 } -3078 -3079 /// Creates a new [`quinn::Endpoint`] hooked up to a [`MagicSock`]. -3080 /// -3081 /// This is without involving [`crate::endpoint::Endpoint`]. The socket will accept -3082 /// connections using [`ALPN`]. -3083 /// -3084 /// Use [`magicsock_connect`] to establish connections. -3085 #[instrument(name = "ep", skip_all, fields(me = %secret_key.public().fmt_short()))] -3086 async fn magicsock_ep(secret_key: SecretKey) -> Result<Handle> { -3087 let quic_server_config = tls::TlsConfig::new(secret_key.clone(), DEFAULT_MAX_TLS_TICKETS) -3088 .make_server_config(vec![ALPN.to_vec()], true); -3089 let mut server_config = ServerConfig::with_crypto(Arc::new(quic_server_config)); -3090 server_config.transport_config(Arc::new(quinn::TransportConfig::default())); -3091 -3092 let dns_resolver = DnsResolver::new(); -3093 let opts = Options { -3094 addr_v4: None, -3095 addr_v6: None, -3096 secret_key: secret_key.clone(), -3097 relay_map: RelayMap::empty(), -3098 node_map: None, -3099 discovery: None, -3100 discovery_user_data: None, -3101 dns_resolver, -3102 proxy_url: None, -3103 server_config, -3104 insecure_skip_relay_cert_verify: false, -3105 path_selection: PathSelection::default(), -3106 metrics: Default::default(), -3107 }; -3108 let msock = MagicSock::spawn(opts).await?; -3109 Ok(msock) -3110 } -3111 -3112 /// Connects from `ep` returned by [`magicsock_ep`] to the `node_id`. -3113 /// -3114 /// Uses [`ALPN`], `node_id`, must match `addr`. -3115 #[instrument(name = "connect", skip_all, fields(me = %ep_secret_key.public().fmt_short()))] -3116 async fn magicsock_connect( -3117 ep: &quinn::Endpoint, -3118 ep_secret_key: SecretKey, -3119 addr: NodeIdMappedAddr, -3120 node_id: NodeId, -3121 ) -> Result<quinn::Connection> { -3122 // Endpoint::connect sets this, do the same to have similar behaviour. -3123 let mut transport_config = quinn::TransportConfig::default(); -3124 transport_config.keep_alive_interval(Some(Duration::from_secs(1))); -3125 -3126 magicsock_connect_with_transport_config( -3127 ep, -3128 ep_secret_key, -3129 addr, -3130 node_id, -3131 Arc::new(transport_config), -3132 ) -3133 .await -3134 } -3135 -3136 /// Connects from `ep` returned by [`magicsock_ep`] to the `node_id`. -3137 /// -3138 /// This version allows customising the transport config. +3051 let _guard = mesh_stacks(vec![m1.clone(), m2.clone()]).await?; +3052 +3053 println!("closing endpoints"); +3054 let msock1 = m1.endpoint.magic_sock(); +3055 let msock2 = m2.endpoint.magic_sock(); +3056 m1.endpoint.close().await; +3057 m2.endpoint.close().await; +3058 +3059 assert!(msock1.msock.is_closed()); +3060 assert!(msock2.msock.is_closed()); +3061 } +3062 Ok(()) +3063 } +3064 +3065 #[tokio::test] +3066 #[traced_test] +3067 async fn test_local_endpoints() { +3068 let ms = Handle::new(Default::default()).await.unwrap(); +3069 +3070 // See if we can get endpoints. +3071 let eps0 = ms.direct_addresses().initialized().await; +3072 println!("{eps0:?}"); +3073 assert!(!eps0.is_empty()); +3074 +3075 // Getting the endpoints again immediately should give the same results. +3076 let eps1 = ms.direct_addresses().initialized().await; +3077 println!("{eps1:?}"); +3078 assert_eq!(eps0, eps1); +3079 } +3080 +3081 /// Creates a new [`quinn::Endpoint`] hooked up to a [`MagicSock`]. +3082 /// +3083 /// This is without involving [`crate::endpoint::Endpoint`]. The socket will accept +3084 /// connections using [`ALPN`]. +3085 /// +3086 /// Use [`magicsock_connect`] to establish connections. +3087 #[instrument(name = "ep", skip_all, fields(me = %secret_key.public().fmt_short()))] +3088 async fn magicsock_ep(secret_key: SecretKey) -> Result<Handle> { +3089 let quic_server_config = tls::TlsConfig::new(secret_key.clone(), DEFAULT_MAX_TLS_TICKETS) +3090 .make_server_config(vec![ALPN.to_vec()], true); +3091 let mut server_config = ServerConfig::with_crypto(Arc::new(quic_server_config)); +3092 server_config.transport_config(Arc::new(quinn::TransportConfig::default())); +3093 +3094 let dns_resolver = DnsResolver::new(); +3095 let opts = Options { +3096 addr_v4: None, +3097 addr_v6: None, +3098 secret_key: secret_key.clone(), +3099 relay_map: RelayMap::empty(), +3100 node_map: None, +3101 discovery: None, +3102 discovery_user_data: None, +3103 dns_resolver, +3104 proxy_url: None, +3105 server_config, +3106 insecure_skip_relay_cert_verify: false, +3107 path_selection: PathSelection::default(), +3108 metrics: Default::default(), +3109 }; +3110 let msock = MagicSock::spawn(opts).await?; +3111 Ok(msock) +3112 } +3113 +3114 /// Connects from `ep` returned by [`magicsock_ep`] to the `node_id`. +3115 /// +3116 /// Uses [`ALPN`], `node_id`, must match `addr`. +3117 #[instrument(name = "connect", skip_all, fields(me = %ep_secret_key.public().fmt_short()))] +3118 async fn magicsock_connect( +3119 ep: &quinn::Endpoint, +3120 ep_secret_key: SecretKey, +3121 addr: NodeIdMappedAddr, +3122 node_id: NodeId, +3123 ) -> Result<quinn::Connection> { +3124 // Endpoint::connect sets this, do the same to have similar behaviour. +3125 let mut transport_config = quinn::TransportConfig::default(); +3126 transport_config.keep_alive_interval(Some(Duration::from_secs(1))); +3127 +3128 magicsock_connect_with_transport_config( +3129 ep, +3130 ep_secret_key, +3131 addr, +3132 node_id, +3133 Arc::new(transport_config), +3134 ) +3135 .await +3136 } +3137 +3138 /// Connects from `ep` returned by [`magicsock_ep`] to the `node_id`. 3139 /// -3140 /// Uses [`ALPN`], `node_id`, must match `addr`. -3141 #[instrument(name = "connect", skip_all, fields(me = %ep_secret_key.public().fmt_short()))] -3142 async fn magicsock_connect_with_transport_config( -3143 ep: &quinn::Endpoint, -3144 ep_secret_key: SecretKey, -3145 mapped_addr: NodeIdMappedAddr, -3146 node_id: NodeId, -3147 transport_config: Arc<quinn::TransportConfig>, -3148 ) -> Result<quinn::Connection> { -3149 let alpns = vec![ALPN.to_vec()]; -3150 let quic_client_config = -3151 tls::TlsConfig::new(ep_secret_key.clone(), DEFAULT_MAX_TLS_TICKETS) -3152 .make_client_config(alpns, true); -3153 let mut client_config = quinn::ClientConfig::new(Arc::new(quic_client_config)); -3154 client_config.transport_config(transport_config); -3155 let connect = ep -3156 .connect_with( -3157 client_config, -3158 mapped_addr.private_socket_addr(), -3159 &tls::name::encode(node_id), -3160 ) -3161 .context("connect")?; -3162 let connection = connect.await.e()?; -3163 Ok(connection) -3164 } -3165 -3166 #[tokio::test] -3167 #[traced_test] -3168 async fn test_try_send_no_send_addr() { -3169 // Regression test: if there is no send_addr we should keep being able to use the -3170 // Endpoint. -3171 -3172 let secret_key_1 = SecretKey::from_bytes(&[1u8; 32]); -3173 let secret_key_2 = SecretKey::from_bytes(&[2u8; 32]); -3174 let node_id_2 = secret_key_2.public(); -3175 let secret_key_missing_node = SecretKey::from_bytes(&[255u8; 32]); -3176 let node_id_missing_node = secret_key_missing_node.public(); -3177 -3178 let msock_1 = magicsock_ep(secret_key_1.clone()).await.unwrap(); +3140 /// This version allows customising the transport config. +3141 /// +3142 /// Uses [`ALPN`], `node_id`, must match `addr`. +3143 #[instrument(name = "connect", skip_all, fields(me = %ep_secret_key.public().fmt_short()))] +3144 async fn magicsock_connect_with_transport_config( +3145 ep: &quinn::Endpoint, +3146 ep_secret_key: SecretKey, +3147 mapped_addr: NodeIdMappedAddr, +3148 node_id: NodeId, +3149 transport_config: Arc<quinn::TransportConfig>, +3150 ) -> Result<quinn::Connection> { +3151 let alpns = vec![ALPN.to_vec()]; +3152 let quic_client_config = +3153 tls::TlsConfig::new(ep_secret_key.clone(), DEFAULT_MAX_TLS_TICKETS) +3154 .make_client_config(alpns, true); +3155 let mut client_config = quinn::ClientConfig::new(Arc::new(quic_client_config)); +3156 client_config.transport_config(transport_config); +3157 let connect = ep +3158 .connect_with( +3159 client_config, +3160 mapped_addr.private_socket_addr(), +3161 &tls::name::encode(node_id), +3162 ) +3163 .context("connect")?; +3164 let connection = connect.await.e()?; +3165 Ok(connection) +3166 } +3167 +3168 #[tokio::test] +3169 #[traced_test] +3170 async fn test_try_send_no_send_addr() { +3171 // Regression test: if there is no send_addr we should keep being able to use the +3172 // Endpoint. +3173 +3174 let secret_key_1 = SecretKey::from_bytes(&[1u8; 32]); +3175 let secret_key_2 = SecretKey::from_bytes(&[2u8; 32]); +3176 let node_id_2 = secret_key_2.public(); +3177 let secret_key_missing_node = SecretKey::from_bytes(&[255u8; 32]); +3178 let node_id_missing_node = secret_key_missing_node.public(); 3179 -3180 // Generate an address not present in the NodeMap. -3181 let bad_addr = NodeIdMappedAddr::generate(); -3182 -3183 // 500ms is rather fast here. Running this locally it should always be the correct -3184 // timeout. If this is too slow however the test will not become flaky as we are -3185 // expecting the timeout, we might just get the timeout for the wrong reason. But -3186 // this speeds up the test. -3187 let res = tokio::time::timeout( -3188 Duration::from_millis(500), -3189 magicsock_connect( -3190 msock_1.endpoint(), -3191 secret_key_1.clone(), -3192 bad_addr, -3193 node_id_missing_node, -3194 ), -3195 ) -3196 .await; -3197 assert!(res.is_err(), "expecting timeout"); -3198 -3199 // Now check we can still create another connection with this endpoint. -3200 let msock_2 = magicsock_ep(secret_key_2.clone()).await.unwrap(); -3201 -3202 // This needs an accept task -3203 let accept_task = tokio::spawn({ -3204 async fn accept(ep: quinn::Endpoint) -> Result<()> { -3205 let incoming = ep.accept().await.context("no incoming")?; -3206 let _conn = incoming -3207 .accept() -3208 .context("accept")? -3209 .await -3210 .context("connecting")?; -3211 -3212 // Keep this connection alive for a while -3213 tokio::time::sleep(Duration::from_secs(10)).await; -3214 info!("accept finished"); -3215 Ok(()) -3216 } -3217 let ep = msock_2.endpoint().clone(); -3218 async move { -3219 if let Err(err) = accept(ep).await { -3220 error!("{err:#}"); -3221 } -3222 } -3223 .instrument(info_span!("ep2.accept, me = node_id_2.fmt_short()")) -3224 }); -3225 let _accept_task = AbortOnDropHandle::new(accept_task); -3226 -3227 let node_addr_2 = NodeAddr { -3228 node_id: node_id_2, -3229 relay_url: None, -3230 direct_addresses: msock_2 -3231 .direct_addresses() -3232 .initialized() -3233 .await -3234 .into_iter() -3235 .map(|x| x.addr) -3236 .collect(), -3237 }; -3238 msock_1 -3239 .add_node_addr( -3240 node_addr_2, -3241 Source::NamedApp { -3242 name: "test".into(), -3243 }, -3244 ) -3245 .unwrap(); -3246 let addr = msock_1.get_mapping_addr(node_id_2).unwrap(); -3247 let res = tokio::time::timeout( -3248 Duration::from_secs(10), -3249 magicsock_connect(msock_1.endpoint(), secret_key_1.clone(), addr, node_id_2), -3250 ) -3251 .await -3252 .expect("timeout while connecting"); -3253 -3254 // aka assert!(res.is_ok()) but with nicer error reporting. -3255 res.unwrap(); -3256 -3257 // TODO: Now check if we can connect to a repaired ep_3, but we can't modify that -3258 // much internal state for now. -3259 } -3260 -3261 #[tokio::test] -3262 #[traced_test] -3263 async fn test_try_send_no_udp_addr_or_relay_url() { -3264 // This specifically tests the `if udp_addr.is_none() && relay_url.is_none()` -3265 // behaviour of MagicSock::try_send. -3266 -3267 let secret_key_1 = SecretKey::from_bytes(&[1u8; 32]); -3268 let secret_key_2 = SecretKey::from_bytes(&[2u8; 32]); -3269 let node_id_2 = secret_key_2.public(); -3270 -3271 let msock_1 = magicsock_ep(secret_key_1.clone()).await.unwrap(); -3272 let msock_2 = magicsock_ep(secret_key_2.clone()).await.unwrap(); -3273 let ep_2 = msock_2.endpoint().clone(); -3274 -3275 // We need a task to accept the connection. -3276 let accept_task = tokio::spawn({ -3277 async fn accept(ep: quinn::Endpoint) -> Result<()> { -3278 let incoming = ep.accept().await.context("no incoming")?; -3279 let conn = incoming -3280 .accept() -3281 .context("accept")? -3282 .await -3283 .context("connecting")?; -3284 let mut stream = conn.accept_uni().await.context("accept uni")?; -3285 stream.read_to_end(1 << 16).await.context("read to end")?; -3286 info!("accept finished"); -3287 Ok(()) -3288 } -3289 async move { -3290 if let Err(err) = accept(ep_2).await { -3291 error!("{err:#}"); -3292 } -3293 } -3294 .instrument(info_span!("ep2.accept", me = %node_id_2.fmt_short())) -3295 }); -3296 let _accept_task = AbortOnDropHandle::new(accept_task); -3297 -3298 // Add an empty entry in the NodeMap of ep_1 -3299 msock_1.node_map.add_node_addr( -3300 NodeAddr { -3301 node_id: node_id_2, -3302 relay_url: None, -3303 direct_addresses: Default::default(), -3304 }, -3305 Source::NamedApp { -3306 name: "test".into(), -3307 }, -3308 true, -3309 &msock_1.metrics.magicsock, -3310 ); -3311 let addr_2 = msock_1.get_mapping_addr(node_id_2).unwrap(); -3312 -3313 // Set a low max_idle_timeout so quinn gives up on this quickly and our test does -3314 // not take forever. You need to check the log output to verify this is really -3315 // triggering the correct error. -3316 // In test_try_send_no_send_addr() above you may have noticed we used -3317 // tokio::time::timeout() on the connection attempt instead. Here however we want -3318 // Quinn itself to have fully given up on the connection attempt because we will -3319 // later connect to **the same** node. If Quinn did not give up on the connection -3320 // we'd close it on drop, and the retransmits of the close packets would interfere -3321 // with the next handshake, closing it during the handshake. This makes the test a -3322 // little slower though. -3323 let mut transport_config = quinn::TransportConfig::default(); -3324 transport_config.max_idle_timeout(Some(Duration::from_millis(200).try_into().unwrap())); -3325 let res = magicsock_connect_with_transport_config( -3326 msock_1.endpoint(), -3327 secret_key_1.clone(), -3328 addr_2, -3329 node_id_2, -3330 Arc::new(transport_config), -3331 ) -3332 .await; -3333 assert!(res.is_err(), "expected timeout"); -3334 info!("first connect timed out as expected"); -3335 -3336 // Provide correct addressing information -3337 msock_1.node_map.add_node_addr( -3338 NodeAddr { -3339 node_id: node_id_2, -3340 relay_url: None, -3341 direct_addresses: msock_2 -3342 .direct_addresses() -3343 .initialized() -3344 .await -3345 .into_iter() -3346 .map(|x| x.addr) -3347 .collect(), -3348 }, -3349 Source::NamedApp { -3350 name: "test".into(), -3351 }, -3352 true, -3353 &msock_1.metrics.magicsock, -3354 ); -3355 -3356 // We can now connect -3357 tokio::time::timeout(Duration::from_secs(10), async move { -3358 info!("establishing new connection"); -3359 let conn = -3360 magicsock_connect(msock_1.endpoint(), secret_key_1.clone(), addr_2, node_id_2) -3361 .await -3362 .unwrap(); -3363 info!("have connection"); -3364 let mut stream = conn.open_uni().await.unwrap(); -3365 stream.write_all(b"hello").await.unwrap(); -3366 stream.finish().unwrap(); -3367 stream.stopped().await.unwrap(); -3368 info!("finished stream"); -3369 }) -3370 .await -3371 .expect("connection timed out"); -3372 -3373 // TODO: could remove the addresses again, send, add it back and see it recover. -3374 // But we don't have that much private access to the NodeMap. This will do for now. -3375 } -3376 -3377 #[tokio::test] -3378 async fn test_add_node_addr() -> Result { -3379 let stack = MagicStack::new(RelayMode::Default).await; -3380 let mut rng = rand::rng(); -3381 -3382 assert_eq!(stack.endpoint.magic_sock().node_map.node_count(), 0); +3180 let msock_1 = magicsock_ep(secret_key_1.clone()).await.unwrap(); +3181 +3182 // Generate an address not present in the NodeMap. +3183 let bad_addr = NodeIdMappedAddr::generate(); +3184 +3185 // 500ms is rather fast here. Running this locally it should always be the correct +3186 // timeout. If this is too slow however the test will not become flaky as we are +3187 // expecting the timeout, we might just get the timeout for the wrong reason. But +3188 // this speeds up the test. +3189 let res = tokio::time::timeout( +3190 Duration::from_millis(500), +3191 magicsock_connect( +3192 msock_1.endpoint(), +3193 secret_key_1.clone(), +3194 bad_addr, +3195 node_id_missing_node, +3196 ), +3197 ) +3198 .await; +3199 assert!(res.is_err(), "expecting timeout"); +3200 +3201 // Now check we can still create another connection with this endpoint. +3202 let msock_2 = magicsock_ep(secret_key_2.clone()).await.unwrap(); +3203 +3204 // This needs an accept task +3205 let accept_task = tokio::spawn({ +3206 async fn accept(ep: quinn::Endpoint) -> Result<()> { +3207 let incoming = ep.accept().await.context("no incoming")?; +3208 let _conn = incoming +3209 .accept() +3210 .context("accept")? +3211 .await +3212 .context("connecting")?; +3213 +3214 // Keep this connection alive for a while +3215 tokio::time::sleep(Duration::from_secs(10)).await; +3216 info!("accept finished"); +3217 Ok(()) +3218 } +3219 let ep = msock_2.endpoint().clone(); +3220 async move { +3221 if let Err(err) = accept(ep).await { +3222 error!("{err:#}"); +3223 } +3224 } +3225 .instrument(info_span!("ep2.accept, me = node_id_2.fmt_short()")) +3226 }); +3227 let _accept_task = AbortOnDropHandle::new(accept_task); +3228 +3229 let node_addr_2 = NodeAddr { +3230 node_id: node_id_2, +3231 relay_url: None, +3232 direct_addresses: msock_2 +3233 .direct_addresses() +3234 .initialized() +3235 .await +3236 .into_iter() +3237 .map(|x| x.addr) +3238 .collect(), +3239 }; +3240 msock_1 +3241 .add_node_addr( +3242 node_addr_2, +3243 Source::NamedApp { +3244 name: "test".into(), +3245 }, +3246 ) +3247 .unwrap(); +3248 let addr = msock_1.get_mapping_addr(node_id_2).unwrap(); +3249 let res = tokio::time::timeout( +3250 Duration::from_secs(10), +3251 magicsock_connect(msock_1.endpoint(), secret_key_1.clone(), addr, node_id_2), +3252 ) +3253 .await +3254 .expect("timeout while connecting"); +3255 +3256 // aka assert!(res.is_ok()) but with nicer error reporting. +3257 res.unwrap(); +3258 +3259 // TODO: Now check if we can connect to a repaired ep_3, but we can't modify that +3260 // much internal state for now. +3261 } +3262 +3263 #[tokio::test] +3264 #[traced_test] +3265 async fn test_try_send_no_udp_addr_or_relay_url() { +3266 // This specifically tests the `if udp_addr.is_none() && relay_url.is_none()` +3267 // behaviour of MagicSock::try_send. +3268 +3269 let secret_key_1 = SecretKey::from_bytes(&[1u8; 32]); +3270 let secret_key_2 = SecretKey::from_bytes(&[2u8; 32]); +3271 let node_id_2 = secret_key_2.public(); +3272 +3273 let msock_1 = magicsock_ep(secret_key_1.clone()).await.unwrap(); +3274 let msock_2 = magicsock_ep(secret_key_2.clone()).await.unwrap(); +3275 let ep_2 = msock_2.endpoint().clone(); +3276 +3277 // We need a task to accept the connection. +3278 let accept_task = tokio::spawn({ +3279 async fn accept(ep: quinn::Endpoint) -> Result<()> { +3280 let incoming = ep.accept().await.context("no incoming")?; +3281 let conn = incoming +3282 .accept() +3283 .context("accept")? +3284 .await +3285 .context("connecting")?; +3286 let mut stream = conn.accept_uni().await.context("accept uni")?; +3287 stream.read_to_end(1 << 16).await.context("read to end")?; +3288 info!("accept finished"); +3289 Ok(()) +3290 } +3291 async move { +3292 if let Err(err) = accept(ep_2).await { +3293 error!("{err:#}"); +3294 } +3295 } +3296 .instrument(info_span!("ep2.accept", me = %node_id_2.fmt_short())) +3297 }); +3298 let _accept_task = AbortOnDropHandle::new(accept_task); +3299 +3300 // Add an empty entry in the NodeMap of ep_1 +3301 msock_1.node_map.add_node_addr( +3302 NodeAddr { +3303 node_id: node_id_2, +3304 relay_url: None, +3305 direct_addresses: Default::default(), +3306 }, +3307 Source::NamedApp { +3308 name: "test".into(), +3309 }, +3310 true, +3311 &msock_1.metrics.magicsock, +3312 ); +3313 let addr_2 = msock_1.get_mapping_addr(node_id_2).unwrap(); +3314 +3315 // Set a low max_idle_timeout so quinn gives up on this quickly and our test does +3316 // not take forever. You need to check the log output to verify this is really +3317 // triggering the correct error. +3318 // In test_try_send_no_send_addr() above you may have noticed we used +3319 // tokio::time::timeout() on the connection attempt instead. Here however we want +3320 // Quinn itself to have fully given up on the connection attempt because we will +3321 // later connect to **the same** node. If Quinn did not give up on the connection +3322 // we'd close it on drop, and the retransmits of the close packets would interfere +3323 // with the next handshake, closing it during the handshake. This makes the test a +3324 // little slower though. +3325 let mut transport_config = quinn::TransportConfig::default(); +3326 transport_config.max_idle_timeout(Some(Duration::from_millis(200).try_into().unwrap())); +3327 let res = magicsock_connect_with_transport_config( +3328 msock_1.endpoint(), +3329 secret_key_1.clone(), +3330 addr_2, +3331 node_id_2, +3332 Arc::new(transport_config), +3333 ) +3334 .await; +3335 assert!(res.is_err(), "expected timeout"); +3336 info!("first connect timed out as expected"); +3337 +3338 // Provide correct addressing information +3339 msock_1.node_map.add_node_addr( +3340 NodeAddr { +3341 node_id: node_id_2, +3342 relay_url: None, +3343 direct_addresses: msock_2 +3344 .direct_addresses() +3345 .initialized() +3346 .await +3347 .into_iter() +3348 .map(|x| x.addr) +3349 .collect(), +3350 }, +3351 Source::NamedApp { +3352 name: "test".into(), +3353 }, +3354 true, +3355 &msock_1.metrics.magicsock, +3356 ); +3357 +3358 // We can now connect +3359 tokio::time::timeout(Duration::from_secs(10), async move { +3360 info!("establishing new connection"); +3361 let conn = +3362 magicsock_connect(msock_1.endpoint(), secret_key_1.clone(), addr_2, node_id_2) +3363 .await +3364 .unwrap(); +3365 info!("have connection"); +3366 let mut stream = conn.open_uni().await.unwrap(); +3367 stream.write_all(b"hello").await.unwrap(); +3368 stream.finish().unwrap(); +3369 stream.stopped().await.unwrap(); +3370 info!("finished stream"); +3371 }) +3372 .await +3373 .expect("connection timed out"); +3374 +3375 // TODO: could remove the addresses again, send, add it back and see it recover. +3376 // But we don't have that much private access to the NodeMap. This will do for now. +3377 } +3378 +3379 #[tokio::test] +3380 async fn test_add_node_addr() -> Result { +3381 let stack = MagicStack::new(RelayMode::Default).await; +3382 let mut rng = rand::rng(); 3383 -3384 // Empty -3385 let empty_addr = NodeAddr { -3386 node_id: SecretKey::generate(&mut rng).public(), -3387 relay_url: None, -3388 direct_addresses: Default::default(), -3389 }; -3390 let err = stack -3391 .endpoint -3392 .magic_sock() -3393 .add_node_addr(empty_addr, node_map::Source::App) -3394 .unwrap_err(); -3395 assert!( -3396 err.to_string() -3397 .to_lowercase() -3398 .contains("empty addressing info") -3399 ); -3400 -3401 // relay url only -3402 let addr = NodeAddr { -3403 node_id: SecretKey::generate(&mut rng).public(), -3404 relay_url: Some("http://my-relay.com".parse().unwrap()), -3405 direct_addresses: Default::default(), -3406 }; -3407 stack -3408 .endpoint -3409 .magic_sock() -3410 .add_node_addr(addr, node_map::Source::App)?; -3411 assert_eq!(stack.endpoint.magic_sock().node_map.node_count(), 1); -3412 -3413 // addrs only -3414 let addr = NodeAddr { -3415 node_id: SecretKey::generate(&mut rng).public(), -3416 relay_url: None, -3417 direct_addresses: ["127.0.0.1:1234".parse().unwrap()].into_iter().collect(), -3418 }; -3419 stack -3420 .endpoint -3421 .magic_sock() -3422 .add_node_addr(addr, node_map::Source::App)?; -3423 assert_eq!(stack.endpoint.magic_sock().node_map.node_count(), 2); -3424 -3425 // both -3426 let addr = NodeAddr { -3427 node_id: SecretKey::generate(&mut rng).public(), -3428 relay_url: Some("http://my-relay.com".parse().unwrap()), -3429 direct_addresses: ["127.0.0.1:1234".parse().unwrap()].into_iter().collect(), -3430 }; -3431 stack -3432 .endpoint -3433 .magic_sock() -3434 .add_node_addr(addr, node_map::Source::App)?; -3435 assert_eq!(stack.endpoint.magic_sock().node_map.node_count(), 3); -3436 -3437 Ok(()) -3438 } -3439}

\ No newline at end of file +3384 assert_eq!(stack.endpoint.magic_sock().node_map.node_count(), 0); +3385 +3386 // Empty +3387 let empty_addr = NodeAddr { +3388 node_id: SecretKey::generate(&mut rng).public(), +3389 relay_url: None, +3390 direct_addresses: Default::default(), +3391 }; +3392 let err = stack +3393 .endpoint +3394 .magic_sock() +3395 .add_node_addr(empty_addr, node_map::Source::App) +3396 .unwrap_err(); +3397 assert!( +3398 err.to_string() +3399 .to_lowercase() +3400 .contains("empty addressing info") +3401 ); +3402 +3403 // relay url only +3404 let addr = NodeAddr { +3405 node_id: SecretKey::generate(&mut rng).public(), +3406 relay_url: Some("http://my-relay.com".parse().unwrap()), +3407 direct_addresses: Default::default(), +3408 }; +3409 stack +3410 .endpoint +3411 .magic_sock() +3412 .add_node_addr(addr, node_map::Source::App)?; +3413 assert_eq!(stack.endpoint.magic_sock().node_map.node_count(), 1); +3414 +3415 // addrs only +3416 let addr = NodeAddr { +3417 node_id: SecretKey::generate(&mut rng).public(), +3418 relay_url: None, +3419 direct_addresses: ["127.0.0.1:1234".parse().unwrap()].into_iter().collect(), +3420 }; +3421 stack +3422 .endpoint +3423 .magic_sock() +3424 .add_node_addr(addr, node_map::Source::App)?; +3425 assert_eq!(stack.endpoint.magic_sock().node_map.node_count(), 2); +3426 +3427 // both +3428 let addr = NodeAddr { +3429 node_id: SecretKey::generate(&mut rng).public(), +3430 relay_url: Some("http://my-relay.com".parse().unwrap()), +3431 direct_addresses: ["127.0.0.1:1234".parse().unwrap()].into_iter().collect(), +3432 }; +3433 stack +3434 .endpoint +3435 .magic_sock() +3436 .add_node_addr(addr, node_map::Source::App)?; +3437 assert_eq!(stack.endpoint.magic_sock().node_map.node_count(), 3); +3438 +3439 Ok(()) +3440 } +3441}

\ No newline at end of file diff --git a/pr/3465/docs/src/iroh/magicsock/node_map.rs.html b/pr/3465/docs/src/iroh/magicsock/node_map.rs.html index 5ea82b4a6f..f1f9001ad9 100644 --- a/pr/3465/docs/src/iroh/magicsock/node_map.rs.html +++ b/pr/3465/docs/src/iroh/magicsock/node_map.rs.html @@ -707,196 +707,200 @@ 707 use std::net::Ipv4Addr; 708 709 use iroh_base::SecretKey; -710 use tracing_test::traced_test; -711 -712 use super::{node_state::MAX_INACTIVE_DIRECT_ADDRESSES, *}; -713 -714 impl NodeMap { -715 #[track_caller] -716 fn add_test_addr(&self, node_addr: NodeAddr) { -717 self.add_node_addr( -718 node_addr, -719 Source::NamedApp { -720 name: "test".into(), -721 }, -722 true, -723 &Default::default(), -724 ) -725 } -726 } -727 -728 /// Test persisting and loading of known nodes. -729 #[tokio::test] -730 #[traced_test] -731 async fn restore_from_vec() { -732 let node_map = NodeMap::default(); -733 -734 let mut rng = rand::rng(); -735 let node_a = SecretKey::generate(&mut rng).public(); -736 let node_b = SecretKey::generate(&mut rng).public(); -737 let node_c = SecretKey::generate(&mut rng).public(); -738 let node_d = SecretKey::generate(&mut rng).public(); -739 -740 let relay_x: RelayUrl = "https://my-relay-1.com".parse().unwrap(); -741 let relay_y: RelayUrl = "https://my-relay-2.com".parse().unwrap(); -742 -743 let direct_addresses_a = [addr(4000), addr(4001)]; -744 let direct_addresses_c = [addr(5000)]; -745 -746 let node_addr_a = NodeAddr::new(node_a) -747 .with_relay_url(relay_x) -748 .with_direct_addresses(direct_addresses_a); -749 let node_addr_b = NodeAddr::new(node_b).with_relay_url(relay_y); -750 let node_addr_c = NodeAddr::new(node_c).with_direct_addresses(direct_addresses_c); -751 let node_addr_d = NodeAddr::new(node_d); -752 -753 node_map.add_test_addr(node_addr_a); -754 node_map.add_test_addr(node_addr_b); -755 node_map.add_test_addr(node_addr_c); -756 node_map.add_test_addr(node_addr_d); -757 -758 let mut addrs: Vec<NodeAddr> = node_map -759 .list_remote_infos(Instant::now()) -760 .into_iter() -761 .filter_map(|info| { -762 let addr: NodeAddr = info.into(); -763 if addr.is_empty() { -764 return None; -765 } -766 Some(addr) -767 }) -768 .collect(); -769 let loaded_node_map = NodeMap::load_from_vec( -770 addrs.clone(), -771 PathSelection::default(), -772 true, -773 &Default::default(), -774 ); -775 -776 let mut loaded: Vec<NodeAddr> = loaded_node_map -777 .list_remote_infos(Instant::now()) -778 .into_iter() -779 .filter_map(|info| { -780 let addr: NodeAddr = info.into(); -781 if addr.is_empty() { -782 return None; -783 } -784 Some(addr) -785 }) -786 .collect(); -787 -788 loaded.sort_unstable(); -789 addrs.sort_unstable(); -790 -791 // compare the node maps via their known nodes -792 assert_eq!(addrs, loaded); -793 } -794 -795 fn addr(port: u16) -> SocketAddr { -796 (std::net::IpAddr::V4(Ipv4Addr::LOCALHOST), port).into() -797 } -798 -799 #[test] -800 #[traced_test] -801 fn test_prune_direct_addresses() { -802 let node_map = NodeMap::default(); -803 let public_key = SecretKey::generate(rand::rng()).public(); -804 let id = node_map -805 .inner -806 .lock() -807 .unwrap() -808 .insert_node(Options { -809 node_id: public_key, -810 relay_url: None, -811 active: false, -812 source: Source::NamedApp { -813 name: "test".into(), -814 }, -815 path_selection: PathSelection::default(), -816 }) -817 .id(); -818 -819 const LOCALHOST: IpAddr = IpAddr::V4(std::net::Ipv4Addr::LOCALHOST); +710 use rand::SeedableRng; +711 use tracing_test::traced_test; +712 +713 use super::{node_state::MAX_INACTIVE_DIRECT_ADDRESSES, *}; +714 +715 impl NodeMap { +716 #[track_caller] +717 fn add_test_addr(&self, node_addr: NodeAddr) { +718 self.add_node_addr( +719 node_addr, +720 Source::NamedApp { +721 name: "test".into(), +722 }, +723 true, +724 &Default::default(), +725 ) +726 } +727 } +728 +729 /// Test persisting and loading of known nodes. +730 #[tokio::test] +731 #[traced_test] +732 async fn restore_from_vec() { +733 let node_map = NodeMap::default(); +734 +735 let mut rng = rand::rng(); +736 let node_a = SecretKey::generate(&mut rng).public(); +737 let node_b = SecretKey::generate(&mut rng).public(); +738 let node_c = SecretKey::generate(&mut rng).public(); +739 let node_d = SecretKey::generate(&mut rng).public(); +740 +741 let relay_x: RelayUrl = "https://my-relay-1.com".parse().unwrap(); +742 let relay_y: RelayUrl = "https://my-relay-2.com".parse().unwrap(); +743 +744 let direct_addresses_a = [addr(4000), addr(4001)]; +745 let direct_addresses_c = [addr(5000)]; +746 +747 let node_addr_a = NodeAddr::new(node_a) +748 .with_relay_url(relay_x) +749 .with_direct_addresses(direct_addresses_a); +750 let node_addr_b = NodeAddr::new(node_b).with_relay_url(relay_y); +751 let node_addr_c = NodeAddr::new(node_c).with_direct_addresses(direct_addresses_c); +752 let node_addr_d = NodeAddr::new(node_d); +753 +754 node_map.add_test_addr(node_addr_a); +755 node_map.add_test_addr(node_addr_b); +756 node_map.add_test_addr(node_addr_c); +757 node_map.add_test_addr(node_addr_d); +758 +759 let mut addrs: Vec<NodeAddr> = node_map +760 .list_remote_infos(Instant::now()) +761 .into_iter() +762 .filter_map(|info| { +763 let addr: NodeAddr = info.into(); +764 if addr.is_empty() { +765 return None; +766 } +767 Some(addr) +768 }) +769 .collect(); +770 let loaded_node_map = NodeMap::load_from_vec( +771 addrs.clone(), +772 PathSelection::default(), +773 true, +774 &Default::default(), +775 ); +776 +777 let mut loaded: Vec<NodeAddr> = loaded_node_map +778 .list_remote_infos(Instant::now()) +779 .into_iter() +780 .filter_map(|info| { +781 let addr: NodeAddr = info.into(); +782 if addr.is_empty() { +783 return None; +784 } +785 Some(addr) +786 }) +787 .collect(); +788 +789 loaded.sort_unstable(); +790 addrs.sort_unstable(); +791 +792 // compare the node maps via their known nodes +793 assert_eq!(addrs, loaded); +794 } +795 +796 fn addr(port: u16) -> SocketAddr { +797 (std::net::IpAddr::V4(Ipv4Addr::LOCALHOST), port).into() +798 } +799 +800 #[test] +801 #[traced_test] +802 fn test_prune_direct_addresses() { +803 let node_map = NodeMap::default(); +804 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +805 let public_key = SecretKey::generate(&mut rng).public(); +806 let id = node_map +807 .inner +808 .lock() +809 .unwrap() +810 .insert_node(Options { +811 node_id: public_key, +812 relay_url: None, +813 active: false, +814 source: Source::NamedApp { +815 name: "test".into(), +816 }, +817 path_selection: PathSelection::default(), +818 }) +819 .id(); 820 -821 // add [`MAX_INACTIVE_DIRECT_ADDRESSES`] active direct addresses and double -822 // [`MAX_INACTIVE_DIRECT_ADDRESSES`] that are inactive -823 -824 info!("Adding active addresses"); -825 for i in 0..MAX_INACTIVE_DIRECT_ADDRESSES { -826 let addr = SocketAddr::new(LOCALHOST, 5000 + i as u16); -827 let node_addr = NodeAddr::new(public_key).with_direct_addresses([addr]); -828 // add address -829 node_map.add_test_addr(node_addr); -830 // make it active -831 node_map.inner.lock().unwrap().receive_udp(addr); -832 } -833 -834 info!("Adding offline/inactive addresses"); -835 for i in 0..MAX_INACTIVE_DIRECT_ADDRESSES * 2 { -836 let addr = SocketAddr::new(LOCALHOST, 6000 + i as u16); -837 let node_addr = NodeAddr::new(public_key).with_direct_addresses([addr]); -838 node_map.add_test_addr(node_addr); -839 } -840 -841 let mut node_map_inner = node_map.inner.lock().unwrap(); -842 let endpoint = node_map_inner.by_id.get_mut(&id).unwrap(); -843 -844 info!("Adding alive addresses"); -845 for i in 0..MAX_INACTIVE_DIRECT_ADDRESSES { -846 let addr = SendAddr::Udp(SocketAddr::new(LOCALHOST, 7000 + i as u16)); -847 let txid = stun_rs::TransactionId::from([i as u8; 12]); -848 // Note that this already invokes .prune_direct_addresses() because these are -849 // new UDP paths. -850 endpoint.handle_ping(addr, txid); -851 } -852 -853 info!("Pruning addresses"); -854 endpoint.prune_direct_addresses(Instant::now()); -855 -856 // Half the offline addresses should have been pruned. All the active and alive -857 // addresses should have been kept. -858 assert_eq!( -859 endpoint.direct_addresses().count(), -860 MAX_INACTIVE_DIRECT_ADDRESSES * 3 -861 ); -862 -863 // We should have both offline and alive addresses which are not active. -864 assert_eq!( -865 endpoint -866 .direct_address_states() -867 .filter(|(_addr, state)| !state.is_active()) -868 .count(), -869 MAX_INACTIVE_DIRECT_ADDRESSES * 2 -870 ) -871 } -872 -873 #[test] -874 fn test_prune_inactive() { -875 let node_map = NodeMap::default(); -876 // add one active node and more than MAX_INACTIVE_NODES inactive nodes -877 let active_node = SecretKey::generate(rand::rng()).public(); -878 let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 167); -879 node_map.add_test_addr(NodeAddr::new(active_node).with_direct_addresses([addr])); -880 node_map -881 .inner -882 .lock() -883 .unwrap() -884 .receive_udp(addr) -885 .expect("registered"); -886 -887 for _ in 0..MAX_INACTIVE_NODES + 1 { -888 let node = SecretKey::generate(rand::rng()).public(); -889 node_map.add_test_addr(NodeAddr::new(node)); -890 } -891 -892 assert_eq!(node_map.node_count(), MAX_INACTIVE_NODES + 2); -893 node_map.prune_inactive(); -894 assert_eq!(node_map.node_count(), MAX_INACTIVE_NODES + 1); -895 node_map -896 .inner -897 .lock() -898 .unwrap() -899 .get(NodeStateKey::NodeId(active_node)) -900 .expect("should not be pruned"); -901 } -902}

\ No newline at end of file +821 const LOCALHOST: IpAddr = IpAddr::V4(std::net::Ipv4Addr::LOCALHOST); +822 +823 // add [`MAX_INACTIVE_DIRECT_ADDRESSES`] active direct addresses and double +824 // [`MAX_INACTIVE_DIRECT_ADDRESSES`] that are inactive +825 +826 info!("Adding active addresses"); +827 for i in 0..MAX_INACTIVE_DIRECT_ADDRESSES { +828 let addr = SocketAddr::new(LOCALHOST, 5000 + i as u16); +829 let node_addr = NodeAddr::new(public_key).with_direct_addresses([addr]); +830 // add address +831 node_map.add_test_addr(node_addr); +832 // make it active +833 node_map.inner.lock().unwrap().receive_udp(addr); +834 } +835 +836 info!("Adding offline/inactive addresses"); +837 for i in 0..MAX_INACTIVE_DIRECT_ADDRESSES * 2 { +838 let addr = SocketAddr::new(LOCALHOST, 6000 + i as u16); +839 let node_addr = NodeAddr::new(public_key).with_direct_addresses([addr]); +840 node_map.add_test_addr(node_addr); +841 } +842 +843 let mut node_map_inner = node_map.inner.lock().unwrap(); +844 let endpoint = node_map_inner.by_id.get_mut(&id).unwrap(); +845 +846 info!("Adding alive addresses"); +847 for i in 0..MAX_INACTIVE_DIRECT_ADDRESSES { +848 let addr = SendAddr::Udp(SocketAddr::new(LOCALHOST, 7000 + i as u16)); +849 let txid = stun_rs::TransactionId::from([i as u8; 12]); +850 // Note that this already invokes .prune_direct_addresses() because these are +851 // new UDP paths. +852 endpoint.handle_ping(addr, txid); +853 } +854 +855 info!("Pruning addresses"); +856 endpoint.prune_direct_addresses(Instant::now()); +857 +858 // Half the offline addresses should have been pruned. All the active and alive +859 // addresses should have been kept. +860 assert_eq!( +861 endpoint.direct_addresses().count(), +862 MAX_INACTIVE_DIRECT_ADDRESSES * 3 +863 ); +864 +865 // We should have both offline and alive addresses which are not active. +866 assert_eq!( +867 endpoint +868 .direct_address_states() +869 .filter(|(_addr, state)| !state.is_active()) +870 .count(), +871 MAX_INACTIVE_DIRECT_ADDRESSES * 2 +872 ) +873 } +874 +875 #[test] +876 fn test_prune_inactive() { +877 let node_map = NodeMap::default(); +878 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +879 +880 // add one active node and more than MAX_INACTIVE_NODES inactive nodes +881 let active_node = SecretKey::generate(&mut rng).public(); +882 let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 167); +883 node_map.add_test_addr(NodeAddr::new(active_node).with_direct_addresses([addr])); +884 node_map +885 .inner +886 .lock() +887 .unwrap() +888 .receive_udp(addr) +889 .expect("registered"); +890 +891 for _ in 0..MAX_INACTIVE_NODES + 1 { +892 let node = SecretKey::generate(&mut rng).public(); +893 node_map.add_test_addr(NodeAddr::new(node)); +894 } +895 +896 assert_eq!(node_map.node_count(), MAX_INACTIVE_NODES + 2); +897 node_map.prune_inactive(); +898 assert_eq!(node_map.node_count(), MAX_INACTIVE_NODES + 1); +899 node_map +900 .inner +901 .lock() +902 .unwrap() +903 .get(NodeStateKey::NodeId(active_node)) +904 .expect("should not be pruned"); +905 } +906}

\ No newline at end of file diff --git a/pr/3465/docs/src/iroh/magicsock/node_map/node_state.rs.html b/pr/3465/docs/src/iroh/magicsock/node_map/node_state.rs.html index 6fe1ebe7e4..aa25077f8f 100644 --- a/pr/3465/docs/src/iroh/magicsock/node_map/node_state.rs.html +++ b/pr/3465/docs/src/iroh/magicsock/node_map/node_state.rs.html @@ -1437,296 +1437,300 @@ 1437 use std::{collections::BTreeMap, net::Ipv4Addr}; 1438 1439 use iroh_base::SecretKey; -1440 -1441 use super::*; -1442 use crate::magicsock::node_map::{NodeMap, NodeMapInner}; -1443 -1444 #[test] -1445 fn test_remote_infos() { -1446 let now = Instant::now(); -1447 let elapsed = Duration::from_secs(3); -1448 let later = now + elapsed; -1449 let send_addr: RelayUrl = "https://my-relay.com".parse().unwrap(); -1450 let pong_src = SendAddr::Udp("0.0.0.0:1".parse().unwrap()); -1451 let latency = Duration::from_millis(50); -1452 -1453 let relay_and_state = |node_id: NodeId, url: RelayUrl| { -1454 let relay_state = PathState::with_pong_reply( -1455 node_id, -1456 PongReply { -1457 latency, -1458 pong_at: now, -1459 from: SendAddr::Relay(send_addr.clone()), -1460 pong_src: pong_src.clone(), -1461 }, -1462 ); -1463 Some((url, relay_state)) -1464 }; -1465 -1466 // endpoint with a `best_addr` that has a latency but no relay -1467 let (a_endpoint, a_socket_addr) = { -1468 let key = SecretKey::generate(rand::rng()); -1469 let node_id = key.public(); -1470 let ip_port = IpPort { -1471 ip: Ipv4Addr::UNSPECIFIED.into(), -1472 port: 10, -1473 }; -1474 let endpoint_state = BTreeMap::from([( -1475 ip_port, -1476 PathState::with_pong_reply( -1477 node_id, -1478 PongReply { -1479 latency, -1480 pong_at: now, -1481 from: SendAddr::Udp(ip_port.into()), -1482 pong_src: pong_src.clone(), -1483 }, -1484 ), -1485 )]); -1486 ( -1487 NodeState { -1488 id: 0, -1489 quic_mapped_addr: NodeIdMappedAddr::generate(), -1490 node_id: key.public(), -1491 last_full_ping: None, -1492 relay_url: None, -1493 udp_paths: NodeUdpPaths::from_parts( -1494 endpoint_state, -1495 UdpSendAddr::Valid(ip_port.into()), -1496 ), -1497 sent_pings: HashMap::new(), -1498 last_used: Some(now), -1499 last_call_me_maybe: None, -1500 conn_type: Watchable::new(ConnectionType::Direct(ip_port.into())), -1501 has_been_direct: AtomicBool::new(true), -1502 #[cfg(any(test, feature = "test-utils"))] -1503 path_selection: PathSelection::default(), -1504 }, -1505 ip_port.into(), -1506 ) -1507 }; -1508 // endpoint w/ no best addr but a relay w/ latency -1509 let b_endpoint = { -1510 // let socket_addr = "0.0.0.0:9".parse().unwrap(); -1511 let key = SecretKey::generate(rand::rng()); -1512 NodeState { -1513 id: 1, -1514 quic_mapped_addr: NodeIdMappedAddr::generate(), -1515 node_id: key.public(), -1516 last_full_ping: None, -1517 relay_url: relay_and_state(key.public(), send_addr.clone()), -1518 udp_paths: NodeUdpPaths::new(), -1519 sent_pings: HashMap::new(), -1520 last_used: Some(now), -1521 last_call_me_maybe: None, -1522 conn_type: Watchable::new(ConnectionType::Relay(send_addr.clone())), -1523 has_been_direct: AtomicBool::new(false), -1524 #[cfg(any(test, feature = "test-utils"))] -1525 path_selection: PathSelection::default(), -1526 } -1527 }; -1528 -1529 // endpoint w/ no best addr but a relay w/ no latency -1530 let c_endpoint = { -1531 // let socket_addr = "0.0.0.0:8".parse().unwrap(); -1532 let key = SecretKey::generate(rand::rng()); -1533 NodeState { -1534 id: 2, -1535 quic_mapped_addr: NodeIdMappedAddr::generate(), -1536 node_id: key.public(), -1537 last_full_ping: None, -1538 relay_url: Some(( -1539 send_addr.clone(), -1540 PathState::new( -1541 key.public(), -1542 SendAddr::from(send_addr.clone()), -1543 Source::App, -1544 now, -1545 ), -1546 )), -1547 udp_paths: NodeUdpPaths::new(), -1548 sent_pings: HashMap::new(), -1549 last_used: Some(now), -1550 last_call_me_maybe: None, -1551 conn_type: Watchable::new(ConnectionType::Relay(send_addr.clone())), -1552 has_been_direct: AtomicBool::new(false), -1553 #[cfg(any(test, feature = "test-utils"))] -1554 path_selection: PathSelection::default(), -1555 } -1556 }; -1557 -1558 // endpoint w/ expired best addr and relay w/ latency -1559 let (d_endpoint, d_socket_addr) = { -1560 let socket_addr: SocketAddr = "0.0.0.0:7".parse().unwrap(); -1561 let key = SecretKey::generate(rand::rng()); -1562 let node_id = key.public(); -1563 let endpoint_state = BTreeMap::from([( -1564 IpPort::from(socket_addr), -1565 PathState::with_pong_reply( -1566 node_id, -1567 PongReply { -1568 latency, -1569 pong_at: now, -1570 from: SendAddr::Udp(socket_addr), -1571 pong_src: pong_src.clone(), -1572 }, -1573 ), -1574 )]); -1575 ( -1576 NodeState { -1577 id: 3, -1578 quic_mapped_addr: NodeIdMappedAddr::generate(), -1579 node_id: key.public(), -1580 last_full_ping: None, -1581 relay_url: relay_and_state(key.public(), send_addr.clone()), -1582 udp_paths: NodeUdpPaths::from_parts( -1583 endpoint_state, -1584 UdpSendAddr::Outdated(socket_addr), -1585 ), -1586 sent_pings: HashMap::new(), -1587 last_used: Some(now), -1588 last_call_me_maybe: None, -1589 conn_type: Watchable::new(ConnectionType::Mixed( -1590 socket_addr, -1591 send_addr.clone(), -1592 )), -1593 has_been_direct: AtomicBool::new(false), -1594 #[cfg(any(test, feature = "test-utils"))] -1595 path_selection: PathSelection::default(), -1596 }, -1597 socket_addr, -1598 ) -1599 }; -1600 -1601 let mut expect = Vec::from([ -1602 RemoteInfo { -1603 node_id: a_endpoint.node_id, -1604 relay_url: None, -1605 addrs: Vec::from([DirectAddrInfo { -1606 addr: a_socket_addr, -1607 latency: Some(latency), -1608 last_control: Some((elapsed, ControlMsg::Pong)), -1609 last_payload: None, -1610 last_alive: Some(elapsed), -1611 sources: HashMap::new(), -1612 }]), -1613 conn_type: ConnectionType::Direct(a_socket_addr), -1614 latency: Some(latency), -1615 last_used: Some(elapsed), -1616 }, -1617 RemoteInfo { -1618 node_id: b_endpoint.node_id, -1619 relay_url: Some(RelayUrlInfo { -1620 relay_url: b_endpoint.relay_url.as_ref().unwrap().0.clone(), -1621 last_alive: None, -1622 latency: Some(latency), -1623 }), -1624 addrs: Vec::new(), -1625 conn_type: ConnectionType::Relay(send_addr.clone()), -1626 latency: Some(latency), -1627 last_used: Some(elapsed), -1628 }, -1629 RemoteInfo { -1630 node_id: c_endpoint.node_id, -1631 relay_url: Some(RelayUrlInfo { -1632 relay_url: c_endpoint.relay_url.as_ref().unwrap().0.clone(), -1633 last_alive: None, -1634 latency: None, -1635 }), -1636 addrs: Vec::new(), -1637 conn_type: ConnectionType::Relay(send_addr.clone()), -1638 latency: None, -1639 last_used: Some(elapsed), -1640 }, -1641 RemoteInfo { -1642 node_id: d_endpoint.node_id, -1643 relay_url: Some(RelayUrlInfo { -1644 relay_url: d_endpoint.relay_url.as_ref().unwrap().0.clone(), -1645 last_alive: None, -1646 latency: Some(latency), -1647 }), -1648 addrs: Vec::from([DirectAddrInfo { -1649 addr: d_socket_addr, -1650 latency: Some(latency), -1651 last_control: Some((elapsed, ControlMsg::Pong)), -1652 last_payload: None, -1653 last_alive: Some(elapsed), -1654 sources: HashMap::new(), -1655 }]), -1656 conn_type: ConnectionType::Mixed(d_socket_addr, send_addr.clone()), -1657 latency: Some(Duration::from_millis(50)), -1658 last_used: Some(elapsed), -1659 }, -1660 ]); -1661 -1662 let node_map = NodeMap::from_inner(NodeMapInner { -1663 by_node_key: HashMap::from([ -1664 (a_endpoint.node_id, a_endpoint.id), -1665 (b_endpoint.node_id, b_endpoint.id), -1666 (c_endpoint.node_id, c_endpoint.id), -1667 (d_endpoint.node_id, d_endpoint.id), -1668 ]), -1669 by_ip_port: HashMap::from([ -1670 (a_socket_addr.into(), a_endpoint.id), -1671 (d_socket_addr.into(), d_endpoint.id), -1672 ]), -1673 by_quic_mapped_addr: HashMap::from([ -1674 (a_endpoint.quic_mapped_addr, a_endpoint.id), -1675 (b_endpoint.quic_mapped_addr, b_endpoint.id), -1676 (c_endpoint.quic_mapped_addr, c_endpoint.id), -1677 (d_endpoint.quic_mapped_addr, d_endpoint.id), -1678 ]), -1679 by_id: HashMap::from([ -1680 (a_endpoint.id, a_endpoint), -1681 (b_endpoint.id, b_endpoint), -1682 (c_endpoint.id, c_endpoint), -1683 (d_endpoint.id, d_endpoint), -1684 ]), -1685 next_id: 5, -1686 path_selection: PathSelection::default(), -1687 }); -1688 let mut got = node_map.list_remote_infos(later); -1689 got.sort_by_key(|p| p.node_id); -1690 expect.sort_by_key(|p| p.node_id); -1691 remove_non_deterministic_fields(&mut got); -1692 assert_eq!(expect, got); -1693 } -1694 -1695 fn remove_non_deterministic_fields(infos: &mut [RemoteInfo]) { -1696 for info in infos.iter_mut() { -1697 if info.relay_url.is_some() { -1698 info.relay_url.as_mut().unwrap().last_alive = None; -1699 } -1700 } -1701 } -1702 -1703 #[test] -1704 fn test_prune_direct_addresses() { -1705 // When we handle a call-me-maybe with more than MAX_INACTIVE_DIRECT_ADDRESSES we do -1706 // not want to prune them right away but send pings to all of them. -1707 -1708 let key = SecretKey::generate(rand::rng()); -1709 let opts = Options { -1710 node_id: key.public(), -1711 relay_url: None, -1712 active: true, -1713 source: crate::magicsock::Source::NamedApp { -1714 name: "test".into(), -1715 }, -1716 path_selection: PathSelection::default(), -1717 }; -1718 let mut ep = NodeState::new(0, opts); -1719 -1720 let my_numbers_count: u16 = (MAX_INACTIVE_DIRECT_ADDRESSES + 5).try_into().unwrap(); -1721 let my_numbers = (0u16..my_numbers_count) -1722 .map(|i| SocketAddr::new(Ipv4Addr::LOCALHOST.into(), 1000 + i)) -1723 .collect(); -1724 let call_me_maybe = disco::CallMeMaybe { my_numbers }; -1725 -1726 let ping_messages = ep.handle_call_me_maybe(call_me_maybe); -1727 -1728 // We have no relay server and no previous direct addresses, so we should get the same -1729 // number of pings as direct addresses in the call-me-maybe. -1730 assert_eq!(ping_messages.len(), my_numbers_count as usize); -1731 } -1732}

\ No newline at end of file +1440 use rand::SeedableRng; +1441 +1442 use super::*; +1443 use crate::magicsock::node_map::{NodeMap, NodeMapInner}; +1444 +1445 #[test] +1446 fn test_remote_infos() { +1447 let now = Instant::now(); +1448 let elapsed = Duration::from_secs(3); +1449 let later = now + elapsed; +1450 let send_addr: RelayUrl = "https://my-relay.com".parse().unwrap(); +1451 let pong_src = SendAddr::Udp("0.0.0.0:1".parse().unwrap()); +1452 let latency = Duration::from_millis(50); +1453 +1454 let relay_and_state = |node_id: NodeId, url: RelayUrl| { +1455 let relay_state = PathState::with_pong_reply( +1456 node_id, +1457 PongReply { +1458 latency, +1459 pong_at: now, +1460 from: SendAddr::Relay(send_addr.clone()), +1461 pong_src: pong_src.clone(), +1462 }, +1463 ); +1464 Some((url, relay_state)) +1465 }; +1466 +1467 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1468 +1469 // endpoint with a `best_addr` that has a latency but no relay +1470 let (a_endpoint, a_socket_addr) = { +1471 let key = SecretKey::generate(&mut rng); +1472 let node_id = key.public(); +1473 let ip_port = IpPort { +1474 ip: Ipv4Addr::UNSPECIFIED.into(), +1475 port: 10, +1476 }; +1477 let endpoint_state = BTreeMap::from([( +1478 ip_port, +1479 PathState::with_pong_reply( +1480 node_id, +1481 PongReply { +1482 latency, +1483 pong_at: now, +1484 from: SendAddr::Udp(ip_port.into()), +1485 pong_src: pong_src.clone(), +1486 }, +1487 ), +1488 )]); +1489 ( +1490 NodeState { +1491 id: 0, +1492 quic_mapped_addr: NodeIdMappedAddr::generate(), +1493 node_id: key.public(), +1494 last_full_ping: None, +1495 relay_url: None, +1496 udp_paths: NodeUdpPaths::from_parts( +1497 endpoint_state, +1498 UdpSendAddr::Valid(ip_port.into()), +1499 ), +1500 sent_pings: HashMap::new(), +1501 last_used: Some(now), +1502 last_call_me_maybe: None, +1503 conn_type: Watchable::new(ConnectionType::Direct(ip_port.into())), +1504 has_been_direct: AtomicBool::new(true), +1505 #[cfg(any(test, feature = "test-utils"))] +1506 path_selection: PathSelection::default(), +1507 }, +1508 ip_port.into(), +1509 ) +1510 }; +1511 // endpoint w/ no best addr but a relay w/ latency +1512 let b_endpoint = { +1513 // let socket_addr = "0.0.0.0:9".parse().unwrap(); +1514 let key = SecretKey::generate(&mut rng); +1515 NodeState { +1516 id: 1, +1517 quic_mapped_addr: NodeIdMappedAddr::generate(), +1518 node_id: key.public(), +1519 last_full_ping: None, +1520 relay_url: relay_and_state(key.public(), send_addr.clone()), +1521 udp_paths: NodeUdpPaths::new(), +1522 sent_pings: HashMap::new(), +1523 last_used: Some(now), +1524 last_call_me_maybe: None, +1525 conn_type: Watchable::new(ConnectionType::Relay(send_addr.clone())), +1526 has_been_direct: AtomicBool::new(false), +1527 #[cfg(any(test, feature = "test-utils"))] +1528 path_selection: PathSelection::default(), +1529 } +1530 }; +1531 +1532 // endpoint w/ no best addr but a relay w/ no latency +1533 let c_endpoint = { +1534 // let socket_addr = "0.0.0.0:8".parse().unwrap(); +1535 let key = SecretKey::generate(&mut rng); +1536 NodeState { +1537 id: 2, +1538 quic_mapped_addr: NodeIdMappedAddr::generate(), +1539 node_id: key.public(), +1540 last_full_ping: None, +1541 relay_url: Some(( +1542 send_addr.clone(), +1543 PathState::new( +1544 key.public(), +1545 SendAddr::from(send_addr.clone()), +1546 Source::App, +1547 now, +1548 ), +1549 )), +1550 udp_paths: NodeUdpPaths::new(), +1551 sent_pings: HashMap::new(), +1552 last_used: Some(now), +1553 last_call_me_maybe: None, +1554 conn_type: Watchable::new(ConnectionType::Relay(send_addr.clone())), +1555 has_been_direct: AtomicBool::new(false), +1556 #[cfg(any(test, feature = "test-utils"))] +1557 path_selection: PathSelection::default(), +1558 } +1559 }; +1560 +1561 // endpoint w/ expired best addr and relay w/ latency +1562 let (d_endpoint, d_socket_addr) = { +1563 let socket_addr: SocketAddr = "0.0.0.0:7".parse().unwrap(); +1564 let key = SecretKey::generate(&mut rng); +1565 let node_id = key.public(); +1566 let endpoint_state = BTreeMap::from([( +1567 IpPort::from(socket_addr), +1568 PathState::with_pong_reply( +1569 node_id, +1570 PongReply { +1571 latency, +1572 pong_at: now, +1573 from: SendAddr::Udp(socket_addr), +1574 pong_src: pong_src.clone(), +1575 }, +1576 ), +1577 )]); +1578 ( +1579 NodeState { +1580 id: 3, +1581 quic_mapped_addr: NodeIdMappedAddr::generate(), +1582 node_id: key.public(), +1583 last_full_ping: None, +1584 relay_url: relay_and_state(key.public(), send_addr.clone()), +1585 udp_paths: NodeUdpPaths::from_parts( +1586 endpoint_state, +1587 UdpSendAddr::Outdated(socket_addr), +1588 ), +1589 sent_pings: HashMap::new(), +1590 last_used: Some(now), +1591 last_call_me_maybe: None, +1592 conn_type: Watchable::new(ConnectionType::Mixed( +1593 socket_addr, +1594 send_addr.clone(), +1595 )), +1596 has_been_direct: AtomicBool::new(false), +1597 #[cfg(any(test, feature = "test-utils"))] +1598 path_selection: PathSelection::default(), +1599 }, +1600 socket_addr, +1601 ) +1602 }; +1603 +1604 let mut expect = Vec::from([ +1605 RemoteInfo { +1606 node_id: a_endpoint.node_id, +1607 relay_url: None, +1608 addrs: Vec::from([DirectAddrInfo { +1609 addr: a_socket_addr, +1610 latency: Some(latency), +1611 last_control: Some((elapsed, ControlMsg::Pong)), +1612 last_payload: None, +1613 last_alive: Some(elapsed), +1614 sources: HashMap::new(), +1615 }]), +1616 conn_type: ConnectionType::Direct(a_socket_addr), +1617 latency: Some(latency), +1618 last_used: Some(elapsed), +1619 }, +1620 RemoteInfo { +1621 node_id: b_endpoint.node_id, +1622 relay_url: Some(RelayUrlInfo { +1623 relay_url: b_endpoint.relay_url.as_ref().unwrap().0.clone(), +1624 last_alive: None, +1625 latency: Some(latency), +1626 }), +1627 addrs: Vec::new(), +1628 conn_type: ConnectionType::Relay(send_addr.clone()), +1629 latency: Some(latency), +1630 last_used: Some(elapsed), +1631 }, +1632 RemoteInfo { +1633 node_id: c_endpoint.node_id, +1634 relay_url: Some(RelayUrlInfo { +1635 relay_url: c_endpoint.relay_url.as_ref().unwrap().0.clone(), +1636 last_alive: None, +1637 latency: None, +1638 }), +1639 addrs: Vec::new(), +1640 conn_type: ConnectionType::Relay(send_addr.clone()), +1641 latency: None, +1642 last_used: Some(elapsed), +1643 }, +1644 RemoteInfo { +1645 node_id: d_endpoint.node_id, +1646 relay_url: Some(RelayUrlInfo { +1647 relay_url: d_endpoint.relay_url.as_ref().unwrap().0.clone(), +1648 last_alive: None, +1649 latency: Some(latency), +1650 }), +1651 addrs: Vec::from([DirectAddrInfo { +1652 addr: d_socket_addr, +1653 latency: Some(latency), +1654 last_control: Some((elapsed, ControlMsg::Pong)), +1655 last_payload: None, +1656 last_alive: Some(elapsed), +1657 sources: HashMap::new(), +1658 }]), +1659 conn_type: ConnectionType::Mixed(d_socket_addr, send_addr.clone()), +1660 latency: Some(Duration::from_millis(50)), +1661 last_used: Some(elapsed), +1662 }, +1663 ]); +1664 +1665 let node_map = NodeMap::from_inner(NodeMapInner { +1666 by_node_key: HashMap::from([ +1667 (a_endpoint.node_id, a_endpoint.id), +1668 (b_endpoint.node_id, b_endpoint.id), +1669 (c_endpoint.node_id, c_endpoint.id), +1670 (d_endpoint.node_id, d_endpoint.id), +1671 ]), +1672 by_ip_port: HashMap::from([ +1673 (a_socket_addr.into(), a_endpoint.id), +1674 (d_socket_addr.into(), d_endpoint.id), +1675 ]), +1676 by_quic_mapped_addr: HashMap::from([ +1677 (a_endpoint.quic_mapped_addr, a_endpoint.id), +1678 (b_endpoint.quic_mapped_addr, b_endpoint.id), +1679 (c_endpoint.quic_mapped_addr, c_endpoint.id), +1680 (d_endpoint.quic_mapped_addr, d_endpoint.id), +1681 ]), +1682 by_id: HashMap::from([ +1683 (a_endpoint.id, a_endpoint), +1684 (b_endpoint.id, b_endpoint), +1685 (c_endpoint.id, c_endpoint), +1686 (d_endpoint.id, d_endpoint), +1687 ]), +1688 next_id: 5, +1689 path_selection: PathSelection::default(), +1690 }); +1691 let mut got = node_map.list_remote_infos(later); +1692 got.sort_by_key(|p| p.node_id); +1693 expect.sort_by_key(|p| p.node_id); +1694 remove_non_deterministic_fields(&mut got); +1695 assert_eq!(expect, got); +1696 } +1697 +1698 fn remove_non_deterministic_fields(infos: &mut [RemoteInfo]) { +1699 for info in infos.iter_mut() { +1700 if info.relay_url.is_some() { +1701 info.relay_url.as_mut().unwrap().last_alive = None; +1702 } +1703 } +1704 } +1705 +1706 #[test] +1707 fn test_prune_direct_addresses() { +1708 // When we handle a call-me-maybe with more than MAX_INACTIVE_DIRECT_ADDRESSES we do +1709 // not want to prune them right away but send pings to all of them. +1710 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1711 +1712 let key = SecretKey::generate(&mut rng); +1713 let opts = Options { +1714 node_id: key.public(), +1715 relay_url: None, +1716 active: true, +1717 source: crate::magicsock::Source::NamedApp { +1718 name: "test".into(), +1719 }, +1720 path_selection: PathSelection::default(), +1721 }; +1722 let mut ep = NodeState::new(0, opts); +1723 +1724 let my_numbers_count: u16 = (MAX_INACTIVE_DIRECT_ADDRESSES + 5).try_into().unwrap(); +1725 let my_numbers = (0u16..my_numbers_count) +1726 .map(|i| SocketAddr::new(Ipv4Addr::LOCALHOST.into(), 1000 + i)) +1727 .collect(); +1728 let call_me_maybe = disco::CallMeMaybe { my_numbers }; +1729 +1730 let ping_messages = ep.handle_call_me_maybe(call_me_maybe); +1731 +1732 // We have no relay server and no previous direct addresses, so we should get the same +1733 // number of pings as direct addresses in the call-me-maybe. +1734 assert_eq!(ping_messages.len(), my_numbers_count as usize); +1735 } +1736}
\ No newline at end of file diff --git a/pr/3465/docs/src/iroh/tls/name.rs.html b/pr/3465/docs/src/iroh/tls/name.rs.html index 4396fc1f48..1568764fba 100644 --- a/pr/3465/docs/src/iroh/tls/name.rs.html +++ b/pr/3465/docs/src/iroh/tls/name.rs.html @@ -35,21 +35,23 @@ 35#[cfg(test)] 36mod tests { 37 use iroh_base::SecretKey; -38 -39 #[test] -40 fn test_roundtrip() { -41 let key = SecretKey::generate(rand::rng()); -42 let node_id = key.public(); -43 println!("{}", super::encode(node_id)); -44 assert_eq!(Some(node_id), super::decode(&super::encode(node_id))); -45 } -46 -47 #[test] -48 fn test_snapshot() { -49 let key = SecretKey::from_bytes(&[0; 32]); -50 assert_eq!( -51 super::encode(key.public()), -52 "7dl2ff6emqi2qol3l382krodedij45bn3nh479hqo14a32qpr8kg.iroh.invalid", -53 ); -54 } -55}
\ No newline at end of file +38 use rand::SeedableRng; +39 +40 #[test] +41 fn test_roundtrip() { +42 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +43 let key = SecretKey::generate(&mut rng); +44 let node_id = key.public(); +45 println!("{}", super::encode(node_id)); +46 assert_eq!(Some(node_id), super::decode(&super::encode(node_id))); +47 } +48 +49 #[test] +50 fn test_snapshot() { +51 let key = SecretKey::from_bytes(&[0; 32]); +52 assert_eq!( +53 super::encode(key.public()), +54 "7dl2ff6emqi2qol3l382krodedij45bn3nh479hqo14a32qpr8kg.iroh.invalid", +55 ); +56 } +57}
\ No newline at end of file diff --git a/pr/3465/docs/src/iroh_base/key.rs.html b/pr/3465/docs/src/iroh_base/key.rs.html index f208feb370..7849522008 100644 --- a/pr/3465/docs/src/iroh_base/key.rs.html +++ b/pr/3465/docs/src/iroh_base/key.rs.html @@ -288,11 +288,11 @@ 288 /// 289 /// ```rust 290 /// // use the OsRng option for OS depedndent most secure RNG. -291 /// let mut rng = rand::rngs::OsRng; -292 /// let _key = iroh_base::SecretKey::generate(&mut rng); +291 /// use rand::{TryRngCore, rngs::OsRng}; +292 /// let _key = iroh_base::SecretKey::generate(&mut OsRng.unwrap_err()); 293 /// ``` -294 pub fn generate<R: CryptoRng>(mut csprng: R) -> Self { -295 let secret = SigningKey::generate(&mut csprng); +294 pub fn generate<R: CryptoRng + ?Sized>(csprng: &mut R) -> Self { +295 let secret = SigningKey::generate(csprng); 296 297 Self { secret } 298 } @@ -372,56 +372,58 @@ 372#[cfg(test)] 373mod tests { 374 use data_encoding::HEXLOWER; -375 -376 use super::*; -377 -378 #[test] -379 fn test_public_key_postcard() { -380 let public_key = -381 PublicKey::from_str("ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6") -382 .unwrap(); -383 let bytes = postcard::to_stdvec(&public_key).unwrap(); -384 let expected = HEXLOWER -385 .decode(b"ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6") -386 .unwrap(); -387 assert_eq!(bytes, expected); -388 } -389 -390 #[test] -391 fn public_key_postcard() { -392 let key = PublicKey::from_bytes(&[0; 32]).unwrap(); -393 let bytes = postcard::to_stdvec(&key).unwrap(); -394 let key2: PublicKey = postcard::from_bytes(&bytes).unwrap(); -395 assert_eq!(key, key2); -396 } -397 -398 #[test] -399 fn public_key_json() { -400 let key = PublicKey::from_bytes(&[0; 32]).unwrap(); -401 let bytes = serde_json::to_string(&key).unwrap(); -402 let key2: PublicKey = serde_json::from_str(&bytes).unwrap(); -403 assert_eq!(key, key2); -404 } -405 -406 #[test] -407 fn test_from_str() { -408 let key = SecretKey::generate(rand::rng()); -409 assert_eq!( -410 SecretKey::from_str(&HEXLOWER.encode(&key.to_bytes())) -411 .unwrap() -412 .to_bytes(), -413 key.to_bytes() -414 ); -415 -416 assert_eq!( -417 PublicKey::from_str(&key.public().to_string()).unwrap(), -418 key.public() -419 ); -420 } -421 -422 #[test] -423 fn test_regression_parse_node_id_panic() { -424 let not_a_node_id = "foobarbaz"; -425 assert!(PublicKey::from_str(not_a_node_id).is_err()); -426 } -427}
\ No newline at end of file +375 use rand::SeedableRng; +376 +377 use super::*; +378 +379 #[test] +380 fn test_public_key_postcard() { +381 let public_key = +382 PublicKey::from_str("ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6") +383 .unwrap(); +384 let bytes = postcard::to_stdvec(&public_key).unwrap(); +385 let expected = HEXLOWER +386 .decode(b"ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6") +387 .unwrap(); +388 assert_eq!(bytes, expected); +389 } +390 +391 #[test] +392 fn public_key_postcard() { +393 let key = PublicKey::from_bytes(&[0; 32]).unwrap(); +394 let bytes = postcard::to_stdvec(&key).unwrap(); +395 let key2: PublicKey = postcard::from_bytes(&bytes).unwrap(); +396 assert_eq!(key, key2); +397 } +398 +399 #[test] +400 fn public_key_json() { +401 let key = PublicKey::from_bytes(&[0; 32]).unwrap(); +402 let bytes = serde_json::to_string(&key).unwrap(); +403 let key2: PublicKey = serde_json::from_str(&bytes).unwrap(); +404 assert_eq!(key, key2); +405 } +406 +407 #[test] +408 fn test_from_str() { +409 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +410 let key = SecretKey::generate(&mut rng); +411 assert_eq!( +412 SecretKey::from_str(&HEXLOWER.encode(&key.to_bytes())) +413 .unwrap() +414 .to_bytes(), +415 key.to_bytes() +416 ); +417 +418 assert_eq!( +419 PublicKey::from_str(&key.public().to_string()).unwrap(), +420 key.public() +421 ); +422 } +423 +424 #[test] +425 fn test_regression_parse_node_id_panic() { +426 let not_a_node_id = "foobarbaz"; +427 assert!(PublicKey::from_str(not_a_node_id).is_err()); +428 } +429} \ No newline at end of file diff --git a/pr/3465/docs/src/iroh_base/ticket/node.rs.html b/pr/3465/docs/src/iroh_base/ticket/node.rs.html index 46af18e3ed..3c499221ef 100644 --- a/pr/3465/docs/src/iroh_base/ticket/node.rs.html +++ b/pr/3465/docs/src/iroh_base/ticket/node.rs.html @@ -136,76 +136,78 @@ 136 use std::net::{Ipv4Addr, SocketAddr}; 137 138 use data_encoding::HEXLOWER; -139 -140 use super::*; -141 use crate::key::{PublicKey, SecretKey}; -142 -143 fn make_ticket() -> NodeTicket { -144 let peer = SecretKey::generate(rand::rng()).public(); -145 let addr = SocketAddr::from((Ipv4Addr::LOCALHOST, 1234)); -146 let relay_url = None; -147 NodeTicket { -148 node: NodeAddr::from_parts(peer, relay_url, [addr]), -149 } -150 } -151 -152 #[test] -153 fn test_ticket_postcard() { -154 let ticket = make_ticket(); -155 let bytes = postcard::to_stdvec(&ticket).unwrap(); -156 let ticket2: NodeTicket = postcard::from_bytes(&bytes).unwrap(); -157 assert_eq!(ticket2, ticket); -158 } -159 -160 #[test] -161 fn test_ticket_json() { -162 let ticket = make_ticket(); -163 let json = serde_json::to_string(&ticket).unwrap(); -164 let ticket2: NodeTicket = serde_json::from_str(&json).unwrap(); -165 assert_eq!(ticket2, ticket); -166 } -167 -168 #[test] -169 fn test_ticket_base32() { -170 let node_id = -171 PublicKey::from_str("ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6") -172 .unwrap(); -173 -174 let ticket = NodeTicket { -175 node: NodeAddr::from_parts( -176 node_id, -177 Some("http://derp.me./".parse().unwrap()), -178 ["127.0.0.1:1024".parse().unwrap()], -179 ), -180 }; -181 let base32 = data_encoding::BASE32_NOPAD -182 .decode( -183 ticket -184 .to_string() -185 .strip_prefix("node") -186 .unwrap() -187 .to_ascii_uppercase() -188 .as_bytes(), -189 ) -190 .unwrap(); -191 let expected = [ -192 // variant -193 "00", -194 // node id, 32 bytes, see above -195 "ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6", -196 // relay url present -197 "01", -198 // relay url, 16 bytes, see above -199 "10", -200 "687474703a2f2f646572702e6d652e2f", -201 // one direct address -202 "01", -203 // ipv4 -204 "00", -205 // address, see above -206 "7f0000018008", -207 ]; -208 let expected = HEXLOWER.decode(expected.concat().as_bytes()).unwrap(); -209 assert_eq!(base32, expected); -210 } -211} \ No newline at end of file +139 use rand::SeedableRng; +140 +141 use super::*; +142 use crate::key::{PublicKey, SecretKey}; +143 +144 fn make_ticket() -> NodeTicket { +145 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +146 let peer = SecretKey::generate(&mut rng).public(); +147 let addr = SocketAddr::from((Ipv4Addr::LOCALHOST, 1234)); +148 let relay_url = None; +149 NodeTicket { +150 node: NodeAddr::from_parts(peer, relay_url, [addr]), +151 } +152 } +153 +154 #[test] +155 fn test_ticket_postcard() { +156 let ticket = make_ticket(); +157 let bytes = postcard::to_stdvec(&ticket).unwrap(); +158 let ticket2: NodeTicket = postcard::from_bytes(&bytes).unwrap(); +159 assert_eq!(ticket2, ticket); +160 } +161 +162 #[test] +163 fn test_ticket_json() { +164 let ticket = make_ticket(); +165 let json = serde_json::to_string(&ticket).unwrap(); +166 let ticket2: NodeTicket = serde_json::from_str(&json).unwrap(); +167 assert_eq!(ticket2, ticket); +168 } +169 +170 #[test] +171 fn test_ticket_base32() { +172 let node_id = +173 PublicKey::from_str("ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6") +174 .unwrap(); +175 +176 let ticket = NodeTicket { +177 node: NodeAddr::from_parts( +178 node_id, +179 Some("http://derp.me./".parse().unwrap()), +180 ["127.0.0.1:1024".parse().unwrap()], +181 ), +182 }; +183 let base32 = data_encoding::BASE32_NOPAD +184 .decode( +185 ticket +186 .to_string() +187 .strip_prefix("node") +188 .unwrap() +189 .to_ascii_uppercase() +190 .as_bytes(), +191 ) +192 .unwrap(); +193 let expected = [ +194 // variant +195 "00", +196 // node id, 32 bytes, see above +197 "ae58ff8833241ac82d6ff7611046ed67b5072d142c588d0063e942d9a75502b6", +198 // relay url present +199 "01", +200 // relay url, 16 bytes, see above +201 "10", +202 "687474703a2f2f646572702e6d652e2f", +203 // one direct address +204 "01", +205 // ipv4 +206 "00", +207 // address, see above +208 "7f0000018008", +209 ]; +210 let expected = HEXLOWER.decode(expected.concat().as_bytes()).unwrap(); +211 assert_eq!(base32, expected); +212 } +213} \ No newline at end of file diff --git a/pr/3465/docs/src/iroh_dns_server/lib.rs.html b/pr/3465/docs/src/iroh_dns_server/lib.rs.html index 61f9b3f6ce..639a87ce1c 100644 --- a/pr/3465/docs/src/iroh_dns_server/lib.rs.html +++ b/pr/3465/docs/src/iroh_dns_server/lib.rs.html @@ -27,245 +27,252 @@ 27 }; 28 use n0_snafu::{Result, ResultExt}; 29 use pkarr::{SignedPacket, Timestamp}; -30 use tracing_test::traced_test; -31 -32 use crate::{ -33 ZoneStore, -34 config::BootstrapOption, -35 server::Server, -36 store::{PacketSource, ZoneStoreOptions}, -37 util::PublicKeyBytes, -38 }; -39 -40 const DNS_TIMEOUT: Duration = Duration::from_secs(1); -41 -42 #[tokio::test] -43 #[traced_test] -44 async fn pkarr_publish_dns_resolve() -> Result { -45 let (server, nameserver, http_url) = Server::spawn_for_tests().await?; -46 let pkarr_relay_url = { -47 let mut url = http_url.clone(); -48 url.set_path("/pkarr"); -49 url -50 }; -51 let signed_packet = { -52 use pkarr::dns; -53 let keypair = pkarr::Keypair::random(); -54 let mut packet = dns::Packet::new_reply(0); -55 // record at root -56 packet.answers.push(dns::ResourceRecord::new( -57 dns::Name::new("").e()?, -58 dns::CLASS::IN, -59 30, -60 dns::rdata::RData::TXT("hi0".try_into().unwrap()), -61 )); -62 // record at level one -63 packet.answers.push(dns::ResourceRecord::new( -64 dns::Name::new("_hello").e()?, -65 dns::CLASS::IN, -66 30, -67 dns::rdata::RData::TXT("hi1".try_into().unwrap()), -68 )); -69 // record at level two -70 packet.answers.push(dns::ResourceRecord::new( -71 dns::Name::new("_hello.world").e()?, -72 dns::CLASS::IN, -73 30, -74 dns::rdata::RData::TXT("hi2".try_into().unwrap()), -75 )); -76 // multiple records for same name -77 packet.answers.push(dns::ResourceRecord::new( -78 dns::Name::new("multiple").e()?, -79 dns::CLASS::IN, -80 30, -81 dns::rdata::RData::TXT("hi3".try_into().unwrap()), -82 )); -83 packet.answers.push(dns::ResourceRecord::new( -84 dns::Name::new("multiple").e()?, -85 dns::CLASS::IN, -86 30, -87 dns::rdata::RData::TXT("hi4".try_into().unwrap()), -88 )); -89 // record of type A -90 packet.answers.push(dns::ResourceRecord::new( -91 dns::Name::new("").e()?, -92 dns::CLASS::IN, -93 30, -94 dns::rdata::RData::A(Ipv4Addr::LOCALHOST.into()), -95 )); -96 // record of type AAAA -97 packet.answers.push(dns::ResourceRecord::new( -98 dns::Name::new("foo.bar.baz").e()?, -99 dns::CLASS::IN, -100 30, -101 dns::rdata::RData::AAAA(Ipv6Addr::LOCALHOST.into()), -102 )); -103 SignedPacket::new(&keypair, &packet.answers, Timestamp::now()).e()? -104 }; -105 let pkarr_client = pkarr::Client::builder() -106 .no_default_network() -107 .relays(&[pkarr_relay_url]) -108 .e()? -109 .build() -110 .e()?; -111 pkarr_client.publish(&signed_packet, None).await.e()?; -112 -113 use hickory_server::proto::rr::Name; -114 let pubkey = signed_packet.public_key().to_z32(); -115 let resolver = test_resolver(nameserver); -116 -117 // resolve root record -118 let name = Name::from_utf8(format!("{pubkey}.")).e()?; -119 let res = resolver.lookup_txt(name, DNS_TIMEOUT).await?; -120 let records = res.into_iter().map(|t| t.to_string()).collect::<Vec<_>>(); -121 assert_eq!(records, vec!["hi0".to_string()]); -122 -123 // resolve level one record -124 let name = Name::from_utf8(format!("_hello.{pubkey}.")).e()?; -125 let res = resolver.lookup_txt(name, DNS_TIMEOUT).await?; -126 let records = res.into_iter().map(|t| t.to_string()).collect::<Vec<_>>(); -127 assert_eq!(records, vec!["hi1".to_string()]); -128 -129 // resolve level two record -130 let name = Name::from_utf8(format!("_hello.world.{pubkey}.")).e()?; -131 let res = resolver.lookup_txt(name, DNS_TIMEOUT).await?; -132 let records = res.into_iter().map(|t| t.to_string()).collect::<Vec<_>>(); -133 assert_eq!(records, vec!["hi2".to_string()]); -134 -135 // resolve multiple records for same name -136 let name = Name::from_utf8(format!("multiple.{pubkey}.")).e()?; -137 let res = resolver.lookup_txt(name, DNS_TIMEOUT).await?; -138 let records = res.into_iter().map(|t| t.to_string()).collect::<Vec<_>>(); -139 assert_eq!(records, vec!["hi3".to_string(), "hi4".to_string()]); -140 -141 // resolve A record -142 let name = Name::from_utf8(format!("{pubkey}.")).e()?; -143 let res = resolver.lookup_ipv4(name, DNS_TIMEOUT).await?; -144 let records = res.collect::<Vec<_>>(); -145 assert_eq!(records, vec![Ipv4Addr::LOCALHOST]); -146 -147 // resolve AAAA record -148 let name = Name::from_utf8(format!("foo.bar.baz.{pubkey}.")).e()?; -149 let res = resolver.lookup_ipv6(name, DNS_TIMEOUT).await?; -150 let records = res.collect::<Vec<_>>(); -151 assert_eq!(records, vec![Ipv6Addr::LOCALHOST]); -152 -153 server.shutdown().await?; -154 Ok(()) -155 } -156 -157 #[tokio::test] -158 #[traced_test] -159 async fn integration_smoke() -> Result { -160 let (server, nameserver, http_url) = Server::spawn_for_tests().await?; -161 -162 let pkarr_relay = { -163 let mut url = http_url.clone(); -164 url.set_path("/pkarr"); -165 url -166 }; -167 -168 let origin = "irohdns.example."; -169 -170 let secret_key = SecretKey::generate(rand::rng()); -171 let node_id = secret_key.public(); -172 let pkarr = PkarrRelayClient::new(pkarr_relay); -173 let relay_url: RelayUrl = "https://relay.example.".parse()?; -174 let node_info = NodeInfo::new(node_id).with_relay_url(Some(relay_url.clone())); -175 let signed_packet = node_info.to_pkarr_signed_packet(&secret_key, 30)?; -176 -177 pkarr.publish(&signed_packet).await?; -178 -179 let resolver = test_resolver(nameserver); -180 let res = resolver.lookup_node_by_id(&node_id, origin).await?; +30 use rand::{CryptoRng, SeedableRng}; +31 use tracing_test::traced_test; +32 +33 use crate::{ +34 ZoneStore, +35 config::BootstrapOption, +36 server::Server, +37 store::{PacketSource, ZoneStoreOptions}, +38 util::PublicKeyBytes, +39 }; +40 +41 const DNS_TIMEOUT: Duration = Duration::from_secs(1); +42 +43 #[tokio::test] +44 #[traced_test] +45 async fn pkarr_publish_dns_resolve() -> Result { +46 let (server, nameserver, http_url) = Server::spawn_for_tests().await?; +47 let pkarr_relay_url = { +48 let mut url = http_url.clone(); +49 url.set_path("/pkarr"); +50 url +51 }; +52 let signed_packet = { +53 use pkarr::dns; +54 let keypair = pkarr::Keypair::random(); +55 let mut packet = dns::Packet::new_reply(0); +56 // record at root +57 packet.answers.push(dns::ResourceRecord::new( +58 dns::Name::new("").e()?, +59 dns::CLASS::IN, +60 30, +61 dns::rdata::RData::TXT("hi0".try_into().unwrap()), +62 )); +63 // record at level one +64 packet.answers.push(dns::ResourceRecord::new( +65 dns::Name::new("_hello").e()?, +66 dns::CLASS::IN, +67 30, +68 dns::rdata::RData::TXT("hi1".try_into().unwrap()), +69 )); +70 // record at level two +71 packet.answers.push(dns::ResourceRecord::new( +72 dns::Name::new("_hello.world").e()?, +73 dns::CLASS::IN, +74 30, +75 dns::rdata::RData::TXT("hi2".try_into().unwrap()), +76 )); +77 // multiple records for same name +78 packet.answers.push(dns::ResourceRecord::new( +79 dns::Name::new("multiple").e()?, +80 dns::CLASS::IN, +81 30, +82 dns::rdata::RData::TXT("hi3".try_into().unwrap()), +83 )); +84 packet.answers.push(dns::ResourceRecord::new( +85 dns::Name::new("multiple").e()?, +86 dns::CLASS::IN, +87 30, +88 dns::rdata::RData::TXT("hi4".try_into().unwrap()), +89 )); +90 // record of type A +91 packet.answers.push(dns::ResourceRecord::new( +92 dns::Name::new("").e()?, +93 dns::CLASS::IN, +94 30, +95 dns::rdata::RData::A(Ipv4Addr::LOCALHOST.into()), +96 )); +97 // record of type AAAA +98 packet.answers.push(dns::ResourceRecord::new( +99 dns::Name::new("foo.bar.baz").e()?, +100 dns::CLASS::IN, +101 30, +102 dns::rdata::RData::AAAA(Ipv6Addr::LOCALHOST.into()), +103 )); +104 SignedPacket::new(&keypair, &packet.answers, Timestamp::now()).e()? +105 }; +106 let pkarr_client = pkarr::Client::builder() +107 .no_default_network() +108 .relays(&[pkarr_relay_url]) +109 .e()? +110 .build() +111 .e()?; +112 pkarr_client.publish(&signed_packet, None).await.e()?; +113 +114 use hickory_server::proto::rr::Name; +115 let pubkey = signed_packet.public_key().to_z32(); +116 let resolver = test_resolver(nameserver); +117 +118 // resolve root record +119 let name = Name::from_utf8(format!("{pubkey}.")).e()?; +120 let res = resolver.lookup_txt(name, DNS_TIMEOUT).await?; +121 let records = res.into_iter().map(|t| t.to_string()).collect::<Vec<_>>(); +122 assert_eq!(records, vec!["hi0".to_string()]); +123 +124 // resolve level one record +125 let name = Name::from_utf8(format!("_hello.{pubkey}.")).e()?; +126 let res = resolver.lookup_txt(name, DNS_TIMEOUT).await?; +127 let records = res.into_iter().map(|t| t.to_string()).collect::<Vec<_>>(); +128 assert_eq!(records, vec!["hi1".to_string()]); +129 +130 // resolve level two record +131 let name = Name::from_utf8(format!("_hello.world.{pubkey}.")).e()?; +132 let res = resolver.lookup_txt(name, DNS_TIMEOUT).await?; +133 let records = res.into_iter().map(|t| t.to_string()).collect::<Vec<_>>(); +134 assert_eq!(records, vec!["hi2".to_string()]); +135 +136 // resolve multiple records for same name +137 let name = Name::from_utf8(format!("multiple.{pubkey}.")).e()?; +138 let res = resolver.lookup_txt(name, DNS_TIMEOUT).await?; +139 let records = res.into_iter().map(|t| t.to_string()).collect::<Vec<_>>(); +140 assert_eq!(records, vec!["hi3".to_string(), "hi4".to_string()]); +141 +142 // resolve A record +143 let name = Name::from_utf8(format!("{pubkey}.")).e()?; +144 let res = resolver.lookup_ipv4(name, DNS_TIMEOUT).await?; +145 let records = res.collect::<Vec<_>>(); +146 assert_eq!(records, vec![Ipv4Addr::LOCALHOST]); +147 +148 // resolve AAAA record +149 let name = Name::from_utf8(format!("foo.bar.baz.{pubkey}.")).e()?; +150 let res = resolver.lookup_ipv6(name, DNS_TIMEOUT).await?; +151 let records = res.collect::<Vec<_>>(); +152 assert_eq!(records, vec![Ipv6Addr::LOCALHOST]); +153 +154 server.shutdown().await?; +155 Ok(()) +156 } +157 +158 #[tokio::test] +159 #[traced_test] +160 async fn integration_smoke() -> Result { +161 let (server, nameserver, http_url) = Server::spawn_for_tests().await?; +162 +163 let pkarr_relay = { +164 let mut url = http_url.clone(); +165 url.set_path("/pkarr"); +166 url +167 }; +168 +169 let origin = "irohdns.example."; +170 +171 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +172 +173 let secret_key = SecretKey::generate(&mut rng); +174 let node_id = secret_key.public(); +175 let pkarr = PkarrRelayClient::new(pkarr_relay); +176 let relay_url: RelayUrl = "https://relay.example.".parse()?; +177 let node_info = NodeInfo::new(node_id).with_relay_url(Some(relay_url.clone())); +178 let signed_packet = node_info.to_pkarr_signed_packet(&secret_key, 30)?; +179 +180 pkarr.publish(&signed_packet).await?; 181 -182 assert_eq!(res.node_id, node_id); -183 assert_eq!(res.relay_url(), Some(&relay_url)); +182 let resolver = test_resolver(nameserver); +183 let res = resolver.lookup_node_by_id(&node_id, origin).await?; 184 -185 server.shutdown().await?; -186 Ok(()) -187 } -188 -189 #[tokio::test] -190 #[traced_test] -191 async fn store_eviction() -> Result { -192 let options = ZoneStoreOptions { -193 eviction: Duration::from_millis(100), -194 eviction_interval: Duration::from_millis(100), -195 max_batch_time: Duration::from_millis(100), -196 ..Default::default() -197 }; -198 let store = ZoneStore::in_memory(options, Default::default())?; -199 -200 // create a signed packet -201 let signed_packet = random_signed_packet()?; -202 let key = PublicKeyBytes::from_signed_packet(&signed_packet); -203 -204 store -205 .insert(signed_packet, PacketSource::PkarrPublish) -206 .await?; -207 -208 tokio::time::sleep(Duration::from_secs(1)).await; -209 for _ in 0..10 { -210 let entry = store.get_signed_packet(&key).await?; -211 if entry.is_none() { -212 return Ok(()); -213 } -214 tokio::time::sleep(Duration::from_secs(1)).await; -215 } -216 panic!("store did not evict packet"); -217 } -218 -219 #[tokio::test] -220 #[traced_test] -221 async fn integration_mainline() -> Result { -222 // run a mainline testnet -223 let testnet = pkarr::mainline::Testnet::new_async(5).await.e()?; -224 let bootstrap = testnet.bootstrap.clone(); -225 -226 // spawn our server with mainline support -227 let (server, nameserver, _http_url) = -228 Server::spawn_for_tests_with_options(Some(BootstrapOption::Custom(bootstrap)), None) -229 .await?; -230 -231 let origin = "irohdns.example."; +185 assert_eq!(res.node_id, node_id); +186 assert_eq!(res.relay_url(), Some(&relay_url)); +187 +188 server.shutdown().await?; +189 Ok(()) +190 } +191 +192 #[tokio::test] +193 #[traced_test] +194 async fn store_eviction() -> Result { +195 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +196 +197 let options = ZoneStoreOptions { +198 eviction: Duration::from_millis(100), +199 eviction_interval: Duration::from_millis(100), +200 max_batch_time: Duration::from_millis(100), +201 ..Default::default() +202 }; +203 let store = ZoneStore::in_memory(options, Default::default())?; +204 +205 // create a signed packet +206 let signed_packet = random_signed_packet(&mut rng)?; +207 let key = PublicKeyBytes::from_signed_packet(&signed_packet); +208 +209 store +210 .insert(signed_packet, PacketSource::PkarrPublish) +211 .await?; +212 +213 tokio::time::sleep(Duration::from_secs(1)).await; +214 for _ in 0..10 { +215 let entry = store.get_signed_packet(&key).await?; +216 if entry.is_none() { +217 return Ok(()); +218 } +219 tokio::time::sleep(Duration::from_secs(1)).await; +220 } +221 panic!("store did not evict packet"); +222 } +223 +224 #[tokio::test] +225 #[traced_test] +226 async fn integration_mainline() -> Result { +227 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +228 +229 // run a mainline testnet +230 let testnet = pkarr::mainline::Testnet::new_async(5).await.e()?; +231 let bootstrap = testnet.bootstrap.clone(); 232 -233 // create a signed packet -234 let secret_key = SecretKey::generate(rand::rng()); -235 let node_id = secret_key.public(); -236 let relay_url: RelayUrl = "https://relay.example.".parse()?; -237 let node_info = NodeInfo::new(node_id).with_relay_url(Some(relay_url.clone())); -238 let signed_packet = node_info.to_pkarr_signed_packet(&secret_key, 30)?; +233 // spawn our server with mainline support +234 let (server, nameserver, _http_url) = +235 Server::spawn_for_tests_with_options(Some(BootstrapOption::Custom(bootstrap)), None) +236 .await?; +237 +238 let origin = "irohdns.example."; 239 -240 // publish the signed packet to our DHT -241 let pkarr = pkarr::Client::builder() -242 .no_default_network() -243 .dht(|builder| builder.bootstrap(&testnet.bootstrap)) -244 .build() -245 .e()?; -246 pkarr.publish(&signed_packet, None).await.e()?; -247 -248 // resolve via DNS from our server, which will lookup from our DHT -249 let resolver = test_resolver(nameserver); -250 let res = resolver.lookup_node_by_id(&node_id, origin).await?; -251 -252 assert_eq!(res.node_id, node_id); -253 assert_eq!(res.relay_url(), Some(&relay_url)); +240 // create a signed packet +241 let secret_key = SecretKey::generate(&mut rng); +242 let node_id = secret_key.public(); +243 let relay_url: RelayUrl = "https://relay.example.".parse()?; +244 let node_info = NodeInfo::new(node_id).with_relay_url(Some(relay_url.clone())); +245 let signed_packet = node_info.to_pkarr_signed_packet(&secret_key, 30)?; +246 +247 // publish the signed packet to our DHT +248 let pkarr = pkarr::Client::builder() +249 .no_default_network() +250 .dht(|builder| builder.bootstrap(&testnet.bootstrap)) +251 .build() +252 .e()?; +253 pkarr.publish(&signed_packet, None).await.e()?; 254 -255 server.shutdown().await?; -256 Ok(()) -257 } +255 // resolve via DNS from our server, which will lookup from our DHT +256 let resolver = test_resolver(nameserver); +257 let res = resolver.lookup_node_by_id(&node_id, origin).await?; 258 -259 fn test_resolver(nameserver: SocketAddr) -> DnsResolver { -260 DnsResolver::with_nameserver(nameserver) -261 } -262 -263 fn random_signed_packet() -> Result<SignedPacket> { -264 let secret_key = SecretKey::generate(rand::rng()); -265 let node_id = secret_key.public(); -266 let relay_url: RelayUrl = "https://relay.example.".parse()?; -267 let node_info = NodeInfo::new(node_id).with_relay_url(Some(relay_url.clone())); -268 let packet = node_info.to_pkarr_signed_packet(&secret_key, 30)?; -269 Ok(packet) -270 } -271} \ No newline at end of file +259 assert_eq!(res.node_id, node_id); +260 assert_eq!(res.relay_url(), Some(&relay_url)); +261 +262 server.shutdown().await?; +263 Ok(()) +264 } +265 +266 fn test_resolver(nameserver: SocketAddr) -> DnsResolver { +267 DnsResolver::with_nameserver(nameserver) +268 } +269 +270 fn random_signed_packet<R: CryptoRng + ?Sized>(rng: &mut R) -> Result<SignedPacket> { +271 let secret_key = SecretKey::generate(rng); +272 let node_id = secret_key.public(); +273 let relay_url: RelayUrl = "https://relay.example.".parse()?; +274 let node_info = NodeInfo::new(node_id).with_relay_url(Some(relay_url.clone())); +275 let packet = node_info.to_pkarr_signed_packet(&secret_key, 30)?; +276 Ok(packet) +277 } +278} \ No newline at end of file diff --git a/pr/3465/docs/src/iroh_relay/protos/handshake.rs.html b/pr/3465/docs/src/iroh_relay/protos/handshake.rs.html index fde630a7ec..26ebd09bb8 100644 --- a/pr/3465/docs/src/iroh_relay/protos/handshake.rs.html +++ b/pr/3465/docs/src/iroh_relay/protos/handshake.rs.html @@ -196,7 +196,7 @@ 196impl ServerChallenge { 197 /// Generates a new challenge. 198 #[cfg(feature = "server")] -199 pub(crate) fn new(mut rng: impl CryptoRng) -> Self { +199 pub(crate) fn new<R: CryptoRng + ?Sized>(rng: &mut R) -> Self { 200 let mut challenge = [0u8; 16]; 201 rng.fill_bytes(&mut challenge); 202 Self { challenge } @@ -432,7 +432,7 @@ 432 // We'll fall back to verification that takes another round trip more time. 433 } 434 -435 let challenge = ServerChallenge::new(rand::rng()); +435 let challenge = ServerChallenge::new(&mut rand::rng()); 436 write_frame(io, &challenge).await?; 437 438 let (_, frame) = read_frame(io, &[ClientAuth::TAG]).await?; @@ -530,279 +530,294 @@ 530 use iroh_base::{PublicKey, SecretKey}; 531 use n0_future::{Sink, SinkExt, Stream, TryStreamExt}; 532 use n0_snafu::{Result, ResultExt}; -533 use tokio_util::codec::{Framed, LengthDelimitedCodec}; -534 use tracing::{Instrument, info_span}; -535 use tracing_test::traced_test; -536 -537 use super::{ -538 ClientAuth, KeyMaterialClientAuth, Mechanism, ServerChallenge, ServerConfirmsAuth, -539 }; -540 use crate::ExportKeyingMaterial; -541 -542 struct TestKeyingMaterial<IO> { -543 shared_secret: Option<u64>, -544 inner: IO, -545 } -546 -547 trait WithTlsSharedSecret: Sized { -548 fn with_shared_secret(self, shared_secret: Option<u64>) -> TestKeyingMaterial<Self>; -549 } -550 -551 impl<T: Sized> WithTlsSharedSecret for T { -552 fn with_shared_secret(self, shared_secret: Option<u64>) -> TestKeyingMaterial<Self> { -553 TestKeyingMaterial { -554 shared_secret, -555 inner: self, -556 } -557 } -558 } -559 -560 impl<IO> ExportKeyingMaterial for TestKeyingMaterial<IO> { -561 fn export_keying_material<T: AsMut<[u8]>>( -562 &self, -563 mut output: T, -564 label: &[u8], -565 context: Option<&[u8]>, -566 ) -> Option<T> { -567 // we simulate something like exporting keying material using blake3 -568 -569 let label_key = blake3::hash(label); -570 let context_key = blake3::keyed_hash(label_key.as_bytes(), context.unwrap_or(&[])); -571 let mut hasher = blake3::Hasher::new_keyed(context_key.as_bytes()); -572 hasher.update(&self.shared_secret?.to_le_bytes()); -573 hasher.finalize_xof().fill(output.as_mut()); -574 -575 Some(output) -576 } -577 } -578 -579 impl<V, IO: Stream<Item = V> + Unpin> Stream for TestKeyingMaterial<IO> { -580 type Item = V; -581 -582 fn poll_next( -583 mut self: std::pin::Pin<&mut Self>, -584 cx: &mut std::task::Context<'_>, -585 ) -> std::task::Poll<Option<Self::Item>> { -586 std::pin::Pin::new(&mut self.inner).poll_next(cx) -587 } -588 } -589 -590 impl<V, E, IO: Sink<V, Error = E> + Unpin> Sink<V> for TestKeyingMaterial<IO> { -591 type Error = E; -592 -593 fn poll_ready( -594 mut self: std::pin::Pin<&mut Self>, -595 cx: &mut std::task::Context<'_>, -596 ) -> std::task::Poll<Result<(), Self::Error>> { -597 std::pin::Pin::new(&mut self.inner).poll_ready(cx) -598 } -599 -600 fn start_send(mut self: std::pin::Pin<&mut Self>, item: V) -> Result<(), Self::Error> { -601 std::pin::Pin::new(&mut self.inner).start_send(item) -602 } -603 -604 fn poll_flush( -605 mut self: std::pin::Pin<&mut Self>, -606 cx: &mut std::task::Context<'_>, -607 ) -> std::task::Poll<Result<(), Self::Error>> { -608 std::pin::Pin::new(&mut self.inner).poll_flush(cx) -609 } -610 -611 fn poll_close( -612 mut self: std::pin::Pin<&mut Self>, -613 cx: &mut std::task::Context<'_>, -614 ) -> std::task::Poll<Result<(), Self::Error>> { -615 std::pin::Pin::new(&mut self.inner).poll_close(cx) -616 } -617 } -618 -619 async fn simulate_handshake( -620 secret_key: &SecretKey, -621 client_shared_secret: Option<u64>, -622 server_shared_secret: Option<u64>, -623 restricted_to: Option<PublicKey>, -624 ) -> (Result<ServerConfirmsAuth>, Result<(PublicKey, Mechanism)>) { -625 let (client, server) = tokio::io::duplex(1024); -626 -627 let mut client_io = Framed::new(client, LengthDelimitedCodec::new()) -628 .map_ok(BytesMut::freeze) -629 .map_err(tokio_websockets::Error::Io) -630 .sink_map_err(tokio_websockets::Error::Io) -631 .with_shared_secret(client_shared_secret); -632 let mut server_io = Framed::new(server, LengthDelimitedCodec::new()) -633 .map_ok(BytesMut::freeze) -634 .map_err(tokio_websockets::Error::Io) -635 .sink_map_err(tokio_websockets::Error::Io) -636 .with_shared_secret(server_shared_secret); -637 -638 let client_auth_header = KeyMaterialClientAuth::new(secret_key, &client_io) -639 .map(KeyMaterialClientAuth::into_header_value); -640 -641 n0_future::future::zip( -642 async { -643 super::clientside(&mut client_io, secret_key) -644 .await -645 .context("clientside") -646 } -647 .instrument(info_span!("clientside")), -648 async { -649 let auth_n = super::serverside(&mut server_io, client_auth_header) -650 .await -651 .context("serverside")?; -652 let mechanism = auth_n.mechanism; -653 let is_authorized = restricted_to.is_none_or(|key| key == auth_n.client_key); -654 let key = auth_n.authorize_if(is_authorized, &mut server_io).await?; -655 Ok((key, mechanism)) -656 } -657 .instrument(info_span!("serverside")), -658 ) -659 .await -660 } -661 -662 #[tokio::test] -663 #[traced_test] -664 async fn test_handshake_via_shared_secrets() -> Result { -665 let secret_key = SecretKey::generate(rand::rng()); -666 let (client, server) = simulate_handshake(&secret_key, Some(42), Some(42), None).await; -667 client?; -668 let (public_key, auth) = server?; -669 assert_eq!(public_key, secret_key.public()); -670 assert_eq!(auth, Mechanism::SignedKeyMaterial); // it got verified via shared key material -671 Ok(()) -672 } -673 -674 #[tokio::test] -675 #[traced_test] -676 async fn test_handshake_via_challenge() -> Result { -677 let secret_key = SecretKey::generate(rand::rng()); -678 let (client, server) = simulate_handshake(&secret_key, None, None, None).await; -679 client?; -680 let (public_key, auth) = server?; -681 assert_eq!(public_key, secret_key.public()); -682 assert_eq!(auth, Mechanism::SignedChallenge); -683 Ok(()) -684 } -685 -686 #[tokio::test] -687 #[traced_test] -688 async fn test_handshake_mismatching_shared_secrets() -> Result { -689 let secret_key = SecretKey::generate(rand::rng()); -690 // mismatching shared secrets *might* happen with HTTPS proxies that don't also middle-man the shared secret -691 let (client, server) = simulate_handshake(&secret_key, Some(10), Some(99), None).await; -692 client?; -693 let (public_key, auth) = server?; -694 assert_eq!(public_key, secret_key.public()); -695 assert_eq!(auth, Mechanism::SignedChallenge); -696 Ok(()) -697 } -698 -699 #[tokio::test] -700 #[traced_test] -701 async fn test_handshake_challenge_fallback() -> Result { -702 let secret_key = SecretKey::generate(rand::rng()); -703 // clients might not have access to shared secrets -704 let (client, server) = simulate_handshake(&secret_key, None, Some(99), None).await; -705 client?; -706 let (public_key, auth) = server?; -707 assert_eq!(public_key, secret_key.public()); -708 assert_eq!(auth, Mechanism::SignedChallenge); -709 Ok(()) -710 } -711 -712 #[tokio::test] -713 #[traced_test] -714 async fn test_handshake_with_auth_positive() -> Result { -715 let secret_key = SecretKey::generate(rand::rng()); -716 let public_key = secret_key.public(); -717 let (client, server) = simulate_handshake(&secret_key, None, None, Some(public_key)).await; -718 client?; -719 let (public_key, _) = server?; -720 assert_eq!(public_key, secret_key.public()); -721 Ok(()) -722 } -723 -724 #[tokio::test] -725 #[traced_test] -726 async fn test_handshake_with_auth_negative() -> Result { -727 let secret_key = SecretKey::generate(rand::rng()); -728 let public_key = secret_key.public(); -729 let wrong_secret_key = SecretKey::generate(rand::rng()); -730 let (client, server) = -731 simulate_handshake(&wrong_secret_key, None, None, Some(public_key)).await; -732 assert!(client.is_err()); -733 assert!(server.is_err()); -734 Ok(()) -735 } -736 -737 #[tokio::test] -738 #[traced_test] -739 async fn test_handshake_via_shared_secret_with_auth_negative() -> Result { -740 let secret_key = SecretKey::generate(rand::rng()); -741 let public_key = secret_key.public(); -742 let wrong_secret_key = SecretKey::generate(rand::rng()); -743 let (client, server) = -744 simulate_handshake(&wrong_secret_key, Some(42), Some(42), Some(public_key)).await; -745 assert!(client.is_err()); -746 assert!(server.is_err()); -747 Ok(()) -748 } -749 -750 #[test] -751 fn test_client_auth_roundtrip() -> Result { -752 let secret_key = SecretKey::generate(rand::rng()); -753 let challenge = ServerChallenge::new(rand::rng()); -754 let client_auth = ClientAuth::new(&secret_key, &challenge); -755 -756 let bytes = postcard::to_allocvec(&client_auth).e()?; -757 let decoded: ClientAuth = postcard::from_bytes(&bytes).e()?; -758 -759 assert_eq!(client_auth.public_key, decoded.public_key); -760 assert_eq!(client_auth.signature, decoded.signature); -761 -762 Ok(()) -763 } -764 -765 #[test] -766 fn test_km_client_auth_roundtrip() -> Result { -767 let secret_key = SecretKey::generate(rand::rng()); -768 let client_auth = KeyMaterialClientAuth::new( -769 &secret_key, -770 &TestKeyingMaterial { -771 inner: (), -772 shared_secret: Some(42), -773 }, -774 ) -775 .e()?; +533 use rand::SeedableRng; +534 use tokio_util::codec::{Framed, LengthDelimitedCodec}; +535 use tracing::{Instrument, info_span}; +536 use tracing_test::traced_test; +537 +538 use super::{ +539 ClientAuth, KeyMaterialClientAuth, Mechanism, ServerChallenge, ServerConfirmsAuth, +540 }; +541 use crate::ExportKeyingMaterial; +542 +543 struct TestKeyingMaterial<IO> { +544 shared_secret: Option<u64>, +545 inner: IO, +546 } +547 +548 trait WithTlsSharedSecret: Sized { +549 fn with_shared_secret(self, shared_secret: Option<u64>) -> TestKeyingMaterial<Self>; +550 } +551 +552 impl<T: Sized> WithTlsSharedSecret for T { +553 fn with_shared_secret(self, shared_secret: Option<u64>) -> TestKeyingMaterial<Self> { +554 TestKeyingMaterial { +555 shared_secret, +556 inner: self, +557 } +558 } +559 } +560 +561 impl<IO> ExportKeyingMaterial for TestKeyingMaterial<IO> { +562 fn export_keying_material<T: AsMut<[u8]>>( +563 &self, +564 mut output: T, +565 label: &[u8], +566 context: Option<&[u8]>, +567 ) -> Option<T> { +568 // we simulate something like exporting keying material using blake3 +569 +570 let label_key = blake3::hash(label); +571 let context_key = blake3::keyed_hash(label_key.as_bytes(), context.unwrap_or(&[])); +572 let mut hasher = blake3::Hasher::new_keyed(context_key.as_bytes()); +573 hasher.update(&self.shared_secret?.to_le_bytes()); +574 hasher.finalize_xof().fill(output.as_mut()); +575 +576 Some(output) +577 } +578 } +579 +580 impl<V, IO: Stream<Item = V> + Unpin> Stream for TestKeyingMaterial<IO> { +581 type Item = V; +582 +583 fn poll_next( +584 mut self: std::pin::Pin<&mut Self>, +585 cx: &mut std::task::Context<'_>, +586 ) -> std::task::Poll<Option<Self::Item>> { +587 std::pin::Pin::new(&mut self.inner).poll_next(cx) +588 } +589 } +590 +591 impl<V, E, IO: Sink<V, Error = E> + Unpin> Sink<V> for TestKeyingMaterial<IO> { +592 type Error = E; +593 +594 fn poll_ready( +595 mut self: std::pin::Pin<&mut Self>, +596 cx: &mut std::task::Context<'_>, +597 ) -> std::task::Poll<Result<(), Self::Error>> { +598 std::pin::Pin::new(&mut self.inner).poll_ready(cx) +599 } +600 +601 fn start_send(mut self: std::pin::Pin<&mut Self>, item: V) -> Result<(), Self::Error> { +602 std::pin::Pin::new(&mut self.inner).start_send(item) +603 } +604 +605 fn poll_flush( +606 mut self: std::pin::Pin<&mut Self>, +607 cx: &mut std::task::Context<'_>, +608 ) -> std::task::Poll<Result<(), Self::Error>> { +609 std::pin::Pin::new(&mut self.inner).poll_flush(cx) +610 } +611 +612 fn poll_close( +613 mut self: std::pin::Pin<&mut Self>, +614 cx: &mut std::task::Context<'_>, +615 ) -> std::task::Poll<Result<(), Self::Error>> { +616 std::pin::Pin::new(&mut self.inner).poll_close(cx) +617 } +618 } +619 +620 async fn simulate_handshake( +621 secret_key: &SecretKey, +622 client_shared_secret: Option<u64>, +623 server_shared_secret: Option<u64>, +624 restricted_to: Option<PublicKey>, +625 ) -> (Result<ServerConfirmsAuth>, Result<(PublicKey, Mechanism)>) { +626 let (client, server) = tokio::io::duplex(1024); +627 +628 let mut client_io = Framed::new(client, LengthDelimitedCodec::new()) +629 .map_ok(BytesMut::freeze) +630 .map_err(tokio_websockets::Error::Io) +631 .sink_map_err(tokio_websockets::Error::Io) +632 .with_shared_secret(client_shared_secret); +633 let mut server_io = Framed::new(server, LengthDelimitedCodec::new()) +634 .map_ok(BytesMut::freeze) +635 .map_err(tokio_websockets::Error::Io) +636 .sink_map_err(tokio_websockets::Error::Io) +637 .with_shared_secret(server_shared_secret); +638 +639 let client_auth_header = KeyMaterialClientAuth::new(secret_key, &client_io) +640 .map(KeyMaterialClientAuth::into_header_value); +641 +642 n0_future::future::zip( +643 async { +644 super::clientside(&mut client_io, secret_key) +645 .await +646 .context("clientside") +647 } +648 .instrument(info_span!("clientside")), +649 async { +650 let auth_n = super::serverside(&mut server_io, client_auth_header) +651 .await +652 .context("serverside")?; +653 let mechanism = auth_n.mechanism; +654 let is_authorized = restricted_to.is_none_or(|key| key == auth_n.client_key); +655 let key = auth_n.authorize_if(is_authorized, &mut server_io).await?; +656 Ok((key, mechanism)) +657 } +658 .instrument(info_span!("serverside")), +659 ) +660 .await +661 } +662 +663 #[tokio::test] +664 #[traced_test] +665 async fn test_handshake_via_shared_secrets() -> Result { +666 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +667 +668 let secret_key = SecretKey::generate(&mut rng); +669 let (client, server) = simulate_handshake(&secret_key, Some(42), Some(42), None).await; +670 client?; +671 let (public_key, auth) = server?; +672 assert_eq!(public_key, secret_key.public()); +673 assert_eq!(auth, Mechanism::SignedKeyMaterial); // it got verified via shared key material +674 Ok(()) +675 } +676 +677 #[tokio::test] +678 #[traced_test] +679 async fn test_handshake_via_challenge() -> Result { +680 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +681 +682 let secret_key = SecretKey::generate(&mut rng); +683 let (client, server) = simulate_handshake(&secret_key, None, None, None).await; +684 client?; +685 let (public_key, auth) = server?; +686 assert_eq!(public_key, secret_key.public()); +687 assert_eq!(auth, Mechanism::SignedChallenge); +688 Ok(()) +689 } +690 +691 #[tokio::test] +692 #[traced_test] +693 async fn test_handshake_mismatching_shared_secrets() -> Result { +694 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +695 +696 let secret_key = SecretKey::generate(&mut rng); +697 // mismatching shared secrets *might* happen with HTTPS proxies that don't also middle-man the shared secret +698 let (client, server) = simulate_handshake(&secret_key, Some(10), Some(99), None).await; +699 client?; +700 let (public_key, auth) = server?; +701 assert_eq!(public_key, secret_key.public()); +702 assert_eq!(auth, Mechanism::SignedChallenge); +703 Ok(()) +704 } +705 +706 #[tokio::test] +707 #[traced_test] +708 async fn test_handshake_challenge_fallback() -> Result { +709 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +710 let secret_key = SecretKey::generate(&mut rng); +711 // clients might not have access to shared secrets +712 let (client, server) = simulate_handshake(&secret_key, None, Some(99), None).await; +713 client?; +714 let (public_key, auth) = server?; +715 assert_eq!(public_key, secret_key.public()); +716 assert_eq!(auth, Mechanism::SignedChallenge); +717 Ok(()) +718 } +719 +720 #[tokio::test] +721 #[traced_test] +722 async fn test_handshake_with_auth_positive() -> Result { +723 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +724 let secret_key = SecretKey::generate(&mut rng); +725 let public_key = secret_key.public(); +726 let (client, server) = simulate_handshake(&secret_key, None, None, Some(public_key)).await; +727 client?; +728 let (public_key, _) = server?; +729 assert_eq!(public_key, secret_key.public()); +730 Ok(()) +731 } +732 +733 #[tokio::test] +734 #[traced_test] +735 async fn test_handshake_with_auth_negative() -> Result { +736 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +737 let secret_key = SecretKey::generate(&mut rng); +738 let public_key = secret_key.public(); +739 let wrong_secret_key = SecretKey::generate(&mut rng); +740 let (client, server) = +741 simulate_handshake(&wrong_secret_key, None, None, Some(public_key)).await; +742 assert!(client.is_err()); +743 assert!(server.is_err()); +744 Ok(()) +745 } +746 +747 #[tokio::test] +748 #[traced_test] +749 async fn test_handshake_via_shared_secret_with_auth_negative() -> Result { +750 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +751 let secret_key = SecretKey::generate(&mut rng); +752 let public_key = secret_key.public(); +753 let wrong_secret_key = SecretKey::generate(&mut rng); +754 let (client, server) = +755 simulate_handshake(&wrong_secret_key, Some(42), Some(42), Some(public_key)).await; +756 assert!(client.is_err()); +757 assert!(server.is_err()); +758 Ok(()) +759 } +760 +761 #[test] +762 fn test_client_auth_roundtrip() -> Result { +763 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +764 let secret_key = SecretKey::generate(&mut rng); +765 let challenge = ServerChallenge::new(&mut rng); +766 let client_auth = ClientAuth::new(&secret_key, &challenge); +767 +768 let bytes = postcard::to_allocvec(&client_auth).e()?; +769 let decoded: ClientAuth = postcard::from_bytes(&bytes).e()?; +770 +771 assert_eq!(client_auth.public_key, decoded.public_key); +772 assert_eq!(client_auth.signature, decoded.signature); +773 +774 Ok(()) +775 } 776 -777 let bytes = postcard::to_allocvec(&client_auth).e()?; -778 let decoded: KeyMaterialClientAuth = postcard::from_bytes(&bytes).e()?; -779 -780 assert_eq!(client_auth.public_key, decoded.public_key); -781 assert_eq!(client_auth.signature, decoded.signature); -782 -783 Ok(()) -784 } -785 -786 #[test] -787 fn test_challenge_verification() -> Result { -788 let secret_key = SecretKey::generate(rand::rng()); -789 let challenge = ServerChallenge::new(rand::rng()); -790 let client_auth = ClientAuth::new(&secret_key, &challenge); -791 assert!(client_auth.verify(&challenge).is_ok()); +777 #[test] +778 fn test_km_client_auth_roundtrip() -> Result { +779 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +780 let secret_key = SecretKey::generate(&mut rng); +781 let client_auth = KeyMaterialClientAuth::new( +782 &secret_key, +783 &TestKeyingMaterial { +784 inner: (), +785 shared_secret: Some(42), +786 }, +787 ) +788 .e()?; +789 +790 let bytes = postcard::to_allocvec(&client_auth).e()?; +791 let decoded: KeyMaterialClientAuth = postcard::from_bytes(&bytes).e()?; 792 -793 Ok(()) -794 } +793 assert_eq!(client_auth.public_key, decoded.public_key); +794 assert_eq!(client_auth.signature, decoded.signature); 795 -796 #[test] -797 fn test_key_material_verification() -> Result { -798 let secret_key = SecretKey::generate(rand::rng()); -799 let io = TestKeyingMaterial { -800 inner: (), -801 shared_secret: Some(42), -802 }; -803 let client_auth = KeyMaterialClientAuth::new(&secret_key, &io).e()?; -804 assert!(client_auth.verify(&io).is_ok()); -805 -806 Ok(()) -807 } -808} \ No newline at end of file +796 Ok(()) +797 } +798 +799 #[test] +800 fn test_challenge_verification() -> Result { +801 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +802 let secret_key = SecretKey::generate(&mut rng); +803 let challenge = ServerChallenge::new(&mut rng); +804 let client_auth = ClientAuth::new(&secret_key, &challenge); +805 assert!(client_auth.verify(&challenge).is_ok()); +806 +807 Ok(()) +808 } +809 +810 #[test] +811 fn test_key_material_verification() -> Result { +812 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +813 let secret_key = SecretKey::generate(&mut rng); +814 let io = TestKeyingMaterial { +815 inner: (), +816 shared_secret: Some(42), +817 }; +818 let client_auth = KeyMaterialClientAuth::new(&secret_key, &io).e()?; +819 assert!(client_auth.verify(&io).is_ok()); +820 +821 Ok(()) +822 } +823} \ No newline at end of file diff --git a/pr/3465/docs/src/iroh_relay/server.rs.html b/pr/3465/docs/src/iroh_relay/server.rs.html index 00363aa161..f2e65a6ad4 100644 --- a/pr/3465/docs/src/iroh_relay/server.rs.html +++ b/pr/3465/docs/src/iroh_relay/server.rs.html @@ -754,312 +754,316 @@ 754 use iroh_base::{NodeId, RelayUrl, SecretKey}; 755 use n0_future::{FutureExt, SinkExt, StreamExt}; 756 use n0_snafu::Result; -757 use tracing::{info, instrument}; -758 use tracing_test::traced_test; -759 -760 use super::{ -761 Access, AccessConfig, NO_CONTENT_CHALLENGE_HEADER, NO_CONTENT_RESPONSE_HEADER, RelayConfig, -762 Server, ServerConfig, SpawnError, -763 }; -764 use crate::{ -765 client::{ClientBuilder, ConnectError}, -766 dns::DnsResolver, -767 protos::{ -768 handshake, -769 relay::{ClientToRelayMsg, Datagrams, RelayToClientMsg}, -770 }, -771 }; -772 -773 async fn spawn_local_relay() -> std::result::Result<Server, SpawnError> { -774 Server::spawn(ServerConfig::<(), ()> { -775 relay: Some(RelayConfig::<(), ()> { -776 http_bind_addr: (Ipv4Addr::LOCALHOST, 0).into(), -777 tls: None, -778 limits: Default::default(), -779 key_cache_capacity: Some(1024), -780 access: AccessConfig::Everyone, -781 }), -782 quic: None, -783 metrics_addr: None, -784 }) -785 .await -786 } -787 -788 #[instrument] -789 async fn try_send_recv( -790 client_a: &mut crate::client::Client, -791 client_b: &mut crate::client::Client, -792 b_key: NodeId, -793 msg: Datagrams, -794 ) -> Result<RelayToClientMsg> { -795 // try resend 10 times -796 for _ in 0..10 { -797 client_a -798 .send(ClientToRelayMsg::Datagrams { -799 dst_node_id: b_key, -800 datagrams: msg.clone(), -801 }) -802 .await?; -803 let Ok(res) = tokio::time::timeout(Duration::from_millis(500), client_b.next()).await -804 else { -805 continue; -806 }; -807 let res = res.expect("stream finished")?; -808 return Ok(res); -809 } -810 panic!("failed to send and recv message"); -811 } -812 -813 fn dns_resolver() -> DnsResolver { -814 DnsResolver::new() -815 } -816 -817 #[tokio::test] -818 #[traced_test] -819 async fn test_no_services() { -820 let mut server = Server::spawn(ServerConfig::<(), ()>::default()) -821 .await -822 .unwrap(); -823 let res = tokio::time::timeout(Duration::from_secs(5), server.task_handle()) -824 .await -825 .expect("timeout, server not finished") -826 .expect("server task JoinError"); -827 assert!(res.is_err()); -828 } -829 -830 #[tokio::test] -831 #[traced_test] -832 async fn test_conflicting_bind() { -833 let mut server = Server::spawn(ServerConfig::<(), ()> { -834 relay: Some(RelayConfig { -835 http_bind_addr: (Ipv4Addr::LOCALHOST, 1234).into(), -836 tls: None, -837 limits: Default::default(), -838 key_cache_capacity: Some(1024), -839 access: AccessConfig::Everyone, -840 }), -841 quic: None, -842 metrics_addr: Some((Ipv4Addr::LOCALHOST, 1234).into()), -843 }) -844 .await -845 .unwrap(); -846 let res = tokio::time::timeout(Duration::from_secs(5), server.task_handle()) -847 .await -848 .expect("timeout, server not finished") -849 .expect("server task JoinError"); -850 assert!(res.is_err()); // AddrInUse -851 } -852 -853 #[tokio::test] -854 #[traced_test] -855 async fn test_root_handler() { -856 let server = spawn_local_relay().await.unwrap(); -857 let url = format!("http://{}", server.http_addr().unwrap()); -858 -859 let response = reqwest::get(&url).await.unwrap(); -860 assert_eq!(response.status(), 200); -861 let body = response.text().await.unwrap(); -862 assert!(body.contains("iroh.computer")); -863 } -864 -865 #[tokio::test] -866 #[traced_test] -867 async fn test_captive_portal_service() { -868 let server = spawn_local_relay().await.unwrap(); -869 let url = format!("http://{}/generate_204", server.http_addr().unwrap()); -870 let challenge = "123az__."; -871 -872 let client = reqwest::Client::new(); -873 let response = client -874 .get(&url) -875 .header(NO_CONTENT_CHALLENGE_HEADER, challenge) -876 .send() -877 .await -878 .unwrap(); -879 assert_eq!(response.status(), StatusCode::NO_CONTENT); -880 let header = response.headers().get(NO_CONTENT_RESPONSE_HEADER).unwrap(); -881 assert_eq!(header.to_str().unwrap(), format!("response {challenge}")); -882 let body = response.text().await.unwrap(); -883 assert!(body.is_empty()); -884 } -885 -886 #[tokio::test] -887 #[traced_test] -888 async fn test_relay_clients() -> Result<()> { -889 let server = spawn_local_relay().await?; -890 -891 let relay_url = format!("http://{}", server.http_addr().unwrap()); -892 let relay_url: RelayUrl = relay_url.parse()?; -893 -894 // set up client a -895 let a_secret_key = SecretKey::generate(rand::rng()); -896 let a_key = a_secret_key.public(); -897 let resolver = dns_resolver(); -898 info!("client a build & connect"); -899 let mut client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone()) -900 .connect() -901 .await?; -902 -903 // set up client b -904 let b_secret_key = SecretKey::generate(rand::rng()); -905 let b_key = b_secret_key.public(); -906 info!("client b build & connect"); -907 let mut client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone()) -908 .connect() -909 .await?; -910 -911 info!("sending a -> b"); +757 use rand::SeedableRng; +758 use tracing::{info, instrument}; +759 use tracing_test::traced_test; +760 +761 use super::{ +762 Access, AccessConfig, NO_CONTENT_CHALLENGE_HEADER, NO_CONTENT_RESPONSE_HEADER, RelayConfig, +763 Server, ServerConfig, SpawnError, +764 }; +765 use crate::{ +766 client::{ClientBuilder, ConnectError}, +767 dns::DnsResolver, +768 protos::{ +769 handshake, +770 relay::{ClientToRelayMsg, Datagrams, RelayToClientMsg}, +771 }, +772 }; +773 +774 async fn spawn_local_relay() -> std::result::Result<Server, SpawnError> { +775 Server::spawn(ServerConfig::<(), ()> { +776 relay: Some(RelayConfig::<(), ()> { +777 http_bind_addr: (Ipv4Addr::LOCALHOST, 0).into(), +778 tls: None, +779 limits: Default::default(), +780 key_cache_capacity: Some(1024), +781 access: AccessConfig::Everyone, +782 }), +783 quic: None, +784 metrics_addr: None, +785 }) +786 .await +787 } +788 +789 #[instrument] +790 async fn try_send_recv( +791 client_a: &mut crate::client::Client, +792 client_b: &mut crate::client::Client, +793 b_key: NodeId, +794 msg: Datagrams, +795 ) -> Result<RelayToClientMsg> { +796 // try resend 10 times +797 for _ in 0..10 { +798 client_a +799 .send(ClientToRelayMsg::Datagrams { +800 dst_node_id: b_key, +801 datagrams: msg.clone(), +802 }) +803 .await?; +804 let Ok(res) = tokio::time::timeout(Duration::from_millis(500), client_b.next()).await +805 else { +806 continue; +807 }; +808 let res = res.expect("stream finished")?; +809 return Ok(res); +810 } +811 panic!("failed to send and recv message"); +812 } +813 +814 fn dns_resolver() -> DnsResolver { +815 DnsResolver::new() +816 } +817 +818 #[tokio::test] +819 #[traced_test] +820 async fn test_no_services() { +821 let mut server = Server::spawn(ServerConfig::<(), ()>::default()) +822 .await +823 .unwrap(); +824 let res = tokio::time::timeout(Duration::from_secs(5), server.task_handle()) +825 .await +826 .expect("timeout, server not finished") +827 .expect("server task JoinError"); +828 assert!(res.is_err()); +829 } +830 +831 #[tokio::test] +832 #[traced_test] +833 async fn test_conflicting_bind() { +834 let mut server = Server::spawn(ServerConfig::<(), ()> { +835 relay: Some(RelayConfig { +836 http_bind_addr: (Ipv4Addr::LOCALHOST, 1234).into(), +837 tls: None, +838 limits: Default::default(), +839 key_cache_capacity: Some(1024), +840 access: AccessConfig::Everyone, +841 }), +842 quic: None, +843 metrics_addr: Some((Ipv4Addr::LOCALHOST, 1234).into()), +844 }) +845 .await +846 .unwrap(); +847 let res = tokio::time::timeout(Duration::from_secs(5), server.task_handle()) +848 .await +849 .expect("timeout, server not finished") +850 .expect("server task JoinError"); +851 assert!(res.is_err()); // AddrInUse +852 } +853 +854 #[tokio::test] +855 #[traced_test] +856 async fn test_root_handler() { +857 let server = spawn_local_relay().await.unwrap(); +858 let url = format!("http://{}", server.http_addr().unwrap()); +859 +860 let response = reqwest::get(&url).await.unwrap(); +861 assert_eq!(response.status(), 200); +862 let body = response.text().await.unwrap(); +863 assert!(body.contains("iroh.computer")); +864 } +865 +866 #[tokio::test] +867 #[traced_test] +868 async fn test_captive_portal_service() { +869 let server = spawn_local_relay().await.unwrap(); +870 let url = format!("http://{}/generate_204", server.http_addr().unwrap()); +871 let challenge = "123az__."; +872 +873 let client = reqwest::Client::new(); +874 let response = client +875 .get(&url) +876 .header(NO_CONTENT_CHALLENGE_HEADER, challenge) +877 .send() +878 .await +879 .unwrap(); +880 assert_eq!(response.status(), StatusCode::NO_CONTENT); +881 let header = response.headers().get(NO_CONTENT_RESPONSE_HEADER).unwrap(); +882 assert_eq!(header.to_str().unwrap(), format!("response {challenge}")); +883 let body = response.text().await.unwrap(); +884 assert!(body.is_empty()); +885 } +886 +887 #[tokio::test] +888 #[traced_test] +889 async fn test_relay_clients() -> Result<()> { +890 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +891 let server = spawn_local_relay().await?; +892 +893 let relay_url = format!("http://{}", server.http_addr().unwrap()); +894 let relay_url: RelayUrl = relay_url.parse()?; +895 +896 // set up client a +897 let a_secret_key = SecretKey::generate(&mut rng); +898 let a_key = a_secret_key.public(); +899 let resolver = dns_resolver(); +900 info!("client a build & connect"); +901 let mut client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone()) +902 .connect() +903 .await?; +904 +905 // set up client b +906 let b_secret_key = SecretKey::generate(&mut rng); +907 let b_key = b_secret_key.public(); +908 info!("client b build & connect"); +909 let mut client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone()) +910 .connect() +911 .await?; 912 -913 // send message from a to b -914 let msg = Datagrams::from("hello, b"); -915 let res = try_send_recv(&mut client_a, &mut client_b, b_key, msg.clone()).await?; -916 let RelayToClientMsg::Datagrams { -917 remote_node_id, -918 datagrams, -919 } = res -920 else { -921 panic!("client_b received unexpected message {res:?}"); -922 }; -923 -924 assert_eq!(a_key, remote_node_id); -925 assert_eq!(msg, datagrams); -926 -927 info!("sending b -> a"); -928 // send message from b to a -929 let msg = Datagrams::from("howdy, a"); -930 let res = try_send_recv(&mut client_b, &mut client_a, a_key, msg.clone()).await?; -931 -932 let RelayToClientMsg::Datagrams { -933 remote_node_id, -934 datagrams, -935 } = res -936 else { -937 panic!("client_a received unexpected message {res:?}"); -938 }; -939 -940 assert_eq!(b_key, remote_node_id); -941 assert_eq!(msg, datagrams); -942 -943 Ok(()) -944 } -945 -946 #[tokio::test] -947 #[traced_test] -948 async fn test_relay_access_control() -> Result<()> { -949 let current_span = tracing::info_span!("this is a test"); -950 let _guard = current_span.enter(); -951 -952 let a_secret_key = SecretKey::generate(rand::rng()); -953 let a_key = a_secret_key.public(); +913 info!("sending a -> b"); +914 +915 // send message from a to b +916 let msg = Datagrams::from("hello, b"); +917 let res = try_send_recv(&mut client_a, &mut client_b, b_key, msg.clone()).await?; +918 let RelayToClientMsg::Datagrams { +919 remote_node_id, +920 datagrams, +921 } = res +922 else { +923 panic!("client_b received unexpected message {res:?}"); +924 }; +925 +926 assert_eq!(a_key, remote_node_id); +927 assert_eq!(msg, datagrams); +928 +929 info!("sending b -> a"); +930 // send message from b to a +931 let msg = Datagrams::from("howdy, a"); +932 let res = try_send_recv(&mut client_b, &mut client_a, a_key, msg.clone()).await?; +933 +934 let RelayToClientMsg::Datagrams { +935 remote_node_id, +936 datagrams, +937 } = res +938 else { +939 panic!("client_a received unexpected message {res:?}"); +940 }; +941 +942 assert_eq!(b_key, remote_node_id); +943 assert_eq!(msg, datagrams); +944 +945 Ok(()) +946 } +947 +948 #[tokio::test] +949 #[traced_test] +950 async fn test_relay_access_control() -> Result<()> { +951 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +952 let current_span = tracing::info_span!("this is a test"); +953 let _guard = current_span.enter(); 954 -955 let server = Server::spawn(ServerConfig::<(), ()> { -956 relay: Some(RelayConfig::<(), ()> { -957 http_bind_addr: (Ipv4Addr::LOCALHOST, 0).into(), -958 tls: None, -959 limits: Default::default(), -960 key_cache_capacity: Some(1024), -961 access: AccessConfig::Restricted(Box::new(move |node_id| { -962 async move { -963 info!("checking {}", node_id); -964 // reject node a -965 if node_id == a_key { -966 Access::Deny -967 } else { -968 Access::Allow -969 } -970 } -971 .boxed() -972 })), -973 }), -974 quic: None, -975 metrics_addr: None, -976 }) -977 .await?; -978 -979 let relay_url = format!("http://{}", server.http_addr().unwrap()); -980 let relay_url: RelayUrl = relay_url.parse()?; +955 let a_secret_key = SecretKey::generate(&mut rng); +956 let a_key = a_secret_key.public(); +957 +958 let server = Server::spawn(ServerConfig::<(), ()> { +959 relay: Some(RelayConfig::<(), ()> { +960 http_bind_addr: (Ipv4Addr::LOCALHOST, 0).into(), +961 tls: None, +962 limits: Default::default(), +963 key_cache_capacity: Some(1024), +964 access: AccessConfig::Restricted(Box::new(move |node_id| { +965 async move { +966 info!("checking {}", node_id); +967 // reject node a +968 if node_id == a_key { +969 Access::Deny +970 } else { +971 Access::Allow +972 } +973 } +974 .boxed() +975 })), +976 }), +977 quic: None, +978 metrics_addr: None, +979 }) +980 .await?; 981 -982 // set up client a -983 let resolver = dns_resolver(); -984 let result = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver) -985 .connect() -986 .await; -987 -988 assert!( -989 matches!(result, Err(ConnectError::Handshake { source: handshake::Error::ServerDeniedAuth { reason, .. }, .. }) if reason == "not authorized") -990 ); -991 -992 // test that another client has access -993 -994 // set up client b -995 let b_secret_key = SecretKey::generate(rand::rng()); -996 let b_key = b_secret_key.public(); -997 -998 let resolver = dns_resolver(); -999 let mut client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver) -1000 .connect() -1001 .await?; -1002 -1003 // set up client c -1004 let c_secret_key = SecretKey::generate(rand::rng()); -1005 let c_key = c_secret_key.public(); -1006 -1007 let resolver = dns_resolver(); -1008 let mut client_c = ClientBuilder::new(relay_url.clone(), c_secret_key, resolver) -1009 .connect() -1010 .await?; -1011 -1012 // send message from b to c -1013 let msg = Datagrams::from("hello, c"); -1014 let res = try_send_recv(&mut client_b, &mut client_c, c_key, msg.clone()).await?; -1015 -1016 if let RelayToClientMsg::Datagrams { -1017 remote_node_id, -1018 datagrams, -1019 } = res -1020 { -1021 assert_eq!(b_key, remote_node_id); -1022 assert_eq!(msg, datagrams); -1023 } else { -1024 panic!("client_c received unexpected message {res:?}"); -1025 } -1026 -1027 Ok(()) -1028 } +982 let relay_url = format!("http://{}", server.http_addr().unwrap()); +983 let relay_url: RelayUrl = relay_url.parse()?; +984 +985 // set up client a +986 let resolver = dns_resolver(); +987 let result = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver) +988 .connect() +989 .await; +990 +991 assert!( +992 matches!(result, Err(ConnectError::Handshake { source: handshake::Error::ServerDeniedAuth { reason, .. }, .. }) if reason == "not authorized") +993 ); +994 +995 // test that another client has access +996 +997 // set up client b +998 let b_secret_key = SecretKey::generate(&mut rng); +999 let b_key = b_secret_key.public(); +1000 +1001 let resolver = dns_resolver(); +1002 let mut client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver) +1003 .connect() +1004 .await?; +1005 +1006 // set up client c +1007 let c_secret_key = SecretKey::generate(&mut rng); +1008 let c_key = c_secret_key.public(); +1009 +1010 let resolver = dns_resolver(); +1011 let mut client_c = ClientBuilder::new(relay_url.clone(), c_secret_key, resolver) +1012 .connect() +1013 .await?; +1014 +1015 // send message from b to c +1016 let msg = Datagrams::from("hello, c"); +1017 let res = try_send_recv(&mut client_b, &mut client_c, c_key, msg.clone()).await?; +1018 +1019 if let RelayToClientMsg::Datagrams { +1020 remote_node_id, +1021 datagrams, +1022 } = res +1023 { +1024 assert_eq!(b_key, remote_node_id); +1025 assert_eq!(msg, datagrams); +1026 } else { +1027 panic!("client_c received unexpected message {res:?}"); +1028 } 1029 -1030 #[tokio::test] -1031 #[traced_test] -1032 async fn test_relay_clients_full() -> Result<()> { -1033 let server = spawn_local_relay().await.unwrap(); -1034 let relay_url = format!("http://{}", server.http_addr().unwrap()); -1035 let relay_url: RelayUrl = relay_url.parse().unwrap(); -1036 -1037 // set up client a -1038 let a_secret_key = SecretKey::generate(rand::rng()); -1039 let resolver = dns_resolver(); -1040 let mut client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone()) -1041 .connect() -1042 .await?; -1043 -1044 // set up client b -1045 let b_secret_key = SecretKey::generate(rand::rng()); -1046 let b_key = b_secret_key.public(); -1047 let _client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone()) -1048 .connect() -1049 .await?; -1050 -1051 // send messages from a to b, without b receiving anything. -1052 // we should still keep succeeding to send, even if the packet won't be forwarded -1053 // by the relay server because the server's send queue for b fills up. -1054 let msg = Datagrams::from("hello, b"); -1055 for _i in 0..1000 { -1056 client_a -1057 .send(ClientToRelayMsg::Datagrams { -1058 dst_node_id: b_key, -1059 datagrams: msg.clone(), -1060 }) -1061 .await?; -1062 } -1063 Ok(()) -1064 } -1065} \ No newline at end of file +1030 Ok(()) +1031 } +1032 +1033 #[tokio::test] +1034 #[traced_test] +1035 async fn test_relay_clients_full() -> Result<()> { +1036 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1037 let server = spawn_local_relay().await.unwrap(); +1038 let relay_url = format!("http://{}", server.http_addr().unwrap()); +1039 let relay_url: RelayUrl = relay_url.parse().unwrap(); +1040 +1041 // set up client a +1042 let a_secret_key = SecretKey::generate(&mut rng); +1043 let resolver = dns_resolver(); +1044 let mut client_a = ClientBuilder::new(relay_url.clone(), a_secret_key, resolver.clone()) +1045 .connect() +1046 .await?; +1047 +1048 // set up client b +1049 let b_secret_key = SecretKey::generate(&mut rng); +1050 let b_key = b_secret_key.public(); +1051 let _client_b = ClientBuilder::new(relay_url.clone(), b_secret_key, resolver.clone()) +1052 .connect() +1053 .await?; +1054 +1055 // send messages from a to b, without b receiving anything. +1056 // we should still keep succeeding to send, even if the packet won't be forwarded +1057 // by the relay server because the server's send queue for b fills up. +1058 let msg = Datagrams::from("hello, b"); +1059 for _i in 0..1000 { +1060 client_a +1061 .send(ClientToRelayMsg::Datagrams { +1062 dst_node_id: b_key, +1063 datagrams: msg.clone(), +1064 }) +1065 .await?; +1066 } +1067 Ok(()) +1068 } +1069} \ No newline at end of file diff --git a/pr/3465/docs/src/iroh_relay/server/client.rs.html b/pr/3465/docs/src/iroh_relay/server/client.rs.html index 69e0b4626f..48899a4aef 100644 --- a/pr/3465/docs/src/iroh_relay/server/client.rs.html +++ b/pr/3465/docs/src/iroh_relay/server/client.rs.html @@ -567,209 +567,214 @@ 567 use iroh_base::SecretKey; 568 use n0_future::Stream; 569 use n0_snafu::{Result, ResultExt}; -570 use tracing::info; -571 use tracing_test::traced_test; -572 -573 use super::*; -574 use crate::{client::conn::Conn, protos::common::FrameType}; -575 -576 async fn recv_frame< -577 E: snafu::Error + Sync + Send + 'static, -578 S: Stream<Item = Result<RelayToClientMsg, E>> + Unpin, -579 >( -580 frame_type: FrameType, -581 mut stream: S, -582 ) -> Result<RelayToClientMsg> { -583 match stream.next().await { -584 Some(Ok(frame)) => { -585 if frame_type != frame.typ() { -586 snafu::whatever!( -587 "Unexpected frame, got {:?}, but expected {:?}", -588 frame.typ(), -589 frame_type -590 ); -591 } -592 Ok(frame) -593 } -594 Some(Err(err)) => Err(err).e(), -595 None => snafu::whatever!("Unexpected EOF, expected frame {frame_type:?}"), -596 } -597 } -598 -599 #[tokio::test] -600 #[traced_test] -601 async fn test_client_actor_basic() -> Result { -602 let (send_queue_s, send_queue_r) = mpsc::channel(10); -603 let (disco_send_queue_s, disco_send_queue_r) = mpsc::channel(10); -604 let (peer_gone_s, peer_gone_r) = mpsc::channel(10); -605 -606 let node_id = SecretKey::generate(rand::rng()).public(); -607 let (io, io_rw) = tokio::io::duplex(1024); -608 let mut io_rw = Conn::test(io_rw); -609 let stream = RelayedStream::test(io); -610 -611 let clients = Clients::default(); -612 let metrics = Arc::new(Metrics::default()); -613 let actor = Actor { -614 stream, -615 timeout: Duration::from_secs(1), -616 send_queue: send_queue_r, -617 disco_send_queue: disco_send_queue_r, -618 node_gone: peer_gone_r, -619 connection_id: 0, -620 node_id, -621 clients: clients.clone(), -622 client_counter: ClientCounter::default(), -623 ping_tracker: PingTracker::default(), -624 metrics, -625 }; -626 -627 let done = CancellationToken::new(); -628 let io_done = done.clone(); -629 let handle = tokio::task::spawn(async move { actor.run(io_done).await }); -630 -631 // Write tests -632 println!("-- write"); -633 let data = b"hello world!"; -634 -635 // send packet -636 println!(" send packet"); -637 let packet = Packet { -638 src: node_id, -639 data: Datagrams::from(&data[..]), -640 }; -641 send_queue_s.send(packet.clone()).await.context("send")?; -642 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut io_rw) -643 .await -644 .e()?; -645 assert_eq!( -646 frame, -647 RelayToClientMsg::Datagrams { -648 remote_node_id: node_id, -649 datagrams: data.to_vec().into() -650 } -651 ); -652 -653 // send disco packet -654 println!(" send disco packet"); -655 disco_send_queue_s -656 .send(packet.clone()) -657 .await -658 .context("send")?; -659 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut io_rw) +570 use rand::SeedableRng; +571 use tracing::info; +572 use tracing_test::traced_test; +573 +574 use super::*; +575 use crate::{client::conn::Conn, protos::common::FrameType}; +576 +577 async fn recv_frame< +578 E: snafu::Error + Sync + Send + 'static, +579 S: Stream<Item = Result<RelayToClientMsg, E>> + Unpin, +580 >( +581 frame_type: FrameType, +582 mut stream: S, +583 ) -> Result<RelayToClientMsg> { +584 match stream.next().await { +585 Some(Ok(frame)) => { +586 if frame_type != frame.typ() { +587 snafu::whatever!( +588 "Unexpected frame, got {:?}, but expected {:?}", +589 frame.typ(), +590 frame_type +591 ); +592 } +593 Ok(frame) +594 } +595 Some(Err(err)) => Err(err).e(), +596 None => snafu::whatever!("Unexpected EOF, expected frame {frame_type:?}"), +597 } +598 } +599 +600 #[tokio::test] +601 #[traced_test] +602 async fn test_client_actor_basic() -> Result { +603 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +604 +605 let (send_queue_s, send_queue_r) = mpsc::channel(10); +606 let (disco_send_queue_s, disco_send_queue_r) = mpsc::channel(10); +607 let (peer_gone_s, peer_gone_r) = mpsc::channel(10); +608 +609 let node_id = SecretKey::generate(&mut rng).public(); +610 let (io, io_rw) = tokio::io::duplex(1024); +611 let mut io_rw = Conn::test(io_rw); +612 let stream = RelayedStream::test(io); +613 +614 let clients = Clients::default(); +615 let metrics = Arc::new(Metrics::default()); +616 let actor = Actor { +617 stream, +618 timeout: Duration::from_secs(1), +619 send_queue: send_queue_r, +620 disco_send_queue: disco_send_queue_r, +621 node_gone: peer_gone_r, +622 connection_id: 0, +623 node_id, +624 clients: clients.clone(), +625 client_counter: ClientCounter::default(), +626 ping_tracker: PingTracker::default(), +627 metrics, +628 }; +629 +630 let done = CancellationToken::new(); +631 let io_done = done.clone(); +632 let handle = tokio::task::spawn(async move { actor.run(io_done).await }); +633 +634 // Write tests +635 println!("-- write"); +636 let data = b"hello world!"; +637 +638 // send packet +639 println!(" send packet"); +640 let packet = Packet { +641 src: node_id, +642 data: Datagrams::from(&data[..]), +643 }; +644 send_queue_s.send(packet.clone()).await.context("send")?; +645 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut io_rw) +646 .await +647 .e()?; +648 assert_eq!( +649 frame, +650 RelayToClientMsg::Datagrams { +651 remote_node_id: node_id, +652 datagrams: data.to_vec().into() +653 } +654 ); +655 +656 // send disco packet +657 println!(" send disco packet"); +658 disco_send_queue_s +659 .send(packet.clone()) 660 .await -661 .e()?; -662 assert_eq!( -663 frame, -664 RelayToClientMsg::Datagrams { -665 remote_node_id: node_id, -666 datagrams: data.to_vec().into() -667 } -668 ); -669 -670 // send peer_gone -671 println!("send peer gone"); -672 peer_gone_s.send(node_id).await.context("send")?; -673 let frame = recv_frame(FrameType::NodeGone, &mut io_rw).await.e()?; -674 assert_eq!(frame, RelayToClientMsg::NodeGone(node_id)); -675 -676 // Read tests -677 println!("--read"); +661 .context("send")?; +662 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut io_rw) +663 .await +664 .e()?; +665 assert_eq!( +666 frame, +667 RelayToClientMsg::Datagrams { +668 remote_node_id: node_id, +669 datagrams: data.to_vec().into() +670 } +671 ); +672 +673 // send peer_gone +674 println!("send peer gone"); +675 peer_gone_s.send(node_id).await.context("send")?; +676 let frame = recv_frame(FrameType::NodeGone, &mut io_rw).await.e()?; +677 assert_eq!(frame, RelayToClientMsg::NodeGone(node_id)); 678 -679 // send ping, expect pong -680 let data = b"pingpong"; -681 io_rw.send(ClientToRelayMsg::Ping(*data)).await?; -682 -683 // recv pong -684 println!(" recv pong"); -685 let frame = recv_frame(FrameType::Pong, &mut io_rw).await?; -686 assert_eq!(frame, RelayToClientMsg::Pong(*data)); -687 -688 let target = SecretKey::generate(rand::rng()).public(); -689 -690 // send packet -691 println!(" send packet"); -692 let data = b"hello world!"; -693 io_rw -694 .send(ClientToRelayMsg::Datagrams { -695 dst_node_id: target, -696 datagrams: Datagrams::from(data), -697 }) -698 .await -699 .context("send")?; -700 -701 // send disco packet -702 println!(" send disco packet"); -703 // starts with `MAGIC` & key, then data -704 let mut disco_data = disco::MAGIC.as_bytes().to_vec(); -705 disco_data.extend_from_slice(target.as_bytes()); -706 disco_data.extend_from_slice(data); -707 io_rw -708 .send(ClientToRelayMsg::Datagrams { -709 dst_node_id: target, -710 datagrams: disco_data.clone().into(), -711 }) -712 .await -713 .context("send")?; -714 -715 done.cancel(); -716 handle.await.context("join")?; -717 Ok(()) -718 } -719 -720 #[tokio::test(start_paused = true)] -721 #[traced_test] -722 async fn test_rate_limit() -> Result { -723 const LIMIT: u32 = 50; -724 const MAX_FRAMES: u32 = 100; -725 -726 // Build the rate limited stream. -727 let (io_read, io_write) = tokio::io::duplex((LIMIT * MAX_FRAMES) as _); -728 let mut frame_writer = Conn::test(io_write); -729 // Rate limiter allowing LIMIT bytes/s -730 let mut stream = RelayedStream::test_limited(io_read, LIMIT / 10, LIMIT)?; -731 -732 // Prepare a frame to send, assert its size. -733 let data = Datagrams::from(b"hello world!!!!!"); -734 let target = SecretKey::generate(rand::rng()).public(); -735 let frame = ClientToRelayMsg::Datagrams { -736 dst_node_id: target, -737 datagrams: data.clone(), -738 }; -739 let frame_len = frame.to_bytes().len(); -740 assert_eq!(frame_len, LIMIT as usize); -741 -742 // Send a frame, it should arrive. -743 info!("-- send packet"); -744 frame_writer.send(frame.clone()).await.context("send")?; -745 frame_writer.flush().await.context("flush")?; -746 let recv_frame = tokio::time::timeout(Duration::from_millis(500), stream.next()) -747 .await -748 .expect("timeout") -749 .expect("option") -750 .expect("ok"); -751 assert_eq!(recv_frame, frame); -752 -753 // Next frame does not arrive. -754 info!("-- send packet"); -755 frame_writer.send(frame.clone()).await.context("send")?; -756 frame_writer.flush().await.context("flush")?; -757 let res = tokio::time::timeout(Duration::from_millis(100), stream.next()).await; -758 assert!(res.is_err(), "expecting a timeout"); -759 info!("-- timeout happened"); -760 -761 // Wait long enough. -762 info!("-- sleep"); -763 tokio::time::sleep(Duration::from_secs(1)).await; -764 -765 // Frame arrives. -766 let recv_frame = tokio::time::timeout(Duration::from_millis(500), stream.next()) -767 .await -768 .expect("timeout") -769 .expect("option") -770 .expect("ok"); -771 assert_eq!(recv_frame, frame); -772 -773 Ok(()) -774 } -775} \ No newline at end of file +679 // Read tests +680 println!("--read"); +681 +682 // send ping, expect pong +683 let data = b"pingpong"; +684 io_rw.send(ClientToRelayMsg::Ping(*data)).await?; +685 +686 // recv pong +687 println!(" recv pong"); +688 let frame = recv_frame(FrameType::Pong, &mut io_rw).await?; +689 assert_eq!(frame, RelayToClientMsg::Pong(*data)); +690 +691 let target = SecretKey::generate(&mut rng).public(); +692 +693 // send packet +694 println!(" send packet"); +695 let data = b"hello world!"; +696 io_rw +697 .send(ClientToRelayMsg::Datagrams { +698 dst_node_id: target, +699 datagrams: Datagrams::from(data), +700 }) +701 .await +702 .context("send")?; +703 +704 // send disco packet +705 println!(" send disco packet"); +706 // starts with `MAGIC` & key, then data +707 let mut disco_data = disco::MAGIC.as_bytes().to_vec(); +708 disco_data.extend_from_slice(target.as_bytes()); +709 disco_data.extend_from_slice(data); +710 io_rw +711 .send(ClientToRelayMsg::Datagrams { +712 dst_node_id: target, +713 datagrams: disco_data.clone().into(), +714 }) +715 .await +716 .context("send")?; +717 +718 done.cancel(); +719 handle.await.context("join")?; +720 Ok(()) +721 } +722 +723 #[tokio::test(start_paused = true)] +724 #[traced_test] +725 async fn test_rate_limit() -> Result { +726 const LIMIT: u32 = 50; +727 const MAX_FRAMES: u32 = 100; +728 +729 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +730 +731 // Build the rate limited stream. +732 let (io_read, io_write) = tokio::io::duplex((LIMIT * MAX_FRAMES) as _); +733 let mut frame_writer = Conn::test(io_write); +734 // Rate limiter allowing LIMIT bytes/s +735 let mut stream = RelayedStream::test_limited(io_read, LIMIT / 10, LIMIT)?; +736 +737 // Prepare a frame to send, assert its size. +738 let data = Datagrams::from(b"hello world!!!!!"); +739 let target = SecretKey::generate(&mut rng).public(); +740 let frame = ClientToRelayMsg::Datagrams { +741 dst_node_id: target, +742 datagrams: data.clone(), +743 }; +744 let frame_len = frame.to_bytes().len(); +745 assert_eq!(frame_len, LIMIT as usize); +746 +747 // Send a frame, it should arrive. +748 info!("-- send packet"); +749 frame_writer.send(frame.clone()).await.context("send")?; +750 frame_writer.flush().await.context("flush")?; +751 let recv_frame = tokio::time::timeout(Duration::from_millis(500), stream.next()) +752 .await +753 .expect("timeout") +754 .expect("option") +755 .expect("ok"); +756 assert_eq!(recv_frame, frame); +757 +758 // Next frame does not arrive. +759 info!("-- send packet"); +760 frame_writer.send(frame.clone()).await.context("send")?; +761 frame_writer.flush().await.context("flush")?; +762 let res = tokio::time::timeout(Duration::from_millis(100), stream.next()).await; +763 assert!(res.is_err(), "expecting a timeout"); +764 info!("-- timeout happened"); +765 +766 // Wait long enough. +767 info!("-- sleep"); +768 tokio::time::sleep(Duration::from_secs(1)).await; +769 +770 // Frame arrives. +771 let recv_frame = tokio::time::timeout(Duration::from_millis(500), stream.next()) +772 .await +773 .expect("timeout") +774 .expect("option") +775 .expect("ok"); +776 assert_eq!(recv_frame, frame); +777 +778 Ok(()) +779 } +780} \ No newline at end of file diff --git a/pr/3465/docs/src/iroh_relay/server/clients.rs.html b/pr/3465/docs/src/iroh_relay/server/clients.rs.html index eb099d773c..25142cfe6d 100644 --- a/pr/3465/docs/src/iroh_relay/server/clients.rs.html +++ b/pr/3465/docs/src/iroh_relay/server/clients.rs.html @@ -196,104 +196,106 @@ 196 use iroh_base::SecretKey; 197 use n0_future::{Stream, StreamExt}; 198 use n0_snafu::{Result, ResultExt}; -199 -200 use super::*; -201 use crate::{ -202 client::conn::Conn, -203 protos::{common::FrameType, relay::RelayToClientMsg}, -204 server::streams::RelayedStream, -205 }; -206 -207 async fn recv_frame< -208 E: snafu::Error + Sync + Send + 'static, -209 S: Stream<Item = Result<RelayToClientMsg, E>> + Unpin, -210 >( -211 frame_type: FrameType, -212 mut stream: S, -213 ) -> Result<RelayToClientMsg> { -214 match stream.next().await { -215 Some(Ok(frame)) => { -216 if frame_type != frame.typ() { -217 snafu::whatever!( -218 "Unexpected frame, got {:?}, but expected {:?}", -219 frame.typ(), -220 frame_type -221 ); -222 } -223 Ok(frame) -224 } -225 Some(Err(err)) => Err(err).e(), -226 None => snafu::whatever!("Unexpected EOF, expected frame {frame_type:?}"), -227 } -228 } -229 -230 fn test_client_builder(key: NodeId) -> (Config, Conn) { -231 let (server, client) = tokio::io::duplex(1024); -232 ( -233 Config { -234 node_id: key, -235 stream: RelayedStream::test(server), -236 write_timeout: Duration::from_secs(1), -237 channel_capacity: 10, -238 }, -239 Conn::test(client), -240 ) -241 } -242 -243 #[tokio::test] -244 async fn test_clients() -> Result { -245 let a_key = SecretKey::generate(rand::rng()).public(); -246 let b_key = SecretKey::generate(rand::rng()).public(); -247 -248 let (builder_a, mut a_rw) = test_client_builder(a_key); +199 use rand::SeedableRng; +200 +201 use super::*; +202 use crate::{ +203 client::conn::Conn, +204 protos::{common::FrameType, relay::RelayToClientMsg}, +205 server::streams::RelayedStream, +206 }; +207 +208 async fn recv_frame< +209 E: snafu::Error + Sync + Send + 'static, +210 S: Stream<Item = Result<RelayToClientMsg, E>> + Unpin, +211 >( +212 frame_type: FrameType, +213 mut stream: S, +214 ) -> Result<RelayToClientMsg> { +215 match stream.next().await { +216 Some(Ok(frame)) => { +217 if frame_type != frame.typ() { +218 snafu::whatever!( +219 "Unexpected frame, got {:?}, but expected {:?}", +220 frame.typ(), +221 frame_type +222 ); +223 } +224 Ok(frame) +225 } +226 Some(Err(err)) => Err(err).e(), +227 None => snafu::whatever!("Unexpected EOF, expected frame {frame_type:?}"), +228 } +229 } +230 +231 fn test_client_builder(key: NodeId) -> (Config, Conn) { +232 let (server, client) = tokio::io::duplex(1024); +233 ( +234 Config { +235 node_id: key, +236 stream: RelayedStream::test(server), +237 write_timeout: Duration::from_secs(1), +238 channel_capacity: 10, +239 }, +240 Conn::test(client), +241 ) +242 } +243 +244 #[tokio::test] +245 async fn test_clients() -> Result { +246 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +247 let a_key = SecretKey::generate(&mut rng).public(); +248 let b_key = SecretKey::generate(&mut rng).public(); 249 -250 let clients = Clients::default(); -251 let metrics = Arc::new(Metrics::default()); -252 clients.register(builder_a, metrics.clone()).await; -253 -254 // send packet -255 let data = b"hello world!"; -256 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; -257 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a_rw).await?; -258 assert_eq!( -259 frame, -260 RelayToClientMsg::Datagrams { -261 remote_node_id: b_key, -262 datagrams: data.to_vec().into(), -263 } -264 ); -265 -266 // send disco packet -267 clients.send_disco_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; -268 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a_rw).await?; -269 assert_eq!( -270 frame, -271 RelayToClientMsg::Datagrams { -272 remote_node_id: b_key, -273 datagrams: data.to_vec().into(), -274 } -275 ); -276 -277 { -278 let client = clients.0.clients.get(&a_key).unwrap(); -279 // shutdown client a, this should trigger the removal from the clients list -280 client.start_shutdown(); -281 } -282 -283 // need to wait a moment for the removal to be processed -284 let c = clients.clone(); -285 tokio::time::timeout(Duration::from_secs(1), async move { -286 loop { -287 if !c.0.clients.contains_key(&a_key) { -288 break; -289 } -290 tokio::time::sleep(Duration::from_millis(100)).await; -291 } -292 }) -293 .await -294 .context("timeout")?; -295 clients.shutdown().await; -296 -297 Ok(()) -298 } -299} \ No newline at end of file +250 let (builder_a, mut a_rw) = test_client_builder(a_key); +251 +252 let clients = Clients::default(); +253 let metrics = Arc::new(Metrics::default()); +254 clients.register(builder_a, metrics.clone()).await; +255 +256 // send packet +257 let data = b"hello world!"; +258 clients.send_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; +259 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a_rw).await?; +260 assert_eq!( +261 frame, +262 RelayToClientMsg::Datagrams { +263 remote_node_id: b_key, +264 datagrams: data.to_vec().into(), +265 } +266 ); +267 +268 // send disco packet +269 clients.send_disco_packet(a_key, Datagrams::from(&data[..]), b_key, &metrics)?; +270 let frame = recv_frame(FrameType::RelayToClientDatagram, &mut a_rw).await?; +271 assert_eq!( +272 frame, +273 RelayToClientMsg::Datagrams { +274 remote_node_id: b_key, +275 datagrams: data.to_vec().into(), +276 } +277 ); +278 +279 { +280 let client = clients.0.clients.get(&a_key).unwrap(); +281 // shutdown client a, this should trigger the removal from the clients list +282 client.start_shutdown(); +283 } +284 +285 // need to wait a moment for the removal to be processed +286 let c = clients.clone(); +287 tokio::time::timeout(Duration::from_secs(1), async move { +288 loop { +289 if !c.0.clients.contains_key(&a_key) { +290 break; +291 } +292 tokio::time::sleep(Duration::from_millis(100)).await; +293 } +294 }) +295 .await +296 .context("timeout")?; +297 clients.shutdown().await; +298 +299 Ok(()) +300 } +301} \ No newline at end of file diff --git a/pr/3465/docs/src/iroh_relay/server/http_server.rs.html b/pr/3465/docs/src/iroh_relay/server/http_server.rs.html index 0544bd8d2f..55c861fb43 100644 --- a/pr/3465/docs/src/iroh_relay/server/http_server.rs.html +++ b/pr/3465/docs/src/iroh_relay/server/http_server.rs.html @@ -868,485 +868,494 @@ 868 use iroh_base::{PublicKey, SecretKey}; 869 use n0_future::{SinkExt, StreamExt}; 870 use n0_snafu::{Result, ResultExt}; -871 use reqwest::Url; -872 use snafu::whatever; -873 use tracing::info; -874 use tracing_test::traced_test; -875 -876 use super::*; -877 use crate::{ -878 client::{Client, ClientBuilder, ConnectError, conn::Conn}, -879 dns::DnsResolver, -880 protos::relay::{ClientToRelayMsg, Datagrams, RelayToClientMsg}, -881 }; -882 -883 pub(crate) fn make_tls_config() -> TlsConfig { -884 let subject_alt_names = vec!["localhost".to_string()]; -885 -886 let cert = rcgen::generate_simple_self_signed(subject_alt_names).unwrap(); -887 let rustls_certificate = cert.cert.der().clone(); -888 let rustls_key = -889 rustls::pki_types::PrivatePkcs8KeyDer::from(cert.signing_key.serialize_der()); -890 let config = rustls::ServerConfig::builder_with_provider(Arc::new( -891 rustls::crypto::ring::default_provider(), -892 )) -893 .with_safe_default_protocol_versions() -894 .expect("protocols supported by ring") -895 .with_no_client_auth() -896 .with_single_cert(vec![(rustls_certificate)], rustls_key.into()) -897 .expect("cert is right"); -898 -899 let config = Arc::new(config); -900 let acceptor = tokio_rustls::TlsAcceptor::from(config.clone()); -901 -902 TlsConfig { -903 config, -904 acceptor: TlsAcceptor::Manual(acceptor), -905 } -906 } -907 -908 #[tokio::test] -909 #[traced_test] -910 async fn test_http_clients_and_server() -> Result { -911 let a_key = SecretKey::generate(rand::rng()); -912 let b_key = SecretKey::generate(rand::rng()); +871 use rand::SeedableRng; +872 use reqwest::Url; +873 use snafu::whatever; +874 use tracing::info; +875 use tracing_test::traced_test; +876 +877 use super::*; +878 use crate::{ +879 client::{Client, ClientBuilder, ConnectError, conn::Conn}, +880 dns::DnsResolver, +881 protos::relay::{ClientToRelayMsg, Datagrams, RelayToClientMsg}, +882 }; +883 +884 pub(crate) fn make_tls_config() -> TlsConfig { +885 let subject_alt_names = vec!["localhost".to_string()]; +886 +887 let cert = rcgen::generate_simple_self_signed(subject_alt_names).unwrap(); +888 let rustls_certificate = cert.cert.der().clone(); +889 let rustls_key = +890 rustls::pki_types::PrivatePkcs8KeyDer::from(cert.signing_key.serialize_der()); +891 let config = rustls::ServerConfig::builder_with_provider(Arc::new( +892 rustls::crypto::ring::default_provider(), +893 )) +894 .with_safe_default_protocol_versions() +895 .expect("protocols supported by ring") +896 .with_no_client_auth() +897 .with_single_cert(vec![(rustls_certificate)], rustls_key.into()) +898 .expect("cert is right"); +899 +900 let config = Arc::new(config); +901 let acceptor = tokio_rustls::TlsAcceptor::from(config.clone()); +902 +903 TlsConfig { +904 config, +905 acceptor: TlsAcceptor::Manual(acceptor), +906 } +907 } +908 +909 #[tokio::test] +910 #[traced_test] +911 async fn test_http_clients_and_server() -> Result { +912 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); 913 -914 // start server -915 let server = ServerBuilder::new("127.0.0.1:0".parse().unwrap()) -916 .spawn() -917 .await?; -918 -919 let addr = server.addr(); -920 -921 // get dial info -922 let port = addr.port(); -923 let addr = if let std::net::IpAddr::V4(ipv4_addr) = addr.ip() { -924 ipv4_addr -925 } else { -926 whatever!("cannot get ipv4 addr from socket addr {addr:?}"); -927 }; -928 -929 info!("addr: {addr}:{port}"); -930 let relay_addr: Url = format!("http://{addr}:{port}").parse().unwrap(); +914 let a_key = SecretKey::generate(&mut rng); +915 let b_key = SecretKey::generate(&mut rng); +916 +917 // start server +918 let server = ServerBuilder::new("127.0.0.1:0".parse().unwrap()) +919 .spawn() +920 .await?; +921 +922 let addr = server.addr(); +923 +924 // get dial info +925 let port = addr.port(); +926 let addr = if let std::net::IpAddr::V4(ipv4_addr) = addr.ip() { +927 ipv4_addr +928 } else { +929 whatever!("cannot get ipv4 addr from socket addr {addr:?}"); +930 }; 931 -932 // create clients -933 let (a_key, mut client_a) = create_test_client(a_key, relay_addr.clone()).await?; -934 info!("created client {a_key:?}"); -935 let (b_key, mut client_b) = create_test_client(b_key, relay_addr).await?; -936 info!("created client {b_key:?}"); -937 -938 info!("ping a"); -939 client_a.send(ClientToRelayMsg::Ping([1u8; 8])).await?; -940 let pong = client_a.next().await.expect("eos")?; -941 assert!(matches!(pong, RelayToClientMsg::Pong { .. })); -942 -943 info!("ping b"); -944 client_b.send(ClientToRelayMsg::Ping([2u8; 8])).await?; -945 let pong = client_b.next().await.expect("eos")?; -946 assert!(matches!(pong, RelayToClientMsg::Pong { .. })); -947 -948 info!("sending message from a to b"); -949 let msg = Datagrams::from(b"hi there, client b!"); -950 client_a -951 .send(ClientToRelayMsg::Datagrams { -952 dst_node_id: b_key, -953 datagrams: msg.clone(), -954 }) -955 .await?; -956 info!("waiting for message from a on b"); -957 let (got_key, got_msg) = -958 process_msg(client_b.next().await).expect("expected message from client_a"); -959 assert_eq!(a_key, got_key); -960 assert_eq!(msg, got_msg); -961 -962 info!("sending message from b to a"); -963 let msg = Datagrams::from(b"right back at ya, client b!"); -964 client_b -965 .send(ClientToRelayMsg::Datagrams { -966 dst_node_id: a_key, -967 datagrams: msg.clone(), -968 }) -969 .await?; -970 info!("waiting for message b on a"); -971 let (got_key, got_msg) = -972 process_msg(client_a.next().await).expect("expected message from client_b"); -973 assert_eq!(b_key, got_key); -974 assert_eq!(msg, got_msg); -975 -976 // Close before shutting down, otherwise we'll try to send close frames on broken pipes -977 client_a.close().await?; -978 client_b.close().await?; -979 server.shutdown(); -980 -981 Ok(()) -982 } +932 info!("addr: {addr}:{port}"); +933 let relay_addr: Url = format!("http://{addr}:{port}").parse().unwrap(); +934 +935 // create clients +936 let (a_key, mut client_a) = create_test_client(a_key, relay_addr.clone()).await?; +937 info!("created client {a_key:?}"); +938 let (b_key, mut client_b) = create_test_client(b_key, relay_addr).await?; +939 info!("created client {b_key:?}"); +940 +941 info!("ping a"); +942 client_a.send(ClientToRelayMsg::Ping([1u8; 8])).await?; +943 let pong = client_a.next().await.expect("eos")?; +944 assert!(matches!(pong, RelayToClientMsg::Pong { .. })); +945 +946 info!("ping b"); +947 client_b.send(ClientToRelayMsg::Ping([2u8; 8])).await?; +948 let pong = client_b.next().await.expect("eos")?; +949 assert!(matches!(pong, RelayToClientMsg::Pong { .. })); +950 +951 info!("sending message from a to b"); +952 let msg = Datagrams::from(b"hi there, client b!"); +953 client_a +954 .send(ClientToRelayMsg::Datagrams { +955 dst_node_id: b_key, +956 datagrams: msg.clone(), +957 }) +958 .await?; +959 info!("waiting for message from a on b"); +960 let (got_key, got_msg) = +961 process_msg(client_b.next().await).expect("expected message from client_a"); +962 assert_eq!(a_key, got_key); +963 assert_eq!(msg, got_msg); +964 +965 info!("sending message from b to a"); +966 let msg = Datagrams::from(b"right back at ya, client b!"); +967 client_b +968 .send(ClientToRelayMsg::Datagrams { +969 dst_node_id: a_key, +970 datagrams: msg.clone(), +971 }) +972 .await?; +973 info!("waiting for message b on a"); +974 let (got_key, got_msg) = +975 process_msg(client_a.next().await).expect("expected message from client_b"); +976 assert_eq!(b_key, got_key); +977 assert_eq!(msg, got_msg); +978 +979 // Close before shutting down, otherwise we'll try to send close frames on broken pipes +980 client_a.close().await?; +981 client_b.close().await?; +982 server.shutdown(); 983 -984 async fn create_test_client( -985 key: SecretKey, -986 server_url: Url, -987 ) -> Result<(PublicKey, Client), ConnectError> { -988 let public_key = key.public(); -989 let client = -990 ClientBuilder::new(server_url, key, DnsResolver::new()).insecure_skip_cert_verify(true); -991 let client = client.connect().await?; -992 -993 Ok((public_key, client)) -994 } +984 Ok(()) +985 } +986 +987 async fn create_test_client( +988 key: SecretKey, +989 server_url: Url, +990 ) -> Result<(PublicKey, Client), ConnectError> { +991 let public_key = key.public(); +992 let client = +993 ClientBuilder::new(server_url, key, DnsResolver::new()).insecure_skip_cert_verify(true); +994 let client = client.connect().await?; 995 -996 fn process_msg( -997 msg: Option<Result<RelayToClientMsg, crate::client::RecvError>>, -998 ) -> Option<(PublicKey, Datagrams)> { -999 match msg { -1000 Some(Err(e)) => { -1001 info!("client `recv` error {e}"); -1002 None -1003 } -1004 Some(Ok(msg)) => { -1005 info!("got message on: {msg:?}"); -1006 if let RelayToClientMsg::Datagrams { -1007 remote_node_id: source, -1008 datagrams, -1009 } = msg -1010 { -1011 Some((source, datagrams)) -1012 } else { -1013 None -1014 } -1015 } -1016 None => { -1017 info!("client end of stream"); -1018 None -1019 } -1020 } -1021 } -1022 -1023 #[tokio::test] -1024 #[traced_test] -1025 async fn test_https_clients_and_server() -> Result { -1026 let a_key = SecretKey::generate(rand::rng()); -1027 let b_key = SecretKey::generate(rand::rng()); -1028 -1029 // create tls_config -1030 let tls_config = make_tls_config(); -1031 -1032 // start server -1033 let mut server = ServerBuilder::new("127.0.0.1:0".parse().unwrap()) -1034 .tls_config(Some(tls_config)) -1035 .spawn() -1036 .await?; -1037 -1038 let addr = server.addr(); -1039 -1040 // get dial info -1041 let port = addr.port(); -1042 let addr = if let std::net::IpAddr::V4(ipv4_addr) = addr.ip() { -1043 ipv4_addr -1044 } else { -1045 whatever!("cannot get ipv4 addr from socket addr {addr:?}"); -1046 }; -1047 -1048 info!("Relay listening on: {addr}:{port}"); -1049 -1050 let url: Url = format!("https://localhost:{port}").parse().unwrap(); -1051 -1052 // create clients -1053 let (a_key, mut client_a) = create_test_client(a_key, url.clone()).await?; -1054 info!("created client {a_key:?}"); -1055 let (b_key, mut client_b) = create_test_client(b_key, url).await?; -1056 info!("created client {b_key:?}"); -1057 -1058 info!("ping a"); -1059 client_a.send(ClientToRelayMsg::Ping([1u8; 8])).await?; -1060 let pong = client_a.next().await.expect("eos")?; -1061 assert!(matches!(pong, RelayToClientMsg::Pong { .. })); +996 Ok((public_key, client)) +997 } +998 +999 fn process_msg( +1000 msg: Option<Result<RelayToClientMsg, crate::client::RecvError>>, +1001 ) -> Option<(PublicKey, Datagrams)> { +1002 match msg { +1003 Some(Err(e)) => { +1004 info!("client `recv` error {e}"); +1005 None +1006 } +1007 Some(Ok(msg)) => { +1008 info!("got message on: {msg:?}"); +1009 if let RelayToClientMsg::Datagrams { +1010 remote_node_id: source, +1011 datagrams, +1012 } = msg +1013 { +1014 Some((source, datagrams)) +1015 } else { +1016 None +1017 } +1018 } +1019 None => { +1020 info!("client end of stream"); +1021 None +1022 } +1023 } +1024 } +1025 +1026 #[tokio::test] +1027 #[traced_test] +1028 async fn test_https_clients_and_server() -> Result { +1029 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1030 +1031 let a_key = SecretKey::generate(&mut rng); +1032 let b_key = SecretKey::generate(&mut rng); +1033 +1034 // create tls_config +1035 let tls_config = make_tls_config(); +1036 +1037 // start server +1038 let mut server = ServerBuilder::new("127.0.0.1:0".parse().unwrap()) +1039 .tls_config(Some(tls_config)) +1040 .spawn() +1041 .await?; +1042 +1043 let addr = server.addr(); +1044 +1045 // get dial info +1046 let port = addr.port(); +1047 let addr = if let std::net::IpAddr::V4(ipv4_addr) = addr.ip() { +1048 ipv4_addr +1049 } else { +1050 whatever!("cannot get ipv4 addr from socket addr {addr:?}"); +1051 }; +1052 +1053 info!("Relay listening on: {addr}:{port}"); +1054 +1055 let url: Url = format!("https://localhost:{port}").parse().unwrap(); +1056 +1057 // create clients +1058 let (a_key, mut client_a) = create_test_client(a_key, url.clone()).await?; +1059 info!("created client {a_key:?}"); +1060 let (b_key, mut client_b) = create_test_client(b_key, url).await?; +1061 info!("created client {b_key:?}"); 1062 -1063 info!("ping b"); -1064 client_b.send(ClientToRelayMsg::Ping([2u8; 8])).await?; -1065 let pong = client_b.next().await.expect("eos")?; +1063 info!("ping a"); +1064 client_a.send(ClientToRelayMsg::Ping([1u8; 8])).await?; +1065 let pong = client_a.next().await.expect("eos")?; 1066 assert!(matches!(pong, RelayToClientMsg::Pong { .. })); 1067 -1068 info!("sending message from a to b"); -1069 let msg = Datagrams::from(b"hi there, client b!"); -1070 client_a -1071 .send(ClientToRelayMsg::Datagrams { -1072 dst_node_id: b_key, -1073 datagrams: msg.clone(), -1074 }) -1075 .await?; -1076 info!("waiting for message from a on b"); -1077 let (got_key, got_msg) = -1078 process_msg(client_b.next().await).expect("expected message from client_a"); -1079 assert_eq!(a_key, got_key); -1080 assert_eq!(msg, got_msg); -1081 -1082 info!("sending message from b to a"); -1083 let msg = Datagrams::from(b"right back at ya, client b!"); -1084 client_b -1085 .send(ClientToRelayMsg::Datagrams { -1086 dst_node_id: a_key, -1087 datagrams: msg.clone(), -1088 }) -1089 .await?; -1090 info!("waiting for message b on a"); -1091 let (got_key, got_msg) = -1092 process_msg(client_a.next().await).expect("expected message from client_b"); -1093 assert_eq!(b_key, got_key); -1094 assert_eq!(msg, got_msg); -1095 -1096 // Close before shutting down, otherwise we'll try to send close frames on broken pipes -1097 client_a.close().await?; -1098 client_b.close().await?; -1099 server.shutdown(); -1100 server.task_handle().await.context("join")?; -1101 -1102 Ok(()) -1103 } -1104 -1105 async fn make_test_client(client: tokio::io::DuplexStream, key: &SecretKey) -> Result<Conn> { -1106 let client = crate::client::streams::MaybeTlsStream::Test(client); -1107 let client = tokio_websockets::ClientBuilder::new().take_over(client); -1108 let client = Conn::new(client, KeyCache::test(), key).await?; -1109 Ok(client) -1110 } -1111 -1112 #[tokio::test] -1113 #[traced_test] -1114 async fn test_server_basic() -> Result { -1115 info!("Create the server."); -1116 let metrics = Arc::new(Metrics::default()); -1117 let service = RelayService::new( -1118 Default::default(), -1119 Default::default(), -1120 None, -1121 KeyCache::test(), -1122 AccessConfig::Everyone, -1123 metrics.clone(), -1124 ); -1125 -1126 info!("Create client A and connect it to the server."); -1127 let key_a = SecretKey::generate(rand::rng()); -1128 let public_key_a = key_a.public(); -1129 let (client_a, rw_a) = tokio::io::duplex(10); -1130 let s = service.clone(); -1131 let handler_task = -1132 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(rw_a), None).await }); -1133 let mut client_a = make_test_client(client_a, &key_a).await?; -1134 handler_task.await.context("join")??; -1135 -1136 info!("Create client B and connect it to the server."); -1137 let key_b = SecretKey::generate(rand::rng()); -1138 let public_key_b = key_b.public(); -1139 let (client_b, rw_b) = tokio::io::duplex(10); -1140 let s = service.clone(); -1141 let handler_task = -1142 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(rw_b), None).await }); -1143 let mut client_b = make_test_client(client_b, &key_b).await?; -1144 handler_task.await.context("join")??; -1145 -1146 info!("Send message from A to B."); -1147 let msg = Datagrams::from(b"hello client b!!"); -1148 client_a -1149 .send(ClientToRelayMsg::Datagrams { -1150 dst_node_id: public_key_b, -1151 datagrams: msg.clone(), -1152 }) -1153 .await?; -1154 match client_b.next().await.unwrap()? { -1155 RelayToClientMsg::Datagrams { -1156 remote_node_id, -1157 datagrams, -1158 } => { -1159 assert_eq!(public_key_a, remote_node_id); -1160 assert_eq!(msg, datagrams); -1161 } -1162 msg => { -1163 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); -1164 } -1165 } -1166 -1167 info!("Send message from B to A."); -1168 let msg = Datagrams::from(b"nice to meet you client a!!"); -1169 client_b -1170 .send(ClientToRelayMsg::Datagrams { -1171 dst_node_id: public_key_a, -1172 datagrams: msg.clone(), -1173 }) -1174 .await?; -1175 match client_a.next().await.unwrap()? { -1176 RelayToClientMsg::Datagrams { -1177 remote_node_id, -1178 datagrams, -1179 } => { -1180 assert_eq!(public_key_b, remote_node_id); -1181 assert_eq!(msg, datagrams); -1182 } -1183 msg => { -1184 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); -1185 } -1186 } -1187 -1188 info!("Close the server and clients"); -1189 service.shutdown().await; -1190 tokio::time::sleep(Duration::from_secs(1)).await; -1191 -1192 info!("Fail to send message from A to B."); -1193 let res = client_a -1194 .send(ClientToRelayMsg::Datagrams { -1195 dst_node_id: public_key_b, -1196 datagrams: Datagrams::from(b"try to send"), -1197 }) -1198 .await; -1199 assert!(res.is_err()); -1200 assert!(client_b.next().await.is_none()); -1201 -1202 drop(client_a); -1203 drop(client_b); -1204 -1205 service.shutdown().await; -1206 -1207 assert_eq!(metrics.accepts.get(), metrics.disconnects.get()); +1068 info!("ping b"); +1069 client_b.send(ClientToRelayMsg::Ping([2u8; 8])).await?; +1070 let pong = client_b.next().await.expect("eos")?; +1071 assert!(matches!(pong, RelayToClientMsg::Pong { .. })); +1072 +1073 info!("sending message from a to b"); +1074 let msg = Datagrams::from(b"hi there, client b!"); +1075 client_a +1076 .send(ClientToRelayMsg::Datagrams { +1077 dst_node_id: b_key, +1078 datagrams: msg.clone(), +1079 }) +1080 .await?; +1081 info!("waiting for message from a on b"); +1082 let (got_key, got_msg) = +1083 process_msg(client_b.next().await).expect("expected message from client_a"); +1084 assert_eq!(a_key, got_key); +1085 assert_eq!(msg, got_msg); +1086 +1087 info!("sending message from b to a"); +1088 let msg = Datagrams::from(b"right back at ya, client b!"); +1089 client_b +1090 .send(ClientToRelayMsg::Datagrams { +1091 dst_node_id: a_key, +1092 datagrams: msg.clone(), +1093 }) +1094 .await?; +1095 info!("waiting for message b on a"); +1096 let (got_key, got_msg) = +1097 process_msg(client_a.next().await).expect("expected message from client_b"); +1098 assert_eq!(b_key, got_key); +1099 assert_eq!(msg, got_msg); +1100 +1101 // Close before shutting down, otherwise we'll try to send close frames on broken pipes +1102 client_a.close().await?; +1103 client_b.close().await?; +1104 server.shutdown(); +1105 server.task_handle().await.context("join")?; +1106 +1107 Ok(()) +1108 } +1109 +1110 async fn make_test_client(client: tokio::io::DuplexStream, key: &SecretKey) -> Result<Conn> { +1111 let client = crate::client::streams::MaybeTlsStream::Test(client); +1112 let client = tokio_websockets::ClientBuilder::new().take_over(client); +1113 let client = Conn::new(client, KeyCache::test(), key).await?; +1114 Ok(client) +1115 } +1116 +1117 #[tokio::test] +1118 #[traced_test] +1119 async fn test_server_basic() -> Result { +1120 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1121 +1122 info!("Create the server."); +1123 let metrics = Arc::new(Metrics::default()); +1124 let service = RelayService::new( +1125 Default::default(), +1126 Default::default(), +1127 None, +1128 KeyCache::test(), +1129 AccessConfig::Everyone, +1130 metrics.clone(), +1131 ); +1132 +1133 info!("Create client A and connect it to the server."); +1134 let key_a = SecretKey::generate(&mut rng); +1135 let public_key_a = key_a.public(); +1136 let (client_a, rw_a) = tokio::io::duplex(10); +1137 let s = service.clone(); +1138 let handler_task = +1139 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(rw_a), None).await }); +1140 let mut client_a = make_test_client(client_a, &key_a).await?; +1141 handler_task.await.context("join")??; +1142 +1143 info!("Create client B and connect it to the server."); +1144 let key_b = SecretKey::generate(&mut rng); +1145 let public_key_b = key_b.public(); +1146 let (client_b, rw_b) = tokio::io::duplex(10); +1147 let s = service.clone(); +1148 let handler_task = +1149 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(rw_b), None).await }); +1150 let mut client_b = make_test_client(client_b, &key_b).await?; +1151 handler_task.await.context("join")??; +1152 +1153 info!("Send message from A to B."); +1154 let msg = Datagrams::from(b"hello client b!!"); +1155 client_a +1156 .send(ClientToRelayMsg::Datagrams { +1157 dst_node_id: public_key_b, +1158 datagrams: msg.clone(), +1159 }) +1160 .await?; +1161 match client_b.next().await.unwrap()? { +1162 RelayToClientMsg::Datagrams { +1163 remote_node_id, +1164 datagrams, +1165 } => { +1166 assert_eq!(public_key_a, remote_node_id); +1167 assert_eq!(msg, datagrams); +1168 } +1169 msg => { +1170 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); +1171 } +1172 } +1173 +1174 info!("Send message from B to A."); +1175 let msg = Datagrams::from(b"nice to meet you client a!!"); +1176 client_b +1177 .send(ClientToRelayMsg::Datagrams { +1178 dst_node_id: public_key_a, +1179 datagrams: msg.clone(), +1180 }) +1181 .await?; +1182 match client_a.next().await.unwrap()? { +1183 RelayToClientMsg::Datagrams { +1184 remote_node_id, +1185 datagrams, +1186 } => { +1187 assert_eq!(public_key_b, remote_node_id); +1188 assert_eq!(msg, datagrams); +1189 } +1190 msg => { +1191 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); +1192 } +1193 } +1194 +1195 info!("Close the server and clients"); +1196 service.shutdown().await; +1197 tokio::time::sleep(Duration::from_secs(1)).await; +1198 +1199 info!("Fail to send message from A to B."); +1200 let res = client_a +1201 .send(ClientToRelayMsg::Datagrams { +1202 dst_node_id: public_key_b, +1203 datagrams: Datagrams::from(b"try to send"), +1204 }) +1205 .await; +1206 assert!(res.is_err()); +1207 assert!(client_b.next().await.is_none()); 1208 -1209 Ok(()) -1210 } +1209 drop(client_a); +1210 drop(client_b); 1211 -1212 #[tokio::test] -1213 async fn test_server_replace_client() -> Result { -1214 info!("Create the server."); -1215 let service = RelayService::new( -1216 Default::default(), -1217 Default::default(), -1218 None, -1219 KeyCache::test(), -1220 AccessConfig::Everyone, -1221 Default::default(), -1222 ); -1223 -1224 info!("Create client A and connect it to the server."); -1225 let key_a = SecretKey::generate(rand::rng()); -1226 let public_key_a = key_a.public(); -1227 let (client_a, rw_a) = tokio::io::duplex(10); -1228 let s = service.clone(); -1229 let handler_task = -1230 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(rw_a), None).await }); -1231 let mut client_a = make_test_client(client_a, &key_a).await?; -1232 handler_task.await.context("join")??; -1233 -1234 info!("Create client B and connect it to the server."); -1235 let key_b = SecretKey::generate(rand::rng()); -1236 let public_key_b = key_b.public(); -1237 let (client_b, rw_b) = tokio::io::duplex(10); -1238 let s = service.clone(); -1239 let handler_task = -1240 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(rw_b), None).await }); -1241 let mut client_b = make_test_client(client_b, &key_b).await?; -1242 handler_task.await.context("join")??; -1243 -1244 info!("Send message from A to B."); -1245 let msg = Datagrams::from(b"hello client b!!"); -1246 client_a -1247 .send(ClientToRelayMsg::Datagrams { -1248 dst_node_id: public_key_b, -1249 datagrams: msg.clone(), -1250 }) -1251 .await?; -1252 match client_b.next().await.expect("eos")? { -1253 RelayToClientMsg::Datagrams { -1254 remote_node_id, -1255 datagrams, -1256 } => { -1257 assert_eq!(public_key_a, remote_node_id); -1258 assert_eq!(msg, datagrams); -1259 } -1260 msg => { -1261 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); -1262 } -1263 } -1264 -1265 info!("Send message from B to A."); -1266 let msg = Datagrams::from(b"nice to meet you client a!!"); -1267 client_b -1268 .send(ClientToRelayMsg::Datagrams { -1269 dst_node_id: public_key_a, -1270 datagrams: msg.clone(), -1271 }) -1272 .await?; -1273 match client_a.next().await.expect("eos")? { -1274 RelayToClientMsg::Datagrams { -1275 remote_node_id, -1276 datagrams, -1277 } => { -1278 assert_eq!(public_key_b, remote_node_id); -1279 assert_eq!(msg, datagrams); -1280 } -1281 msg => { -1282 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); -1283 } -1284 } -1285 -1286 info!("Create client B and connect it to the server"); -1287 let (new_client_b, new_rw_b) = tokio::io::duplex(10); -1288 let s = service.clone(); -1289 let handler_task = -1290 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(new_rw_b), None).await }); -1291 let mut new_client_b = make_test_client(new_client_b, &key_b).await?; -1292 handler_task.await.context("join")??; -1293 -1294 // assert!(client_b.recv().await.is_err()); -1295 -1296 info!("Send message from A to B."); -1297 let msg = Datagrams::from(b"are you still there, b?!"); -1298 client_a -1299 .send(ClientToRelayMsg::Datagrams { -1300 dst_node_id: public_key_b, -1301 datagrams: msg.clone(), -1302 }) -1303 .await?; -1304 match new_client_b.next().await.expect("eos")? { -1305 RelayToClientMsg::Datagrams { -1306 remote_node_id, -1307 datagrams, -1308 } => { -1309 assert_eq!(public_key_a, remote_node_id); -1310 assert_eq!(msg, datagrams); -1311 } -1312 msg => { -1313 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); -1314 } -1315 } -1316 -1317 info!("Send message from B to A."); -1318 let msg = Datagrams::from(b"just had a spot of trouble but I'm back now,a!!"); -1319 new_client_b -1320 .send(ClientToRelayMsg::Datagrams { -1321 dst_node_id: public_key_a, -1322 datagrams: msg.clone(), -1323 }) -1324 .await?; -1325 match client_a.next().await.expect("eos")? { -1326 RelayToClientMsg::Datagrams { -1327 remote_node_id, -1328 datagrams, -1329 } => { -1330 assert_eq!(public_key_b, remote_node_id); -1331 assert_eq!(msg, datagrams); -1332 } -1333 msg => { -1334 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); -1335 } -1336 } -1337 -1338 info!("Close the server and clients"); -1339 service.shutdown().await; -1340 -1341 info!("Sending message from A to B fails"); -1342 let res = client_a -1343 .send(ClientToRelayMsg::Datagrams { -1344 dst_node_id: public_key_b, -1345 datagrams: Datagrams::from(b"try to send"), -1346 }) -1347 .await; -1348 assert!(res.is_err()); -1349 assert!(new_client_b.next().await.is_none()); -1350 Ok(()) -1351 } -1352} \ No newline at end of file +1212 service.shutdown().await; +1213 +1214 assert_eq!(metrics.accepts.get(), metrics.disconnects.get()); +1215 +1216 Ok(()) +1217 } +1218 +1219 #[tokio::test] +1220 async fn test_server_replace_client() -> Result { +1221 let mut rng = rand_chacha::ChaCha8Rng::seed_from_u64(0u64); +1222 +1223 info!("Create the server."); +1224 let service = RelayService::new( +1225 Default::default(), +1226 Default::default(), +1227 None, +1228 KeyCache::test(), +1229 AccessConfig::Everyone, +1230 Default::default(), +1231 ); +1232 +1233 info!("Create client A and connect it to the server."); +1234 let key_a = SecretKey::generate(&mut rng); +1235 let public_key_a = key_a.public(); +1236 let (client_a, rw_a) = tokio::io::duplex(10); +1237 let s = service.clone(); +1238 let handler_task = +1239 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(rw_a), None).await }); +1240 let mut client_a = make_test_client(client_a, &key_a).await?; +1241 handler_task.await.context("join")??; +1242 +1243 info!("Create client B and connect it to the server."); +1244 let key_b = SecretKey::generate(&mut rng); +1245 let public_key_b = key_b.public(); +1246 let (client_b, rw_b) = tokio::io::duplex(10); +1247 let s = service.clone(); +1248 let handler_task = +1249 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(rw_b), None).await }); +1250 let mut client_b = make_test_client(client_b, &key_b).await?; +1251 handler_task.await.context("join")??; +1252 +1253 info!("Send message from A to B."); +1254 let msg = Datagrams::from(b"hello client b!!"); +1255 client_a +1256 .send(ClientToRelayMsg::Datagrams { +1257 dst_node_id: public_key_b, +1258 datagrams: msg.clone(), +1259 }) +1260 .await?; +1261 match client_b.next().await.expect("eos")? { +1262 RelayToClientMsg::Datagrams { +1263 remote_node_id, +1264 datagrams, +1265 } => { +1266 assert_eq!(public_key_a, remote_node_id); +1267 assert_eq!(msg, datagrams); +1268 } +1269 msg => { +1270 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); +1271 } +1272 } +1273 +1274 info!("Send message from B to A."); +1275 let msg = Datagrams::from(b"nice to meet you client a!!"); +1276 client_b +1277 .send(ClientToRelayMsg::Datagrams { +1278 dst_node_id: public_key_a, +1279 datagrams: msg.clone(), +1280 }) +1281 .await?; +1282 match client_a.next().await.expect("eos")? { +1283 RelayToClientMsg::Datagrams { +1284 remote_node_id, +1285 datagrams, +1286 } => { +1287 assert_eq!(public_key_b, remote_node_id); +1288 assert_eq!(msg, datagrams); +1289 } +1290 msg => { +1291 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); +1292 } +1293 } +1294 +1295 info!("Create client B and connect it to the server"); +1296 let (new_client_b, new_rw_b) = tokio::io::duplex(10); +1297 let s = service.clone(); +1298 let handler_task = +1299 tokio::spawn(async move { s.0.accept(MaybeTlsStream::Test(new_rw_b), None).await }); +1300 let mut new_client_b = make_test_client(new_client_b, &key_b).await?; +1301 handler_task.await.context("join")??; +1302 +1303 // assert!(client_b.recv().await.is_err()); +1304 +1305 info!("Send message from A to B."); +1306 let msg = Datagrams::from(b"are you still there, b?!"); +1307 client_a +1308 .send(ClientToRelayMsg::Datagrams { +1309 dst_node_id: public_key_b, +1310 datagrams: msg.clone(), +1311 }) +1312 .await?; +1313 match new_client_b.next().await.expect("eos")? { +1314 RelayToClientMsg::Datagrams { +1315 remote_node_id, +1316 datagrams, +1317 } => { +1318 assert_eq!(public_key_a, remote_node_id); +1319 assert_eq!(msg, datagrams); +1320 } +1321 msg => { +1322 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); +1323 } +1324 } +1325 +1326 info!("Send message from B to A."); +1327 let msg = Datagrams::from(b"just had a spot of trouble but I'm back now,a!!"); +1328 new_client_b +1329 .send(ClientToRelayMsg::Datagrams { +1330 dst_node_id: public_key_a, +1331 datagrams: msg.clone(), +1332 }) +1333 .await?; +1334 match client_a.next().await.expect("eos")? { +1335 RelayToClientMsg::Datagrams { +1336 remote_node_id, +1337 datagrams, +1338 } => { +1339 assert_eq!(public_key_b, remote_node_id); +1340 assert_eq!(msg, datagrams); +1341 } +1342 msg => { +1343 whatever!("expected ReceivedDatagrams msg, got {msg:?}"); +1344 } +1345 } +1346 +1347 info!("Close the server and clients"); +1348 service.shutdown().await; +1349 +1350 info!("Sending message from A to B fails"); +1351 let res = client_a +1352 .send(ClientToRelayMsg::Datagrams { +1353 dst_node_id: public_key_b, +1354 datagrams: Datagrams::from(b"try to send"), +1355 }) +1356 .await; +1357 assert!(res.is_err()); +1358 assert!(new_client_b.next().await.is_none()); +1359 Ok(()) +1360 } +1361} \ No newline at end of file