From 153c685c8cf32ee18f99f82e90db76eb25412eba Mon Sep 17 00:00:00 2001 From: Frando Date: Mon, 8 Dec 2025 11:15:18 +0000 Subject: [PATCH] deploy: ed50276962879ec7a05acb6b41c10f4979e9fc58 --- .../iroh_bench/enum.ConnectionSelector.html | 4 +- .../iroh_bench/enum.EndpointSelector.html | 4 +- pr/3745/docs/iroh_bench/iroh/fn.client.html | 4 +- .../iroh_bench/iroh/fn.connect_client.html | 6 +- .../iroh/fn.handle_client_stream.html | 2 +- pr/3745/docs/iroh_bench/iroh/fn.server.html | 2 +- .../iroh_bench/iroh/fn.server_endpoint.html | 4 +- pr/3745/docs/iroh_dns_server/http/index.html | 2 +- .../client/struct.ClientBuilder.html | 4 +- .../iroh_relay/dns/struct.DnsResolver.html | 8 +- .../endpoint_info/enum.DecodingError.html | 4 +- .../docs/iroh_relay/endpoint_info/index.html | 10 +- .../endpoint_info/struct.EndpointData.html | 18 +- .../endpoint_info/struct.EndpointInfo.html | 28 +- .../endpoint_info/trait.EndpointIdExt.html | 10 +- pr/3745/docs/iroh_relay/index.html | 2 +- .../protos/relay/enum.ClientToRelayMsg.html | 4 +- .../iroh_relay/protos/relay/enum.Error.html | 6 +- .../protos/relay/enum.RelayToClientMsg.html | 8 +- .../iroh_relay/server/enum.AccessConfig.html | 6 +- .../docs/iroh_relay/server/struct.Server.html | 4 +- .../docs/iroh_relay/struct.RelayConfig.html | 6 +- pr/3745/docs/iroh_relay/struct.RelayMap.html | 14 +- pr/3745/docs/src/iroh_dns_server/http.rs.html | 426 +++++++++--------- .../trait.impl/core/convert/trait.From.js | 4 +- .../iter/traits/collect/trait.FromIterator.js | 4 +- 26 files changed, 298 insertions(+), 296 deletions(-) diff --git a/pr/3745/docs/iroh_bench/enum.ConnectionSelector.html b/pr/3745/docs/iroh_bench/enum.ConnectionSelector.html index 97625bc15e..7b72f534f2 100644 --- a/pr/3745/docs/iroh_bench/enum.ConnectionSelector.html +++ b/pr/3745/docs/iroh_bench/enum.ConnectionSelector.html @@ -1,7 +1,7 @@ ConnectionSelector in iroh_bench - Rust

ConnectionSelector

Enum ConnectionSelector 

Source
pub enum ConnectionSelector {
-    Iroh(Connection),
+    Iroh(Connection),
     Quinn(Connection),
-}

Variants§

§

Iroh(Connection)

§

Quinn(Connection)

Implementations§

Source§

impl ConnectionSelector

Source

pub fn stats(&self)

Source

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

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +}

Variants§

§

Iroh(Connection)

§

Quinn(Connection)

Implementations§

Source§

impl ConnectionSelector

Source

pub fn stats(&self)

Source

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

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/3745/docs/iroh_bench/enum.EndpointSelector.html b/pr/3745/docs/iroh_bench/enum.EndpointSelector.html index 6465ce4e93..4c343469c1 100644 --- a/pr/3745/docs/iroh_bench/enum.EndpointSelector.html +++ b/pr/3745/docs/iroh_bench/enum.EndpointSelector.html @@ -1,7 +1,7 @@ EndpointSelector in iroh_bench - Rust

EndpointSelector

Enum EndpointSelector 

Source
pub enum EndpointSelector {
-    Iroh(Endpoint),
+    Iroh(Endpoint),
     Quinn(Endpoint),
-}

Variants§

§

Iroh(Endpoint)

§

Quinn(Endpoint)

Implementations§

Source§

impl EndpointSelector

Source

pub async fn close(self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where +}

Variants§

§

Iroh(Endpoint)

§

Quinn(Endpoint)

Implementations§

Source§

impl EndpointSelector

Source

pub async fn close(self)

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/3745/docs/iroh_bench/iroh/fn.client.html b/pr/3745/docs/iroh_bench/iroh/fn.client.html index 24276319d1..88af5703e4 100644 --- a/pr/3745/docs/iroh_bench/iroh/fn.client.html +++ b/pr/3745/docs/iroh_bench/iroh/fn.client.html @@ -1,6 +1,6 @@ client in iroh_bench::iroh - Rust

client

Function client 

Source
pub async fn client(
-    server_addr: EndpointAddr,
-    relay_url: Option<RelayUrl>,
+    server_addr: EndpointAddr,
+    relay_url: Option<RelayUrl>,
     opt: Opt,
 ) -> Result<ClientStats>
Expand description

Create and run a client

\ No newline at end of file diff --git a/pr/3745/docs/iroh_bench/iroh/fn.connect_client.html b/pr/3745/docs/iroh_bench/iroh/fn.connect_client.html index 13c2ea3795..71f5ac1f87 100644 --- a/pr/3745/docs/iroh_bench/iroh/fn.connect_client.html +++ b/pr/3745/docs/iroh_bench/iroh/fn.connect_client.html @@ -1,6 +1,6 @@ connect_client in iroh_bench::iroh - Rust

connect_client

Function connect_client 

Source
pub async fn connect_client(
-    server_addr: EndpointAddr,
-    relay_url: Option<RelayUrl>,
+    server_addr: EndpointAddr,
+    relay_url: Option<RelayUrl>,
     opt: Opt,
-) -> Result<(Endpoint, Connection)>
Expand description

Create a client endpoint and client connection

+) -> Result<(Endpoint, Connection)>
Expand description

Create a client endpoint and client connection

\ No newline at end of file diff --git a/pr/3745/docs/iroh_bench/iroh/fn.handle_client_stream.html b/pr/3745/docs/iroh_bench/iroh/fn.handle_client_stream.html index e75104f95e..748f156717 100644 --- a/pr/3745/docs/iroh_bench/iroh/fn.handle_client_stream.html +++ b/pr/3745/docs/iroh_bench/iroh/fn.handle_client_stream.html @@ -1,5 +1,5 @@ handle_client_stream in iroh_bench::iroh - Rust

handle_client_stream

Function handle_client_stream 

Source
pub async fn handle_client_stream(
-    connection: &Connection,
+    connection: &Connection,
     upload_size: u64,
     read_unordered: bool,
 ) -> Result<(TransferResult, TransferResult)>
\ No newline at end of file diff --git a/pr/3745/docs/iroh_bench/iroh/fn.server.html b/pr/3745/docs/iroh_bench/iroh/fn.server.html index 7ca3a0bacf..bcfacda1e3 100644 --- a/pr/3745/docs/iroh_bench/iroh/fn.server.html +++ b/pr/3745/docs/iroh_bench/iroh/fn.server.html @@ -1,2 +1,2 @@ -server in iroh_bench::iroh - Rust

server

Function server 

Source
pub async fn server(endpoint: Endpoint, opt: Opt) -> Result<()>
Expand description

Take the provided endpoint and run the server

+server in iroh_bench::iroh - Rust

server

Function server 

Source
pub async fn server(endpoint: Endpoint, opt: Opt) -> Result<()>
Expand description

Take the provided endpoint and run the server

\ No newline at end of file diff --git a/pr/3745/docs/iroh_bench/iroh/fn.server_endpoint.html b/pr/3745/docs/iroh_bench/iroh/fn.server_endpoint.html index 66dd302bb3..aa5b9864ab 100644 --- a/pr/3745/docs/iroh_bench/iroh/fn.server_endpoint.html +++ b/pr/3745/docs/iroh_bench/iroh/fn.server_endpoint.html @@ -1,6 +1,6 @@ server_endpoint in iroh_bench::iroh - Rust

server_endpoint

Function server_endpoint 

Source
pub fn server_endpoint(
     rt: &Runtime,
-    relay_url: &Option<RelayUrl>,
+    relay_url: &Option<RelayUrl>,
     opt: &Opt,
-) -> (EndpointAddr, Endpoint)
Expand description

Creates a server endpoint which runs on the given runtime

+) -> (EndpointAddr, Endpoint)
Expand description

Creates a server endpoint which runs on the given runtime

\ No newline at end of file diff --git a/pr/3745/docs/iroh_dns_server/http/index.html b/pr/3745/docs/iroh_dns_server/http/index.html index af14af5326..14c6cac7fc 100644 --- a/pr/3745/docs/iroh_dns_server/http/index.html +++ b/pr/3745/docs/iroh_dns_server/http/index.html @@ -1,2 +1,2 @@ -iroh_dns_server::http - Rust

Module http

Module http 

Source
Expand description

HTTP server part of iroh-dns-server

+iroh_dns_server::http - Rust

Module http

Module http 

Source
Expand description

HTTP server part of iroh-dns-server

Structs§

HttpConfig
Config for the HTTP server
HttpServer
The HTTP(S) server part of iroh-dns-server
HttpsConfig
Config for the HTTPS server

Enums§

CertMode
The mode how SSL certificates should be created.
RateLimitConfig
Config for http server rate limit.
\ No newline at end of file diff --git a/pr/3745/docs/iroh_relay/client/struct.ClientBuilder.html b/pr/3745/docs/iroh_relay/client/struct.ClientBuilder.html index 822f6eb175..c66fab1488 100644 --- a/pr/3745/docs/iroh_relay/client/struct.ClientBuilder.html +++ b/pr/3745/docs/iroh_relay/client/struct.ClientBuilder.html @@ -1,7 +1,7 @@ ClientBuilder in iroh_relay::client - Rust

ClientBuilder

Struct ClientBuilder 

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

Build a Client.

Implementations§

Source§

impl ClientBuilder

Source

pub fn new( - url: impl Into<RelayUrl>, - secret_key: SecretKey, + url: impl Into<RelayUrl>, + secret_key: SecretKey, dns_resolver: DnsResolver, ) -> Self

Create a new ClientBuilder

Source

pub fn address_family_selector<S>(self, selector: S) -> Self
where diff --git a/pr/3745/docs/iroh_relay/dns/struct.DnsResolver.html b/pr/3745/docs/iroh_relay/dns/struct.DnsResolver.html index 919979e1b3..246ff55953 100644 --- a/pr/3745/docs/iroh_relay/dns/struct.DnsResolver.html +++ b/pr/3745/docs/iroh_relay/dns/struct.DnsResolver.html @@ -73,9 +73,9 @@ at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in summary of all errors otherwise.

Source

pub async fn lookup_endpoint_by_id( &self, - endpoint_id: &EndpointId, + endpoint_id: &EndpointId, origin: &str, -) -> Result<EndpointInfo, LookupError>

Looks up endpoint info by [EndpointId] and origin domain name.

+) -> Result<EndpointInfo, LookupError>

Looks up endpoint info by EndpointId and origin domain name.

To lookup endpoints that published their endpoint info to the DNS servers run by n0, pass N0_DNS_ENDPOINT_ORIGIN_PROD as origin.

Source

pub async fn lookup_endpoint_by_domain_name( @@ -93,10 +93,10 @@ at T+0ms, T+200ms and T+300ms. The result of the first successful call is return summary of all errors otherwise.

Source

pub async fn lookup_endpoint_by_id_staggered( &self, - endpoint_id: &EndpointId, + endpoint_id: &EndpointId, origin: &str, delays_ms: &[u64], -) -> Result<EndpointInfo, StaggeredError<LookupError>>

Looks up endpoint info by [EndpointId] and origin domain name.

+) -> Result<EndpointInfo, StaggeredError<LookupError>>

Looks up endpoint info by EndpointId and origin domain name.

From the moment this function is called, each lookup is scheduled after the delays in delays_ms with the first call being done immediately. [200ms, 300ms] results in calls at T+0ms, T+200ms and T+300ms. The result of the first successful call is returned, or a diff --git a/pr/3745/docs/iroh_relay/endpoint_info/enum.DecodingError.html b/pr/3745/docs/iroh_relay/endpoint_info/enum.DecodingError.html index 86d2c6a6b7..daa76b8135 100644 --- a/pr/3745/docs/iroh_relay/endpoint_info/enum.DecodingError.html +++ b/pr/3745/docs/iroh_relay/endpoint_info/enum.DecodingError.html @@ -8,12 +8,12 @@ meta: Meta, }, InvalidKey { - source: KeyParsingError, + source: KeyParsingError, meta: Meta, }, }

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

InvalidEncodingZ32

Fields

§source: Z32Error
§meta: Meta

Captured call-site metadata

§

InvalidLength

Fields

§len: usize
§meta: Meta

Captured call-site metadata

-
§

InvalidKey

Fields

§source: KeyParsingError
§meta: Meta

Captured call-site metadata

+
§

InvalidKey

Fields

§meta: Meta

Captured call-site metadata

Trait Implementations§

Source§

impl Debug for DecodingError

Source§

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

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

impl Display for DecodingError

Source§

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

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

impl Error for DecodingError

Source§

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

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

fn description(&self) -> &str

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

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

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

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

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

impl From<DecodingError> for AnyError

Source§

fn from(value: DecodingError) -> AnyError

Converts to this type from the input type.
Source§

impl From<DecodingError> for ParseError

Source§

fn from(source: DecodingError) -> Self

Converts to this type from the input type.
Source§

impl StackError for DecodingError

Source§

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

Returns this error as a std error reference.
Source§

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

Returns this error as a std error.
Source§

fn as_dyn(&self) -> &dyn StackError

Returns this error as a dyn StackError.
Source§

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

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

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

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

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

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

fn is_transparent(&self) -> bool

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

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

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

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

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

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

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

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

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

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

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

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where diff --git a/pr/3745/docs/iroh_relay/endpoint_info/index.html b/pr/3745/docs/iroh_relay/endpoint_info/index.html index 4a43824b7c..9de61c4142 100644 --- a/pr/3745/docs/iroh_relay/endpoint_info/index.html +++ b/pr/3745/docs/iroh_relay/endpoint_info/index.html @@ -1,5 +1,5 @@ -iroh_relay::endpoint_info - Rust

Module endpoint_info

Module endpoint_info 

Source
Expand description

Support for handling DNS resource records for dialing by [EndpointId].

-

Dialing by [EndpointId] is supported by iroh endpoints publishing Pkarr records to DNS +iroh_relay::endpoint_info - Rust

Module endpoint_info

Module endpoint_info 

Source
Expand description

Support for handling DNS resource records for dialing by EndpointId.

+

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

DNS records are published under the following names:

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

@@ -8,7 +8,7 @@ servers or the Mainline DHT. This module supports creating and parsing these re

_iroh is the record name as defined by IROH_TXT_NAME.

  • -

    <z32-endpoint-id> is the z-base-32 encoding of the [EndpointId].

    +

    <z32-endpoint-id> is the z-base-32 encoding of the EndpointId.

  • <origin-domain> is the domain name of the publishing DNS server, @@ -23,12 +23,12 @@ servers or the Mainline DHT. This module supports creating and parsing these re in RFC1464. The following attributes are defined:

    • -

      relay=<url>: The home RelayUrl of this endpoint.

      +

      relay=<url>: The home RelayUrl of this endpoint.

    • addr=<addr> <addr>: A space-separated list of sockets addresses for this iroh endpoint. Each address is an IPv4 or IPv6 address with a port.

    -
  • Structs§

    EndpointData
    Data about an endpoint that may be published to and resolved from discovery services.
    EndpointInfo
    Information about an endpoint that may be published to and resolved from discovery services.
    MaxLengthExceededError
    Error returned when an input value is too long for UserData.
    UserData
    Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

    Enums§

    DecodingError
    EncodingError
    ParseError

    Constants§

    IROH_TXT_NAME
    The DNS name for the iroh TXT record.

    Traits§

    EndpointIdExt
    Extension methods for [EndpointId] to encode to and decode from [z32], +

    Structs§

    EndpointData
    Data about an endpoint that may be published to and resolved from discovery services.
    EndpointInfo
    Information about an endpoint that may be published to and resolved from discovery services.
    MaxLengthExceededError
    Error returned when an input value is too long for UserData.
    UserData
    Under the hood this is a UTF-8 String is no longer than UserData::MAX_LENGTH bytes.

    Enums§

    DecodingError
    EncodingError
    ParseError

    Constants§

    IROH_TXT_NAME
    The DNS name for the iroh TXT record.

    Traits§

    EndpointIdExt
    Extension methods for EndpointId to encode to and decode from [z32], which is the encoding used in [pkarr] domain names.
    \ No newline at end of file diff --git a/pr/3745/docs/iroh_relay/endpoint_info/struct.EndpointData.html b/pr/3745/docs/iroh_relay/endpoint_info/struct.EndpointData.html index 2d50b3f754..b6e5f6b39f 100644 --- a/pr/3745/docs/iroh_relay/endpoint_info/struct.EndpointData.html +++ b/pr/3745/docs/iroh_relay/endpoint_info/struct.EndpointData.html @@ -1,23 +1,23 @@ EndpointData in iroh_relay::endpoint_info - Rust

    EndpointData

    Struct EndpointData 

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

    Data about an endpoint that may be published to and resolved from discovery services.

    -

    This includes an optional [RelayUrl], a set of direct addresses, and the optional +

    This includes an optional RelayUrl, a set of direct addresses, and the optional UserData, a string that can be set by applications and is not parsed or used by iroh itself.

    -

    This struct does not include the endpoint’s [EndpointId], only the data about a certain -endpoint. See EndpointInfo for a struct that contains a [EndpointId] with associated EndpointData.

    -

    Implementations§

    Source§

    impl EndpointData

    Source

    pub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self

    Creates a new EndpointData with a relay URL and a set of direct addresses.

    -
    Source

    pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self

    Sets the relay URL and returns the updated endpoint data.

    +

    This struct does not include the endpoint’s EndpointId, only the data about a certain +endpoint. See EndpointInfo for a struct that contains a EndpointId with associated EndpointData.

    +

    Implementations§

    Source§

    impl EndpointData

    Source

    pub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self

    Creates a new EndpointData with a relay URL and a set of direct addresses.

    +
    Source

    pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self

    Sets the relay URL and returns the updated endpoint data.

    Source

    pub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self

    Sets the direct addresses and returns the updated endpoint data.

    Source

    pub fn with_user_data(self, user_data: Option<UserData>) -> Self

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

    -
    Source

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

    Returns the relay URL of the endpoint.

    +
    Source

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

    Returns the relay URL of the endpoint.

    Source

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

    Returns the optional user-defined data of the endpoint.

    Source

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

    Returns the direct addresses of the endpoint.

    Source

    pub fn clear_ip_addrs(&mut self)

    Removes all direct addresses from the endpoint data.

    Source

    pub fn clear_relay_urls(&mut self)

    Removes all direct addresses from the endpoint data.

    -
    Source

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

    Add addresses to the endpoint data.

    +
    Source

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

    Add addresses to the endpoint data.

    Source

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

    Sets the user-defined data of the endpoint data.

    -
    Source

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

    Returns the full list of all known addresses

    +
    Source

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

    Returns the full list of all known addresses

    Source

    pub fn has_addrs(&self) -> bool

    Does this have any addresses?

    -

    Trait Implementations§

    Source§

    impl Clone for EndpointData

    Source§

    fn clone(&self) -> EndpointData

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

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

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointData

    Source§

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

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

    impl Default for EndpointData

    Source§

    fn default() -> EndpointData

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

    impl From<EndpointAddr> for EndpointData

    Source§

    fn from(endpoint_addr: EndpointAddr) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for EndpointData

    Source§

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

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

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

    Tests for !=. The default implementation is almost always sufficient, +

    Trait Implementations§

    Source§

    impl Clone for EndpointData

    Source§

    fn clone(&self) -> EndpointData

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

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

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointData

    Source§

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

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

    impl Default for EndpointData

    Source§

    fn default() -> EndpointData

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

    impl From<EndpointAddr> for EndpointData

    Source§

    fn from(endpoint_addr: EndpointAddr) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for EndpointData

    Source§

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

    Source§

    impl StructuralPartialEq for EndpointData

    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/3745/docs/iroh_relay/endpoint_info/struct.EndpointInfo.html b/pr/3745/docs/iroh_relay/endpoint_info/struct.EndpointInfo.html index 7bdb2a8793..c6a136c7d7 100644 --- a/pr/3745/docs/iroh_relay/endpoint_info/struct.EndpointInfo.html +++ b/pr/3745/docs/iroh_relay/endpoint_info/struct.EndpointInfo.html @@ -1,17 +1,17 @@ EndpointInfo in iroh_relay::endpoint_info - Rust

    EndpointInfo

    Struct EndpointInfo 

    Source
    pub struct EndpointInfo {
    -    pub endpoint_id: EndpointId,
    +    pub endpoint_id: EndpointId,
         pub data: EndpointData,
     }
    Expand description

    Information about an endpoint that may be published to and resolved from discovery services.

    -

    This struct couples a [EndpointId] with its associated EndpointData.

    -

    Fields§

    §endpoint_id: EndpointId

    The [EndpointId] of the endpoint this is about.

    +

    This struct couples a EndpointId with its associated EndpointData.

    +

    Fields§

    §endpoint_id: EndpointId

    The EndpointId of the endpoint this is about.

    §data: EndpointData

    The information published about the endpoint.

    -

    Implementations§

    Source§

    impl EndpointInfo

    Source

    pub fn new(endpoint_id: EndpointId) -> Self

    Creates a new EndpointInfo with an empty EndpointData.

    -
    Source

    pub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self

    Creates a new EndpointInfo from its parts.

    -
    Source

    pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self

    Sets the relay URL and returns the updated endpoint info.

    +

    Implementations§

    Source§

    impl EndpointInfo

    Source

    pub fn new(endpoint_id: EndpointId) -> Self

    Creates a new EndpointInfo with an empty EndpointData.

    +
    Source

    pub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self

    Creates a new EndpointInfo from its parts.

    +
    Source

    pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self

    Sets the relay URL and returns the updated endpoint info.

    Source

    pub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self

    Sets the IP based addresses and returns the updated endpoint info.

    Source

    pub fn with_user_data(self, user_data: Option<UserData>) -> Self

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

    -
    Source

    pub fn to_endpoint_addr(&self) -> EndpointAddr

    Converts into a [EndpointAddr] by cloning the needed fields.

    -
    Source

    pub fn into_endpoint_addr(self) -> EndpointAddr

    Converts into a [EndpointAddr] without cloning.

    +
    Source

    pub fn to_endpoint_addr(&self) -> EndpointAddr

    Converts into a EndpointAddr by cloning the needed fields.

    +
    Source

    pub fn into_endpoint_addr(self) -> EndpointAddr

    Converts into a EndpointAddr without cloning.

    Source

    pub fn from_txt_lookup( domain_name: String, lookup: impl Iterator<Item = TxtRecordData>, @@ -21,21 +21,21 @@ ) -> Result<Self, ParseError>

    Parses a EndpointInfo from a [pkarr::SignedPacket].

    Source

    pub fn to_pkarr_signed_packet( &self, - secret_key: &SecretKey, + secret_key: &SecretKey, ttl: u32, ) -> Result<SignedPacket, EncodingError>

    Creates a [pkarr::SignedPacket].

    -

    This constructs a DNS packet and signs it with a [SecretKey].

    +

    This constructs a DNS packet and signs it with a SecretKey.

    Source

    pub fn to_txt_strings(&self) -> Vec<String>

    Converts into a list of {key}={value} strings.

    -

    Methods from Deref<Target = EndpointData>§

    Source

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

    Returns the relay URL of the endpoint.

    +

    Methods from Deref<Target = EndpointData>§

    Source

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

    Returns the relay URL of the endpoint.

    Source

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

    Returns the optional user-defined data of the endpoint.

    Source

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

    Returns the direct addresses of the endpoint.

    Source

    pub fn clear_ip_addrs(&mut self)

    Removes all direct addresses from the endpoint data.

    Source

    pub fn clear_relay_urls(&mut self)

    Removes all direct addresses from the endpoint data.

    -
    Source

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

    Add addresses to the endpoint data.

    +
    Source

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

    Add addresses to the endpoint data.

    Source

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

    Sets the user-defined data of the endpoint data.

    -
    Source

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

    Returns the full list of all known addresses

    +
    Source

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

    Returns the full list of all known addresses

    Source

    pub fn has_addrs(&self) -> bool

    Does this have any addresses?

    -

    Trait Implementations§

    Source§

    impl Clone for EndpointInfo

    Source§

    fn clone(&self) -> EndpointInfo

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

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

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointInfo

    Source§

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

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

    impl Deref for EndpointInfo

    Source§

    type Target = EndpointData

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    Source§

    impl DerefMut for EndpointInfo

    Source§

    fn deref_mut(&mut self) -> &mut Self::Target

    Mutably dereferences the value.
    Source§

    impl From<EndpointAddr> for EndpointInfo

    Source§

    fn from(addr: EndpointAddr) -> Self

    Converts to this type from the input type.
    Source§

    impl From<EndpointInfo> for EndpointAddr

    Source§

    fn from(value: EndpointInfo) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for EndpointInfo

    Source§

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

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

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

    Tests for !=. The default implementation is almost always sufficient, +

    Trait Implementations§

    Source§

    impl Clone for EndpointInfo

    Source§

    fn clone(&self) -> EndpointInfo

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

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

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for EndpointInfo

    Source§

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

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

    impl Deref for EndpointInfo

    Source§

    type Target = EndpointData

    The resulting type after dereferencing.
    Source§

    fn deref(&self) -> &Self::Target

    Dereferences the value.
    Source§

    impl DerefMut for EndpointInfo

    Source§

    fn deref_mut(&mut self) -> &mut Self::Target

    Mutably dereferences the value.
    Source§

    impl From<EndpointAddr> for EndpointInfo

    Source§

    fn from(addr: EndpointAddr) -> Self

    Converts to this type from the input type.
    Source§

    impl From<EndpointInfo> for EndpointAddr

    Source§

    fn from(value: EndpointInfo) -> Self

    Converts to this type from the input type.
    Source§

    impl PartialEq for EndpointInfo

    Source§

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

    Source§

    impl StructuralPartialEq for EndpointInfo

    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/3745/docs/iroh_relay/endpoint_info/trait.EndpointIdExt.html b/pr/3745/docs/iroh_relay/endpoint_info/trait.EndpointIdExt.html index 2cfafe8d14..103efb1882 100644 --- a/pr/3745/docs/iroh_relay/endpoint_info/trait.EndpointIdExt.html +++ b/pr/3745/docs/iroh_relay/endpoint_info/trait.EndpointIdExt.html @@ -1,9 +1,9 @@ EndpointIdExt in iroh_relay::endpoint_info - Rust

    EndpointIdExt

    Trait EndpointIdExt 

    Source
    pub trait EndpointIdExt {
         // Required methods
         fn to_z32(&self) -> String;
    -    fn from_z32(s: &str) -> Result<EndpointId, DecodingError>;
    -}
    Expand description

    Extension methods for [EndpointId] to encode to and decode from [z32], + fn from_z32(s: &str) -> Result<EndpointId, DecodingError>; +}

    Expand description

    Extension methods for EndpointId to encode to and decode from [z32], which is the encoding used in [pkarr] domain names.

    -

    Required Methods§

    Source

    fn to_z32(&self) -> String

    Encodes a [EndpointId] in z-base-32 encoding.

    -
    Source

    fn from_z32(s: &str) -> Result<EndpointId, DecodingError>

    Parses a [EndpointId] from z-base-32 encoding.

    -

    Dyn Compatibility§

    This trait is not dyn compatible.

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

    Implementations on Foreign Types§

    Source§

    impl EndpointIdExt for EndpointId

    Source§

    fn to_z32(&self) -> String

    Source§

    fn from_z32(s: &str) -> Result<EndpointId, DecodingError>

    Implementors§

    \ No newline at end of file +

    Required Methods§

    Source

    fn to_z32(&self) -> String

    Encodes a EndpointId in z-base-32 encoding.

    +
    Source

    fn from_z32(s: &str) -> Result<EndpointId, DecodingError>

    Parses a EndpointId from z-base-32 encoding.

    +

    Dyn Compatibility§

    This trait is not dyn compatible.

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

    Implementations on Foreign Types§

    Source§

    impl EndpointIdExt for EndpointId

    Implementors§

    \ No newline at end of file diff --git a/pr/3745/docs/iroh_relay/index.html b/pr/3745/docs/iroh_relay/index.html index 9fd890b801..d16544ab4a 100644 --- a/pr/3745/docs/iroh_relay/index.html +++ b/pr/3745/docs/iroh_relay/index.html @@ -25,6 +25,6 @@ Tailscale.

    QAD support and expose metrics.

    -

    Re-exports§

    pub use protos::relay::MAX_PACKET_SIZE;

    Modules§

    client
    Exposes Client, which allows to establish connections to a relay server.
    defaults
    Default values used in the relay.
    dnsNon-wasm_browser
    DNS resolver
    endpoint_info
    Support for handling DNS resource records for dialing by [EndpointId].
    http
    HTTP-specific constants for the relay server and client.
    protos
    Protocols used by the iroh-relay
    quic
    Create a QUIC server that accepts connections +

    Re-exports§

    pub use protos::relay::MAX_PACKET_SIZE;

    Modules§

    client
    Exposes Client, which allows to establish connections to a relay server.
    defaults
    Default values used in the relay.
    dnsNon-wasm_browser
    DNS resolver
    endpoint_info
    Support for handling DNS resource records for dialing by EndpointId.
    http
    HTTP-specific constants for the relay server and client.
    protos
    Protocols used by the iroh-relay
    quic
    Create a QUIC server that accepts connections for QUIC address discovery.
    serverserver
    A fully-fledged iroh-relay server over HTTP or HTTPS.

    Structs§

    PingTracker
    Tracks pings on a single relay connection.
    RelayConfig
    Information on a specific relay server.
    RelayMap
    List of relay server configurations to be used in an iroh endpoint.
    RelayQuicConfig
    Configuration for speaking to the QUIC endpoint on the relay server to do QUIC address discovery.
    \ No newline at end of file diff --git a/pr/3745/docs/iroh_relay/protos/relay/enum.ClientToRelayMsg.html b/pr/3745/docs/iroh_relay/protos/relay/enum.ClientToRelayMsg.html index c1f432fee0..e07e71e1c5 100644 --- a/pr/3745/docs/iroh_relay/protos/relay/enum.ClientToRelayMsg.html +++ b/pr/3745/docs/iroh_relay/protos/relay/enum.ClientToRelayMsg.html @@ -2,7 +2,7 @@ Ping([u8; 8]), Pong([u8; 8]), Datagrams { - dst_endpoint_id: EndpointId, + dst_endpoint_id: EndpointId, datagrams: Datagrams, }, }
    Expand description

    Messages that clients send to relays.

    @@ -11,7 +11,7 @@ other side with a §

    Pong([u8; 8])

    Reply to a RelayToClientMsg::Ping from a server with the payload sent previously in the ping.

    §

    Datagrams

    Request from the client to relay datagrams to given remote endpoint.

    -

    Fields

    §dst_endpoint_id: EndpointId

    The remote endpoint to relay to.

    +

    Fields

    §dst_endpoint_id: EndpointId

    The remote endpoint to relay to.

    §datagrams: Datagrams

    The datagrams and related metadata to relay.

    Trait Implementations§

    Source§

    impl Clone for ClientToRelayMsg

    Source§

    fn clone(&self) -> ClientToRelayMsg

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

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

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for ClientToRelayMsg

    Source§

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

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

    impl PartialEq for ClientToRelayMsg

    Source§

    fn eq(&self, other: &ClientToRelayMsg) -> 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 Sink<ClientToRelayMsg> for Client

    Source§

    type Error = SendError

    The type of value produced by the sink when an error occurs.
    Source§

    fn poll_ready( diff --git a/pr/3745/docs/iroh_relay/protos/relay/enum.Error.html b/pr/3745/docs/iroh_relay/protos/relay/enum.Error.html index 9412db9658..27fca77b09 100644 --- a/pr/3745/docs/iroh_relay/protos/relay/enum.Error.html +++ b/pr/3745/docs/iroh_relay/protos/relay/enum.Error.html @@ -17,7 +17,7 @@ meta: Meta, }, InvalidPublicKey { - source: KeyParsingError, + source: KeyParsingError, meta: Meta, }, InvalidFrame { @@ -39,12 +39,12 @@

    §

    FrameTooLarge

    Fields

    §frame_len: usize
    §meta: Meta

    Captured call-site metadata

    §

    SerDe

    Fields

    §source: Error
    §meta: Meta

    Captured call-site metadata

    §

    FrameTypeError

    Fields

    §meta: Meta

    Captured call-site metadata

    -
    §

    InvalidPublicKey

    Fields

    §source: KeyParsingError
    §meta: Meta

    Captured call-site metadata

    +
    §

    InvalidPublicKey

    Fields

    §meta: Meta

    Captured call-site metadata

    §

    InvalidFrame

    Fields

    §meta: Meta

    Captured call-site metadata

    §

    InvalidFrameType

    Fields

    §frame_type: FrameType
    §meta: Meta

    Captured call-site metadata

    §

    InvalidProtocolMessageEncoding

    Fields

    §source: Utf8Error
    §meta: Meta

    Captured call-site metadata

    §

    TooSmall

    Fields

    §meta: Meta

    Captured call-site metadata

    -

    Trait Implementations§

    Source§

    impl Debug for Error

    Source§

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

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

    impl Display for Error

    Source§

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

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

    impl Error for Error

    Source§

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

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

    fn description(&self) -> &str

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

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

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

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

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

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    Source§

    impl From<Error> for Error

    Source§

    fn from(source: Error) -> Self

    Converts to this type from the input type.
    Source§

    impl From<Error> for RecvError

    Source§

    fn from(source: ProtoError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<FrameTypeError> for Error

    Source§

    fn from(source: FrameTypeError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<KeyParsingError> for Error

    Source§

    fn from(source: KeyParsingError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<Utf8Error> for Error

    Source§

    fn from(source: Utf8Error) -> Self

    Converts to this type from the input type.
    Source§

    impl StackError for Error

    Source§

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

    Returns this error as a std error reference.
    Source§

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

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

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

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

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

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

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

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

    fn is_transparent(&self) -> bool

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

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

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

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

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

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

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

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

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

    Auto Trait Implementations§

    §

    impl Freeze for Error

    §

    impl !RefUnwindSafe for Error

    §

    impl Send for Error

    §

    impl Sync for Error

    §

    impl Unpin for Error

    §

    impl !UnwindSafe for Error

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where +

    Trait Implementations§

    Source§

    impl Debug for Error

    Source§

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

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

    impl Display for Error

    Source§

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

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

    impl Error for Error

    Source§

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

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

    fn description(&self) -> &str

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

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

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

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

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

    impl From<Error> for AnyError

    Source§

    fn from(value: Error) -> AnyError

    Converts to this type from the input type.
    Source§

    impl From<Error> for Error

    Source§

    fn from(source: Error) -> Self

    Converts to this type from the input type.
    Source§

    impl From<Error> for RecvError

    Source§

    fn from(source: ProtoError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<FrameTypeError> for Error

    Source§

    fn from(source: FrameTypeError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<KeyParsingError> for Error

    Source§

    fn from(source: KeyParsingError) -> Self

    Converts to this type from the input type.
    Source§

    impl From<Utf8Error> for Error

    Source§

    fn from(source: Utf8Error) -> Self

    Converts to this type from the input type.
    Source§

    impl StackError for Error

    Source§

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

    Returns this error as a std error reference.
    Source§

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

    Returns this error as a std error.
    Source§

    fn as_dyn(&self) -> &dyn StackError

    Returns this error as a dyn StackError.
    Source§

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

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

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

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

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

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

    fn is_transparent(&self) -> bool

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

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

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

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

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

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

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

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

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

    Auto Trait Implementations§

    §

    impl Freeze for Error

    §

    impl !RefUnwindSafe for Error

    §

    impl Send for Error

    §

    impl Sync for Error

    §

    impl Unpin for Error

    §

    impl !UnwindSafe for Error

    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/3745/docs/iroh_relay/protos/relay/enum.RelayToClientMsg.html b/pr/3745/docs/iroh_relay/protos/relay/enum.RelayToClientMsg.html index d3ffa9e17e..7858ef2c19 100644 --- a/pr/3745/docs/iroh_relay/protos/relay/enum.RelayToClientMsg.html +++ b/pr/3745/docs/iroh_relay/protos/relay/enum.RelayToClientMsg.html @@ -1,9 +1,9 @@ RelayToClientMsg in iroh_relay::protos::relay - Rust

    RelayToClientMsg

    Enum RelayToClientMsg 

    Source
    pub enum RelayToClientMsg {
         Datagrams {
    -        remote_endpoint_id: EndpointId,
    +        remote_endpoint_id: EndpointId,
             datagrams: Datagrams,
         },
    -    EndpointGone(EndpointId),
    +    EndpointGone(EndpointId),
         Health {
             problem: String,
         },
    @@ -15,9 +15,9 @@
         Pong([u8; 8]),
     }
    Expand description

    The messages that a relay sends to clients or the clients receive from the relay.

    Variants§

    §

    Datagrams

    Represents datagrams sent from relays (originally sent to them by another client).

    -

    Fields

    §remote_endpoint_id: EndpointId

    The [EndpointId] of the original sender.

    +

    Fields

    §remote_endpoint_id: EndpointId

    The EndpointId of the original sender.

    §datagrams: Datagrams

    The datagrams and related metadata.

    -
    §

    EndpointGone(EndpointId)

    Indicates that the client identified by the underlying public key had previously sent you a +

    §

    EndpointGone(EndpointId)

    Indicates that the client identified by the underlying public key had previously sent you a packet but has now disconnected from the relay.

    §

    Health

    A one-way message from relay to client, declaring the connection health state.

    Fields

    §problem: String

    If set, is a description of why the connection is unhealthy.

    diff --git a/pr/3745/docs/iroh_relay/server/enum.AccessConfig.html b/pr/3745/docs/iroh_relay/server/enum.AccessConfig.html index 0c86262eed..28681a8228 100644 --- a/pr/3745/docs/iroh_relay/server/enum.AccessConfig.html +++ b/pr/3745/docs/iroh_relay/server/enum.AccessConfig.html @@ -1,10 +1,10 @@ AccessConfig in iroh_relay::server - Rust

    AccessConfig

    Enum AccessConfig 

    Source
    pub enum AccessConfig {
         Everyone,
    -    Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>),
    +    Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>),
     }
    Available on crate feature server only.
    Expand description

    Controls which endpoints are allowed to use the relay.

    Variants§

    §

    Everyone

    Everyone

    -
    §

    Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>)

    Only endpoints for which the function returns Access::Allow.

    -

    Implementations§

    Source§

    impl AccessConfig

    Source

    pub async fn is_allowed(&self, endpoint: EndpointId) -> bool

    Is this endpoint allowed?

    +
    §

    Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>)

    Only endpoints for which the function returns Access::Allow.

    +

    Implementations§

    Source§

    impl AccessConfig

    Source

    pub async fn is_allowed(&self, endpoint: EndpointId) -> bool

    Is this endpoint allowed?

    Trait Implementations§

    Source§

    impl Debug for AccessConfig

    Source§

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

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    Source§

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

    Source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

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

    §

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

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for T
    where diff --git a/pr/3745/docs/iroh_relay/server/struct.Server.html b/pr/3745/docs/iroh_relay/server/struct.Server.html index 735121f652..2d8987915e 100644 --- a/pr/3745/docs/iroh_relay/server/struct.Server.html +++ b/pr/3745/docs/iroh_relay/server/struct.Server.html @@ -17,9 +17,9 @@ case there is an error in the server before it is shut down.

    Source

    pub fn http_addr(&self) -> Option<SocketAddr>

    The socket address the HTTP server is listening on.

    Source

    pub fn quic_addr(&self) -> Option<SocketAddr>

    The socket address the QUIC server is listening on.

    Source

    pub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>

    The certificates chain if configured with manual TLS certificates.

    -
    Source

    pub fn https_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s https [RelayUrl].

    +
    Source

    pub fn https_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s https RelayUrl.

    This uses Self::https_addr so it’s mostly useful for local development.

    -
    Source

    pub fn http_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s http [RelayUrl].

    +
    Source

    pub fn http_url(&self) -> Option<RelayUrl>

    Available on crate feature test-utils only.

    Get the server’s http RelayUrl.

    This uses Self::http_addr so it’s mostly useful for local development.

    Source

    pub fn metrics(&self) -> &RelayMetrics

    Returns the metrics collected in the relay server.

    Trait Implementations§

    Source§

    impl Debug for Server

    Source§

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

    Formats the value using the given formatter. Read more

    Auto Trait Implementations§

    §

    impl Freeze for Server

    §

    impl RefUnwindSafe for Server

    §

    impl Send for Server

    §

    impl Sync for Server

    §

    impl Unpin for Server

    §

    impl UnwindSafe for Server

    Blanket Implementations§

    Source§

    impl<T> Any for T
    where diff --git a/pr/3745/docs/iroh_relay/struct.RelayConfig.html b/pr/3745/docs/iroh_relay/struct.RelayConfig.html index 90f09dfa2e..4ba3e30d09 100644 --- a/pr/3745/docs/iroh_relay/struct.RelayConfig.html +++ b/pr/3745/docs/iroh_relay/struct.RelayConfig.html @@ -1,14 +1,14 @@ RelayConfig in iroh_relay - Rust

    RelayConfig

    Struct RelayConfig 

    Source
    pub struct RelayConfig {
    -    pub url: RelayUrl,
    +    pub url: RelayUrl,
         pub quic: Option<RelayQuicConfig>,
     }
    Expand description

    Information on a specific relay server.

    Includes the Url where it can be dialed.

    -

    Fields§

    §url: RelayUrl

    The [RelayUrl] where this relay server can be dialed.

    +

    Fields§

    §url: RelayUrl

    The RelayUrl where this relay server can be dialed.

    §quic: Option<RelayQuicConfig>

    Configuration to speak to the QUIC endpoint on the relay server.

    When None, we will not attempt to do QUIC address discovery with this relay server.

    Trait Implementations§

    Source§

    impl Clone for RelayConfig

    Source§

    fn clone(&self) -> RelayConfig

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

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

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayConfig

    Source§

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

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

    impl<'de> Deserialize<'de> for RelayConfig

    Source§

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

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

    impl Display for RelayConfig

    Source§

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

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

    impl From<RelayConfig> for RelayMap

    Source§

    fn from(value: RelayConfig) -> Self

    Converts to this type from the input type.
    Source§

    impl From<RelayUrl> for RelayConfig

    Source§

    fn from(value: RelayUrl) -> Self

    Converts to this type from the input type.
    Source§

    impl FromIterator<RelayConfig> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl Ord for RelayConfig

    Source§

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

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

    fn max(self, other: Self) -> Self
    where + __D: Deserializer<'de>,

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

    impl Display for RelayConfig

    Source§

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

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

    impl From<RelayConfig> for RelayMap

    Source§

    fn from(value: RelayConfig) -> Self

    Converts to this type from the input type.
    Source§

    impl From<RelayUrl> for RelayConfig

    Source§

    fn from(value: RelayUrl) -> Self

    Converts to this type from the input type.
    Source§

    impl FromIterator<RelayConfig> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl Ord for RelayConfig

    Source§

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

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

    fn max(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · Source§

    fn min(self, other: Self) -> Self
    where Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · Source§

    fn clamp(self, min: Self, max: Self) -> Self
    where Self: Sized,

    Restrict a value to a certain interval. Read more
    Source§

    impl PartialEq for RelayConfig

    Source§

    fn eq(&self, other: &RelayConfig) -> 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, diff --git a/pr/3745/docs/iroh_relay/struct.RelayMap.html b/pr/3745/docs/iroh_relay/struct.RelayMap.html index 4e43ef401d..3a6131c7c6 100644 --- a/pr/3745/docs/iroh_relay/struct.RelayMap.html +++ b/pr/3745/docs/iroh_relay/struct.RelayMap.html @@ -8,28 +8,28 @@ or by creating an empty relay map with let relay2 = RelayUrl::from_str("https://relay2.example.org").unwrap(); let map = RelayMap::from_iter(vec![relay1, relay2]);

    Implementations§

    Source§

    impl RelayMap

    Source

    pub fn empty() -> Self

    Creates an empty relay map.

    Source

    pub fn urls<T>(&self) -> T
    where - T: FromIterator<RelayUrl>,

    Returns the URLs of all servers in this relay map.

    + T: FromIterator<RelayUrl>,

    Returns the URLs of all servers in this relay map.

    This function is generic over the container to collect into. If you simply want a list of URLs, call this with map.urls::<Vec<_>>() to get a Vec<RelayUrl>.

    Source

    pub fn relays<T>(&self) -> T

    Returns a list with the RelayConfig for each relay in this relay map.

    This function is generic over the container to collect into. If you simply want a list of URLs, call this with map.relays::<Vec<_>>() to get a Vec<RelayConfig>.

    -
    Source

    pub fn contains(&self, url: &RelayUrl) -> bool

    Returns true if a relay with url is contained in this this relay map.

    -
    Source

    pub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>

    Returns the config for a relay.

    +
    Source

    pub fn contains(&self, url: &RelayUrl) -> bool

    Returns true if a relay with url is contained in this this relay map.

    +
    Source

    pub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>

    Returns the config for a relay.

    Source

    pub fn len(&self) -> usize

    Returns the number of relays in this relay map.

    Source

    pub fn is_empty(&self) -> bool

    Returns true if this relay map is empty.

    Source

    pub fn insert( &self, - url: RelayUrl, + url: RelayUrl, endpoint: Arc<RelayConfig>, ) -> Option<Arc<RelayConfig>>

    Inserts a new relay into the relay map.

    -
    Source

    pub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>

    Removes an existing relay by its URL.

    +
    Source

    pub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>

    Removes an existing relay by its URL.

    Source

    pub fn extend(&self, other: &RelayMap)

    Extends this RelayMap with another one.

    -

    Trait Implementations§

    Source§

    impl Clone for RelayMap

    Source§

    fn clone(&self) -> RelayMap

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

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

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayMap

    Source§

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

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

    impl Display for RelayMap

    Source§

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

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

    impl From<RelayConfig> for RelayMap

    Source§

    fn from(value: RelayConfig) -> Self

    Converts to this type from the input type.
    Source§

    impl From<RelayUrl> for RelayMap

    Source§

    fn from(value: RelayUrl) -> Self

    Creates a RelayMap from a [RelayUrl].

    +

    Trait Implementations§

    Source§

    impl Clone for RelayMap

    Source§

    fn clone(&self) -> RelayMap

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

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

    Performs copy-assignment from source. Read more
    Source§

    impl Debug for RelayMap

    Source§

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

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

    impl Display for RelayMap

    Source§

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

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

    impl From<RelayConfig> for RelayMap

    Source§

    fn from(value: RelayConfig) -> Self

    Converts to this type from the input type.
    Source§

    impl From<RelayUrl> for RelayMap

    Source§

    fn from(value: RelayUrl) -> Self

    Creates a RelayMap from a RelayUrl.

    The RelayConfigs in the RelayMap will have the default QUIC address discovery ports.

    -
    Source§

    impl FromIterator<Arc<RelayConfig>> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = Arc<RelayConfig>>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl FromIterator<RelayConfig> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl FromIterator<RelayUrl> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self

    Creates a RelayMap from an iterator of [RelayUrl].

    +
    Source§

    impl FromIterator<Arc<RelayConfig>> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = Arc<RelayConfig>>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl FromIterator<RelayConfig> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self

    Creates a value from an iterator. Read more
    Source§

    impl FromIterator<RelayUrl> for RelayMap

    Source§

    fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self

    Creates a RelayMap from an iterator of RelayUrl.

    The RelayConfigs in the RelayMap will have the default QUIC address discovery ports.

    Source§

    impl PartialEq for RelayMap

    Source§

    fn eq(&self, other: &Self) -> 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, diff --git a/pr/3745/docs/src/iroh_dns_server/http.rs.html b/pr/3745/docs/src/iroh_dns_server/http.rs.html index d095244315..b4f139121e 100644 --- a/pr/3745/docs/src/iroh_dns_server/http.rs.html +++ b/pr/3745/docs/src/iroh_dns_server/http.rs.html @@ -277,216 +277,218 @@ 277 278#[cfg(test)] 279mod tests { -280 use hickory_resolver::{ -281 config::{NameServerConfig, ResolverConfig, ResolverOpts}, -282 name_server::TokioConnectionProvider, -283 }; -284 use hickory_server::proto::rr::RecordType; -285 use iroh::{ -286 RelayUrl, SecretKey, -287 discovery::{EndpointInfo, pkarr::PkarrRelayClient}, -288 endpoint_info::EndpointIdExt, -289 }; -290 use n0_error::StdResultExt; -291 use rand::SeedableRng; -292 -293 use crate::{http::HttpsConfig, server::Server}; +280 use std::net::Ipv4Addr; +281 +282 use hickory_resolver::{ +283 config::{NameServerConfig, ResolverConfig, ResolverOpts}, +284 name_server::TokioConnectionProvider, +285 }; +286 use hickory_server::proto::rr::RecordType; +287 use iroh::{ +288 RelayUrl, SecretKey, +289 discovery::{EndpointInfo, pkarr::PkarrRelayClient}, +290 endpoint_info::EndpointIdExt, +291 }; +292 use n0_error::StdResultExt; +293 use rand::SeedableRng; 294 -295 #[tokio::test] -296 async fn test_doh() -> n0_error::Result { -297 tracing_subscriber::fmt::init(); -298 let mut rng = rand_chacha::ChaCha12Rng::seed_from_u64(0); -299 let dir = tempfile::tempdir()?; -300 let https_config = HttpsConfig { -301 port: 0, -302 bind_addr: None, -303 domains: vec!["localhost".to_string()], -304 cert_mode: crate::http::CertMode::SelfSigned, -305 letsencrypt_contact: None, -306 letsencrypt_prod: None, -307 }; -308 let server = -309 Server::spawn_for_tests_with_options(dir.path(), None, None, Some(https_config)) -310 .await?; -311 -312 let (name_z32, signed_packet) = { -313 let secret_key = SecretKey::generate(&mut rng); -314 let endpoint_id = secret_key.public(); -315 let relay_url: RelayUrl = "https://relay.example.".parse()?; -316 let endpoint_info = -317 EndpointInfo::new(endpoint_id).with_relay_url(Some(relay_url.clone())); -318 ( -319 secret_key.public().to_z32(), -320 endpoint_info.to_pkarr_signed_packet(&secret_key, 30)?, -321 ) -322 }; -323 -324 let http_url = server.http_url().expect("http is bound"); -325 let pkarr = PkarrRelayClient::new(format!("{http_url}pkarr").parse().anyerr()?); -326 pkarr.publish(&signed_packet).await?; -327 -328 // Create a reqwest client that does not verify certificates. -329 let client = reqwest::Client::builder() -330 .http2_prior_knowledge() -331 .use_preconfigured_tls(self::tls::insecure_tls_config()) -332 .build() -333 .anyerr()?; -334 -335 // Fetch as JSON via HTTP. -336 let url = format!( -337 "{http_url}dns-query?name={}&type=txt", -338 format_args!("_iroh.{name_z32}."), -339 ); -340 let res = client -341 .get(url) -342 .header("accept", "application/dns-json") -343 .send() -344 .await -345 .anyerr()? -346 .json::<super::doh::DnsResponse>() -347 .await -348 .anyerr()?; -349 assert_eq!(res.answer.len(), 1); -350 assert_eq!(res.answer[0].name, format!("_iroh.{name_z32}.")); -351 assert_eq!(res.answer[0].data, "relay=https://relay.example./"); -352 -353 // Fetch as JSON via HTTPS. -354 let https_url = server.https_url().expect("https is bound"); -355 let url = format!( -356 "{https_url}dns-query?name={}&type=txt", -357 format_args!("_iroh.{name_z32}."), -358 ); -359 let res = client -360 .get(url) -361 .header("accept", "application/dns-json") -362 .send() -363 .await -364 .anyerr()? -365 .json::<super::doh::DnsResponse>() -366 .await -367 .anyerr()?; -368 assert_eq!(res.answer.len(), 1); -369 assert_eq!(res.answer[0].name, format!("_iroh.{name_z32}.")); -370 assert_eq!(res.answer[0].data, "relay=https://relay.example./"); -371 -372 // Fetch over HTTPS via hickory-resolver -373 let client = { -374 let config = { -375 let mut config = ResolverConfig::new(); -376 let mut name_server = NameServerConfig::new( -377 server.https_addr().expect("https is bound"), -378 hickory_server::proto::xfer::Protocol::Https, -379 ); -380 name_server.tls_dns_name = Some("localhost".to_string()); -381 config.add_name_server(name_server); -382 config -383 }; -384 -385 let opts = { -386 let mut opts = ResolverOpts::default(); -387 opts.tls_config = self::tls::insecure_tls_config(); -388 opts -389 }; -390 -391 hickory_resolver::Resolver::builder_with_config( -392 config, -393 TokioConnectionProvider::default(), -394 ) -395 .with_options(opts) -396 .build() -397 }; -398 -399 let res = client -400 .txt_lookup(format!("_iroh.{name_z32}.")) -401 .await -402 .anyerr()?; -403 let records = res.as_lookup().records(); -404 assert_eq!(records.len(), 1); -405 assert_eq!(records[0].record_type(), RecordType::TXT); -406 let txt_data = records[0].data().as_txt().unwrap().txt_data(); -407 assert_eq!(&txt_data[0][..], b"relay=https://relay.example./"); -408 -409 server.shutdown().await?; -410 Ok(()) -411 } -412 -413 mod tls { -414 use std::sync::Arc; -415 -416 use rustls::{ -417 DigitallySignedStruct, RootCertStore, -418 client::{ -419 ClientConfig, -420 danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier}, -421 }, -422 crypto::{ -423 CryptoProvider, ring::default_provider, verify_tls12_signature, -424 verify_tls13_signature, -425 }, -426 pki_types::{CertificateDer, ServerName, UnixTime}, -427 }; -428 -429 #[derive(Debug)] -430 struct NoCertificateVerification(CryptoProvider); -431 -432 impl Default for NoCertificateVerification { -433 fn default() -> Self { -434 Self(default_provider()) -435 } -436 } -437 -438 impl ServerCertVerifier for NoCertificateVerification { -439 fn verify_server_cert( -440 &self, -441 _end_entity: &CertificateDer<'_>, -442 _intermediates: &[CertificateDer<'_>], -443 _server_name: &ServerName<'_>, -444 _ocsp: &[u8], -445 _now: UnixTime, -446 ) -> Result<ServerCertVerified, rustls::Error> { -447 Ok(ServerCertVerified::assertion()) -448 } -449 -450 fn verify_tls12_signature( -451 &self, -452 message: &[u8], -453 cert: &CertificateDer<'_>, -454 dss: &DigitallySignedStruct, -455 ) -> Result<HandshakeSignatureValid, rustls::Error> { -456 verify_tls12_signature( -457 message, -458 cert, -459 dss, -460 &self.0.signature_verification_algorithms, -461 ) -462 } -463 -464 fn verify_tls13_signature( -465 &self, -466 message: &[u8], -467 cert: &CertificateDer<'_>, -468 dss: &DigitallySignedStruct, -469 ) -> Result<HandshakeSignatureValid, rustls::Error> { -470 verify_tls13_signature( -471 message, -472 cert, -473 dss, -474 &self.0.signature_verification_algorithms, -475 ) -476 } -477 -478 fn supported_verify_schemes(&self) -> Vec<rustls::SignatureScheme> { -479 self.0.signature_verification_algorithms.supported_schemes() -480 } -481 } -482 -483 pub(super) fn insecure_tls_config() -> ClientConfig { -484 let mut cfg = ClientConfig::builder() -485 .with_root_certificates(RootCertStore::empty()) -486 .with_no_client_auth(); -487 cfg.dangerous() -488 .set_certificate_verifier(Arc::new(NoCertificateVerification::default())); -489 cfg -490 } -491 } -492}
    \ No newline at end of file +295 use crate::{http::HttpsConfig, server::Server}; +296 +297 #[tokio::test] +298 async fn test_doh() -> n0_error::Result { +299 tracing_subscriber::fmt::init(); +300 let mut rng = rand_chacha::ChaCha12Rng::seed_from_u64(0); +301 let dir = tempfile::tempdir()?; +302 let https_config = HttpsConfig { +303 port: 0, +304 bind_addr: Some(Ipv4Addr::LOCALHOST.into()), +305 domains: vec!["localhost".to_string()], +306 cert_mode: crate::http::CertMode::SelfSigned, +307 letsencrypt_contact: None, +308 letsencrypt_prod: None, +309 }; +310 let server = +311 Server::spawn_for_tests_with_options(dir.path(), None, None, Some(https_config)) +312 .await?; +313 +314 let (name_z32, signed_packet) = { +315 let secret_key = SecretKey::generate(&mut rng); +316 let endpoint_id = secret_key.public(); +317 let relay_url: RelayUrl = "https://relay.example.".parse()?; +318 let endpoint_info = +319 EndpointInfo::new(endpoint_id).with_relay_url(Some(relay_url.clone())); +320 ( +321 secret_key.public().to_z32(), +322 endpoint_info.to_pkarr_signed_packet(&secret_key, 30)?, +323 ) +324 }; +325 +326 let http_url = server.http_url().expect("http is bound"); +327 let pkarr = PkarrRelayClient::new(format!("{http_url}pkarr").parse().anyerr()?); +328 pkarr.publish(&signed_packet).await?; +329 +330 // Create a reqwest client that does not verify certificates. +331 let client = reqwest::Client::builder() +332 .http2_prior_knowledge() +333 .use_preconfigured_tls(self::tls::insecure_tls_config()) +334 .build() +335 .anyerr()?; +336 +337 // Fetch as JSON via HTTP. +338 let url = format!( +339 "{http_url}dns-query?name={}&type=txt", +340 format_args!("_iroh.{name_z32}."), +341 ); +342 let res = client +343 .get(url) +344 .header("accept", "application/dns-json") +345 .send() +346 .await +347 .anyerr()? +348 .json::<super::doh::DnsResponse>() +349 .await +350 .anyerr()?; +351 assert_eq!(res.answer.len(), 1); +352 assert_eq!(res.answer[0].name, format!("_iroh.{name_z32}.")); +353 assert_eq!(res.answer[0].data, "relay=https://relay.example./"); +354 +355 // Fetch as JSON via HTTPS. +356 let https_url = server.https_url().expect("https is bound"); +357 let url = format!( +358 "{https_url}dns-query?name={}&type=txt", +359 format_args!("_iroh.{name_z32}."), +360 ); +361 let res = client +362 .get(url) +363 .header("accept", "application/dns-json") +364 .send() +365 .await +366 .anyerr()? +367 .json::<super::doh::DnsResponse>() +368 .await +369 .anyerr()?; +370 assert_eq!(res.answer.len(), 1); +371 assert_eq!(res.answer[0].name, format!("_iroh.{name_z32}.")); +372 assert_eq!(res.answer[0].data, "relay=https://relay.example./"); +373 +374 // Fetch over HTTPS via hickory-resolver +375 let client = { +376 let config = { +377 let mut config = ResolverConfig::new(); +378 let mut name_server = NameServerConfig::new( +379 server.https_addr().expect("https is bound"), +380 hickory_server::proto::xfer::Protocol::Https, +381 ); +382 name_server.tls_dns_name = Some("localhost".to_string()); +383 config.add_name_server(name_server); +384 config +385 }; +386 +387 let opts = { +388 let mut opts = ResolverOpts::default(); +389 opts.tls_config = self::tls::insecure_tls_config(); +390 opts +391 }; +392 +393 hickory_resolver::Resolver::builder_with_config( +394 config, +395 TokioConnectionProvider::default(), +396 ) +397 .with_options(opts) +398 .build() +399 }; +400 +401 let res = client +402 .txt_lookup(format!("_iroh.{name_z32}.")) +403 .await +404 .anyerr()?; +405 let records = res.as_lookup().records(); +406 assert_eq!(records.len(), 1); +407 assert_eq!(records[0].record_type(), RecordType::TXT); +408 let txt_data = records[0].data().as_txt().unwrap().txt_data(); +409 assert_eq!(&txt_data[0][..], b"relay=https://relay.example./"); +410 +411 server.shutdown().await?; +412 Ok(()) +413 } +414 +415 mod tls { +416 use std::sync::Arc; +417 +418 use rustls::{ +419 DigitallySignedStruct, RootCertStore, +420 client::{ +421 ClientConfig, +422 danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier}, +423 }, +424 crypto::{ +425 CryptoProvider, ring::default_provider, verify_tls12_signature, +426 verify_tls13_signature, +427 }, +428 pki_types::{CertificateDer, ServerName, UnixTime}, +429 }; +430 +431 #[derive(Debug)] +432 struct NoCertificateVerification(CryptoProvider); +433 +434 impl Default for NoCertificateVerification { +435 fn default() -> Self { +436 Self(default_provider()) +437 } +438 } +439 +440 impl ServerCertVerifier for NoCertificateVerification { +441 fn verify_server_cert( +442 &self, +443 _end_entity: &CertificateDer<'_>, +444 _intermediates: &[CertificateDer<'_>], +445 _server_name: &ServerName<'_>, +446 _ocsp: &[u8], +447 _now: UnixTime, +448 ) -> Result<ServerCertVerified, rustls::Error> { +449 Ok(ServerCertVerified::assertion()) +450 } +451 +452 fn verify_tls12_signature( +453 &self, +454 message: &[u8], +455 cert: &CertificateDer<'_>, +456 dss: &DigitallySignedStruct, +457 ) -> Result<HandshakeSignatureValid, rustls::Error> { +458 verify_tls12_signature( +459 message, +460 cert, +461 dss, +462 &self.0.signature_verification_algorithms, +463 ) +464 } +465 +466 fn verify_tls13_signature( +467 &self, +468 message: &[u8], +469 cert: &CertificateDer<'_>, +470 dss: &DigitallySignedStruct, +471 ) -> Result<HandshakeSignatureValid, rustls::Error> { +472 verify_tls13_signature( +473 message, +474 cert, +475 dss, +476 &self.0.signature_verification_algorithms, +477 ) +478 } +479 +480 fn supported_verify_schemes(&self) -> Vec<rustls::SignatureScheme> { +481 self.0.signature_verification_algorithms.supported_schemes() +482 } +483 } +484 +485 pub(super) fn insecure_tls_config() -> ClientConfig { +486 let mut cfg = ClientConfig::builder() +487 .with_root_certificates(RootCertStore::empty()) +488 .with_no_client_auth(); +489 cfg.dangerous() +490 .set_certificate_verifier(Arc::new(NoCertificateVerification::default())); +491 cfg +492 } +493 } +494}
    \ No newline at end of file diff --git a/pr/3745/docs/trait.impl/core/convert/trait.From.js b/pr/3745/docs/trait.impl/core/convert/trait.From.js index 34a5306f46..0cebe6b8f8 100644 --- a/pr/3745/docs/trait.impl/core/convert/trait.From.js +++ b/pr/3745/docs/trait.impl/core/convert/trait.From.js @@ -1,9 +1,9 @@ (function() { - var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryError> for AnyError"],["impl From<IntoDiscoveryError> for BindError"],["impl From<IntoDiscoveryError> for AnyError"],["impl From<PkarrError> for DiscoveryError"],["impl From<PkarrError> for AnyError"],["impl From<AddEndpointAddrError> for ConnectWithOptsError"],["impl From<AddEndpointAddrError> for AnyError"],["impl From<AlpnError> for AnyError"],["impl From<AuthenticationError> for ConnectingError"],["impl From<AuthenticationError> for AnyError"],["impl From<BindError> for AnyError"],["impl From<ConnectError> for AnyError"],["impl From<ConnectWithOptsError> for ConnectError"],["impl From<ConnectWithOptsError> for AnyError"],["impl From<ConnectingError> for ConnectError"],["impl From<ConnectingError> for AcceptError"],["impl From<ConnectingError> for AnyError"],["impl From<ConnectionError> for AlpnError"],["impl From<ConnectionError> for AuthenticationError"],["impl From<ConnectionError> for ConnectError"],["impl From<ConnectionError> for ConnectingError"],["impl From<ConnectionError> for AcceptError"],["impl From<GetMappingAddressError> for ConnectWithOptsError"],["impl From<GetMappingAddressError> for AnyError"],["impl From<AcceptError> for AnyError"],["impl From<Error> for AcceptError"],["impl From<DiscoveryItem> for EndpointInfo"],["impl From<ClosedStream> for AcceptError"],["impl From<RemoteEndpointIdError> for AuthenticationError"],["impl From<RemoteEndpointIdError> for AcceptError"],["impl From<RemoteEndpointIdError> for AnyError"],["impl From<AnyError> for AcceptError"],["impl From<ConnectError> for ConnectWithOptsError"],["impl<T> From<T> for ConcurrentDiscovery
    where\n T: IntoIterator<Item = Box<dyn Discovery>>,
    "],["impl<T: ProtocolHandler> From<T> for Box<dyn DynProtocolHandler>"]]],["iroh_base",[["impl From<KeyParsingError> for AnyError"],["impl From<Url> for RelayUrl"],["impl From<PublicKey> for EndpointAddr"],["impl From<RelayUrl> for Url"],["impl From<RelayUrlParseError> for AnyError"],["impl From<SignatureError> for AnyError"],["impl From<DecodeError> for KeyParsingError"],["impl From<Error> for KeyParsingError"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<ConnectError> for AnyError"],["impl From<DialError> for ConnectError"],["impl From<DialError> for AnyError"],["impl From<RecvError> for AnyError"],["impl From<SendError> for AnyError"],["impl From<DnsError> for DialError"],["impl From<DnsError> for LookupError"],["impl From<DnsError> for AnyError"],["impl From<LookupError> for AnyError"],["impl From<DecodingError> for ParseError"],["impl From<DecodingError> for AnyError"],["impl From<EncodingError> for AnyError"],["impl From<ParseError> for LookupError"],["impl From<ParseError> for AnyError"],["impl From<FrameType> for u32"],["impl From<FrameType> for VarInt"],["impl From<FrameTypeError> for Error"],["impl From<FrameTypeError> for Error"],["impl From<FrameTypeError> for AnyError"],["impl From<Error> for ConnectError"],["impl From<Error> for AnyError"],["impl From<Error> for RecvError"],["impl From<Error> for AnyError"],["impl From<Error> for AnyError"],["impl From<SpawnError> for AnyError"],["impl From<SupervisorError> for AnyError"],["impl From<Vec<Box<[u8]>>> for TxtRecordData"],["impl From<Utf8Error> for ParseError"],["impl From<Utf8Error> for Error"],["impl From<Error> for ConnectError"],["impl From<Error> for DialError"],["impl From<EndpointInfo> for EndpointAddr"],["impl From<MaxLengthExceededError> for AnyError"],["impl From<RelayConfig> for RelayMap"],["impl From<ConnectError> for Error"],["impl From<ConnectionError> for Error"],["impl From<Elapsed> for DialError"],["impl From<Elapsed> for DnsError"],["impl From<EndpointAddr> for EndpointData"],["impl From<EndpointAddr> for EndpointInfo"],["impl From<Error> for ConnectError"],["impl From<Error> for ConnectError"],["impl From<Error> for DialError"],["impl From<Error> for RecvError"],["impl From<Error> for SendError"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<JoinError> for SupervisorError"],["impl From<KeyParsingError> for Error"],["impl From<RecvError> for Error"],["impl From<RelayUrl> for RelayConfig"],["impl From<RelayUrl> for RelayMap"],["impl From<ResolveError> for DnsError"],["impl<E: StackError + 'static> From<StaggeredError<E>> for AnyError"],["impl<T: AsRef<[u8]>> From<T> for Datagrams"]]]]); + var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryError> for AnyError"],["impl From<IntoDiscoveryError> for BindError"],["impl From<IntoDiscoveryError> for AnyError"],["impl From<PkarrError> for DiscoveryError"],["impl From<PkarrError> for AnyError"],["impl From<AddEndpointAddrError> for ConnectWithOptsError"],["impl From<AddEndpointAddrError> for AnyError"],["impl From<AlpnError> for AnyError"],["impl From<AuthenticationError> for ConnectingError"],["impl From<AuthenticationError> for AnyError"],["impl From<BindError> for AnyError"],["impl From<ConnectError> for AnyError"],["impl From<ConnectWithOptsError> for ConnectError"],["impl From<ConnectWithOptsError> for AnyError"],["impl From<ConnectingError> for ConnectError"],["impl From<ConnectingError> for AcceptError"],["impl From<ConnectingError> for AnyError"],["impl From<ConnectionError> for AlpnError"],["impl From<ConnectionError> for AuthenticationError"],["impl From<ConnectionError> for ConnectError"],["impl From<ConnectionError> for ConnectingError"],["impl From<ConnectionError> for AcceptError"],["impl From<GetMappingAddressError> for ConnectWithOptsError"],["impl From<GetMappingAddressError> for AnyError"],["impl From<AcceptError> for AnyError"],["impl From<Error> for AcceptError"],["impl From<DiscoveryItem> for EndpointInfo"],["impl From<ClosedStream> for AcceptError"],["impl From<RemoteEndpointIdError> for AuthenticationError"],["impl From<RemoteEndpointIdError> for AcceptError"],["impl From<RemoteEndpointIdError> for AnyError"],["impl From<AnyError> for AcceptError"],["impl From<ConnectError> for ConnectWithOptsError"],["impl<T> From<T> for ConcurrentDiscovery
    where\n T: IntoIterator<Item = Box<dyn Discovery>>,
    "],["impl<T: ProtocolHandler> From<T> for Box<dyn DynProtocolHandler>"]]],["iroh_base",[["impl From<KeyParsingError> for AnyError"],["impl From<Url> for RelayUrl"],["impl From<PublicKey> for EndpointAddr"],["impl From<RelayUrl> for Url"],["impl From<RelayUrlParseError> for AnyError"],["impl From<SignatureError> for AnyError"],["impl From<DecodeError> for KeyParsingError"],["impl From<Error> for KeyParsingError"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<KeyParsingError> for Error"],["impl From<ConnectError> for AnyError"],["impl From<DialError> for ConnectError"],["impl From<DialError> for AnyError"],["impl From<RecvError> for AnyError"],["impl From<SendError> for AnyError"],["impl From<DnsError> for DialError"],["impl From<DnsError> for LookupError"],["impl From<DnsError> for AnyError"],["impl From<LookupError> for AnyError"],["impl From<DecodingError> for ParseError"],["impl From<DecodingError> for AnyError"],["impl From<EncodingError> for AnyError"],["impl From<ParseError> for LookupError"],["impl From<ParseError> for AnyError"],["impl From<FrameType> for u32"],["impl From<FrameType> for VarInt"],["impl From<FrameTypeError> for Error"],["impl From<FrameTypeError> for Error"],["impl From<FrameTypeError> for AnyError"],["impl From<Error> for ConnectError"],["impl From<Error> for AnyError"],["impl From<Error> for RecvError"],["impl From<Error> for AnyError"],["impl From<Error> for AnyError"],["impl From<SpawnError> for AnyError"],["impl From<SupervisorError> for AnyError"],["impl From<Vec<Box<[u8]>>> for TxtRecordData"],["impl From<Utf8Error> for ParseError"],["impl From<Utf8Error> for Error"],["impl From<Error> for ConnectError"],["impl From<Error> for DialError"],["impl From<EndpointAddr> for EndpointData"],["impl From<EndpointAddr> for EndpointInfo"],["impl From<RelayUrl> for RelayConfig"],["impl From<RelayUrl> for RelayMap"],["impl From<EndpointInfo> for EndpointAddr"],["impl From<MaxLengthExceededError> for AnyError"],["impl From<RelayConfig> for RelayMap"],["impl From<ConnectError> for Error"],["impl From<ConnectionError> for Error"],["impl From<Elapsed> for DialError"],["impl From<Elapsed> for DnsError"],["impl From<Error> for ConnectError"],["impl From<Error> for ConnectError"],["impl From<Error> for DialError"],["impl From<Error> for RecvError"],["impl From<Error> for SendError"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl From<JoinError> for SupervisorError"],["impl From<RecvError> for Error"],["impl From<ResolveError> for DnsError"],["impl<E: StackError + 'static> From<StaggeredError<E>> for AnyError"],["impl<T: AsRef<[u8]>> From<T> for Datagrams"]]]]); if (window.register_implementors) { window.register_implementors(implementors); } else { window.pending_implementors = implementors; } })() -//{"start":57,"fragment_lengths":[13657,3090,18835]} \ No newline at end of file +//{"start":57,"fragment_lengths":[13657,3090,19611]} \ No newline at end of file diff --git a/pr/3745/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js b/pr/3745/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js index 53eb8f19b7..6823ee20ab 100644 --- a/pr/3745/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js +++ b/pr/3745/docs/trait.impl/core/iter/traits/collect/trait.FromIterator.js @@ -1,9 +1,9 @@ (function() { - var implementors = Object.fromEntries([["iroh_relay",[["impl FromIterator<Box<[u8]>> for TxtRecordData"],["impl FromIterator<Arc<RelayConfig>> for RelayMap"],["impl FromIterator<RelayConfig> for RelayMap"],["impl FromIterator<RelayUrl> for RelayMap"]]]]); + var implementors = Object.fromEntries([["iroh_relay",[["impl FromIterator<Box<[u8]>> for TxtRecordData"],["impl FromIterator<Arc<RelayConfig>> for RelayMap"],["impl FromIterator<RelayUrl> for RelayMap"],["impl FromIterator<RelayConfig> for RelayMap"]]]]); if (window.register_implementors) { window.register_implementors(implementors); } else { window.pending_implementors = implementors; } })() -//{"start":57,"fragment_lengths":[1940]} \ No newline at end of file +//{"start":57,"fragment_lengths":[2062]} \ No newline at end of file