pub enum ConnectionSelector {
- Iroh(Connection),
+ Iroh(Connection),
Quinn(Connection),
-}Variants§
Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionSelector
impl RefUnwindSafe for ConnectionSelector
impl Send for ConnectionSelector
impl Sync for ConnectionSelector
impl Unpin for ConnectionSelector
impl UnwindSafe for ConnectionSelector
Blanket Implementations§
Source§impl<T> Any for Twhere
+}Variants§
§Iroh(Connection)
§Quinn(Connection)
Implementations§
Auto Trait Implementations§
§impl Freeze for ConnectionSelector
§impl RefUnwindSafe for ConnectionSelector
§impl Send for ConnectionSelector
§impl Sync for ConnectionSelector
§impl Unpin for ConnectionSelector
§impl UnwindSafe for ConnectionSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
pub enum EndpointSelector {
- Iroh(Endpoint),
+ Iroh(Endpoint),
Quinn(Endpoint),
-}
Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
Source§impl<T> Any for Twhere
+}Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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
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
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
\ 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
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
Expand description
HTTP server part of iroh-dns-server
+iroh_dns_server::http - Rust Module http
Expand description
HTTP server part of iroh-dns-server
Structs§
- Http
Config - Config for the HTTP server
- Http
Server - The HTTP(S) server part of iroh-dns-server
- Https
Config - Config for the HTTPS server
Enums§
- Cert
Mode - The mode how SSL certificates should be created.
- Rate
LimitConfig - 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
pub struct ClientBuilder { /* private fields */ }
Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
Sourcepub fn new(
- url: impl Into<RelayUrl>,
- secret_key: SecretKey,
+ url: impl Into<RelayUrl>,
+ secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
Create a new ClientBuilder
Sourcepub fn address_family_selector<S>(self, selector: S) -> Selfwhere
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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.Trait Implementations§
Source§impl Debug for DecodingError
Source§impl Display for DecodingError
Source§impl Error for DecodingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.Auto Trait Implementations§
§impl Freeze for DecodingError
§impl !RefUnwindSafe for DecodingError
§impl Send for DecodingError
§impl Sync for DecodingError
§impl Unpin for DecodingError
§impl !UnwindSafe for DecodingError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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:
- Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from [z32],
+
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - 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
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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub 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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint data.
Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
Sets the direct addresses and returns the updated endpoint data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint data.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<EndpointAddr> for EndpointData
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§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§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
impl<T> Any for Twhere
+}Variants§
§Iroh(Connection)
§Quinn(Connection)
Implementations§
Auto Trait Implementations§
§impl Freeze for ConnectionSelector
§impl RefUnwindSafe for ConnectionSelector
§impl Send for ConnectionSelector
§impl Sync for ConnectionSelector
§impl Unpin for ConnectionSelector
§impl UnwindSafe for ConnectionSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
pub enum EndpointSelector {
- Iroh(Endpoint),
+ Iroh(Endpoint),
Quinn(Endpoint),
-}
Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
Source§impl<T> Any for Twhere
+}Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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
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
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
\ 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
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
Expand description
HTTP server part of iroh-dns-server
+iroh_dns_server::http - Rust Module http
Expand description
HTTP server part of iroh-dns-server
Structs§
- Http
Config - Config for the HTTP server
- Http
Server - The HTTP(S) server part of iroh-dns-server
- Https
Config - Config for the HTTPS server
Enums§
- Cert
Mode - The mode how SSL certificates should be created.
- Rate
LimitConfig - 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
pub struct ClientBuilder { /* private fields */ }
Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
Sourcepub fn new(
- url: impl Into<RelayUrl>,
- secret_key: SecretKey,
+ url: impl Into<RelayUrl>,
+ secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
Create a new ClientBuilder
Sourcepub fn address_family_selector<S>(self, selector: S) -> Selfwhere
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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.Trait Implementations§
Source§impl Debug for DecodingError
Source§impl Display for DecodingError
Source§impl Error for DecodingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.Auto Trait Implementations§
§impl Freeze for DecodingError
§impl !RefUnwindSafe for DecodingError
§impl Send for DecodingError
§impl Sync for DecodingError
§impl Unpin for DecodingError
§impl !UnwindSafe for DecodingError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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:
- Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from [z32],
+
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - 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
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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub 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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint data.
Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
Sets the direct addresses and returns the updated endpoint data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint data.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<EndpointAddr> for EndpointData
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§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§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
Variants§
Iroh(Connection)
Quinn(Connection)
Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionSelector
impl RefUnwindSafe for ConnectionSelector
impl Send for ConnectionSelector
impl Sync for ConnectionSelector
impl Unpin for ConnectionSelector
impl UnwindSafe for ConnectionSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
pub enum EndpointSelector {
- Iroh(Endpoint),
+ Iroh(Endpoint),
Quinn(Endpoint),
-}
Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
Source§impl<T> Any for Twhere
+}Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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
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
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
\ 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
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
Expand description
HTTP server part of iroh-dns-server
+iroh_dns_server::http - Rust Module http
Expand description
HTTP server part of iroh-dns-server
Structs§
- Http
Config - Config for the HTTP server
- Http
Server - The HTTP(S) server part of iroh-dns-server
- Https
Config - Config for the HTTPS server
Enums§
- Cert
Mode - The mode how SSL certificates should be created.
- Rate
LimitConfig - 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
pub struct ClientBuilder { /* private fields */ }
Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
Sourcepub fn new(
- url: impl Into<RelayUrl>,
- secret_key: SecretKey,
+ url: impl Into<RelayUrl>,
+ secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
Create a new ClientBuilder
Sourcepub fn address_family_selector<S>(self, selector: S) -> Selfwhere
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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.Trait Implementations§
Source§impl Debug for DecodingError
Source§impl Display for DecodingError
Source§impl Error for DecodingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.Auto Trait Implementations§
§impl Freeze for DecodingError
§impl !RefUnwindSafe for DecodingError
§impl Send for DecodingError
§impl Sync for DecodingError
§impl Unpin for DecodingError
§impl !UnwindSafe for DecodingError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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:
- Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from [z32],
+
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - 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
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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub 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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint data.
Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
Sets the direct addresses and returns the updated endpoint data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint data.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<EndpointAddr> for EndpointData
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§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§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
EndpointSelector
pub enum EndpointSelector {
- Iroh(Endpoint),
+ Iroh(Endpoint),
Quinn(Endpoint),
-}Variants§
Implementations§
Auto Trait Implementations§
impl Freeze for EndpointSelector
impl !RefUnwindSafe for EndpointSelector
impl Send for EndpointSelector
impl Sync for EndpointSelector
impl Unpin for EndpointSelector
impl !UnwindSafe for EndpointSelector
Blanket Implementations§
Source§impl<T> Any for Twhere
+}Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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
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
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
\ 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
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
Expand description
HTTP server part of iroh-dns-server
+iroh_dns_server::http - Rust Module http
Expand description
HTTP server part of iroh-dns-server
Structs§
- Http
Config - Config for the HTTP server
- Http
Server - The HTTP(S) server part of iroh-dns-server
- Https
Config - Config for the HTTPS server
Enums§
- Cert
Mode - The mode how SSL certificates should be created.
- Rate
LimitConfig - 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
pub struct ClientBuilder { /* private fields */ }
Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
Sourcepub fn new(
- url: impl Into<RelayUrl>,
- secret_key: SecretKey,
+ url: impl Into<RelayUrl>,
+ secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
Create a new ClientBuilder
Sourcepub fn address_family_selector<S>(self, selector: S) -> Selfwhere
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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.Trait Implementations§
Source§impl Debug for DecodingError
Source§impl Display for DecodingError
Source§impl Error for DecodingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.Auto Trait Implementations§
§impl Freeze for DecodingError
§impl !RefUnwindSafe for DecodingError
§impl Send for DecodingError
§impl Sync for DecodingError
§impl Unpin for DecodingError
§impl !UnwindSafe for DecodingError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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:
- Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from [z32],
+
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - 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
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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub 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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint data.
Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
Sets the direct addresses and returns the updated endpoint data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint data.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<EndpointAddr> for EndpointData
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§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§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
impl<T> Any for Twhere
+}Variants§
Implementations§
Auto Trait Implementations§
§impl Freeze for EndpointSelector
§impl !RefUnwindSafe for EndpointSelector
§impl Send for EndpointSelector
§impl Sync for EndpointSelector
§impl Unpin for EndpointSelector
§impl !UnwindSafe for EndpointSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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
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
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
\ 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
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
Expand description
HTTP server part of iroh-dns-server
+iroh_dns_server::http - Rust Module http
Expand description
HTTP server part of iroh-dns-server
Structs§
- Http
Config - Config for the HTTP server
- Http
Server - The HTTP(S) server part of iroh-dns-server
- Https
Config - Config for the HTTPS server
Enums§
- Cert
Mode - The mode how SSL certificates should be created.
- Rate
LimitConfig - 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
pub struct ClientBuilder { /* private fields */ }
Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
Sourcepub fn new(
- url: impl Into<RelayUrl>,
- secret_key: SecretKey,
+ url: impl Into<RelayUrl>,
+ secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
Create a new ClientBuilder
Sourcepub fn address_family_selector<S>(self, selector: S) -> Selfwhere
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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.Trait Implementations§
Source§impl Debug for DecodingError
Source§impl Display for DecodingError
Source§impl Error for DecodingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.Auto Trait Implementations§
§impl Freeze for DecodingError
§impl !RefUnwindSafe for DecodingError
§impl Send for DecodingError
§impl Sync for DecodingError
§impl Unpin for DecodingError
§impl !UnwindSafe for DecodingError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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:
- Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from [z32],
+
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - 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
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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub 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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint data.
Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
Sets the direct addresses and returns the updated endpoint data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint data.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<EndpointAddr> for EndpointData
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§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§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
Variants§
Implementations§
Auto Trait Implementations§
impl Freeze for EndpointSelector
impl !RefUnwindSafe for EndpointSelector
impl Send for EndpointSelector
impl Sync for EndpointSelector
impl Unpin for EndpointSelector
impl !UnwindSafe for EndpointSelector
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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
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
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
\ 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
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
Expand description
HTTP server part of iroh-dns-server
+iroh_dns_server::http - Rust Module http
Expand description
HTTP server part of iroh-dns-server
Structs§
- Http
Config - Config for the HTTP server
- Http
Server - The HTTP(S) server part of iroh-dns-server
- Https
Config - Config for the HTTPS server
Enums§
- Cert
Mode - The mode how SSL certificates should be created.
- Rate
LimitConfig - 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
pub struct ClientBuilder { /* private fields */ }
Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
Sourcepub fn new(
- url: impl Into<RelayUrl>,
- secret_key: SecretKey,
+ url: impl Into<RelayUrl>,
+ secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
Create a new ClientBuilder
Sourcepub fn address_family_selector<S>(self, selector: S) -> Selfwhere
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.
Sourcepub 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.
Sourcepub 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.
Sourcepub 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.Trait Implementations§
Source§impl Debug for DecodingError
Source§impl Display for DecodingError
Source§impl Error for DecodingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.Auto Trait Implementations§
§impl Freeze for DecodingError
§impl !RefUnwindSafe for DecodingError
§impl Send for DecodingError
§impl Sync for DecodingError
§impl Unpin for DecodingError
§impl !UnwindSafe for DecodingError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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:
- Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from [z32],
+
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - 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
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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub 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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint data.
Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
Sets the direct addresses and returns the updated endpoint data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint data.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<EndpointAddr> for EndpointData
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§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§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
client
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
connect_client
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
handle_client_stream
pub async fn handle_client_stream(
- connection: &Connection,
+ connection: &Connection,
upload_size: u64,
read_unordered: bool,
) -> Result<(TransferResult, TransferResult)>server
pub async fn server(endpoint: Endpoint, opt: Opt) -> Result<()>Expand description
Take the provided endpoint and run the server
+server
server_endpoint
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
Module http
Expand description
HTTP server part of iroh-dns-server
+Module http
Expand description
HTTP server part of iroh-dns-server
Structs§
- Http
Config - Config for the HTTP server
- Http
Server - The HTTP(S) server part of iroh-dns-server
- Https
Config - Config for the HTTPS server
Enums§
- Cert
Mode - The mode how SSL certificates should be created.
- Rate
Limit Config - Config for http server rate limit.
ClientBuilder
pub struct ClientBuilder { /* private fields */ }Expand description
Build a Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(
- url: impl Into<RelayUrl>,
- secret_key: SecretKey,
+ url: impl Into<RelayUrl>,
+ secret_key: SecretKey,
dns_resolver: DnsResolver,
) -> Self
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
Sourcepub fn address_family_selector<S>(self, selector: S) -> Selfwhere
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.
pub fn address_family_selector<S>(self, selector: S) -> Selfwhere
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.
timeout is applied as stated in
summary of all errors otherwise.
Sourcepub async fn lookup_endpoint_by_id(
&self,
- endpoint_id: &EndpointId,
+ endpoint_id: &EndpointId,
origin: &str,
-) -> Result<EndpointInfo, LookupError>
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.
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.
Sourcepub 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.
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.
Sourcepub async fn lookup_endpoint_by_id_staggered(
&self,
- endpoint_id: &EndpointId,
+ endpoint_id: &EndpointId,
origin: &str,
delays_ms: &[u64],
-) -> Result<EndpointInfo, StaggeredError<LookupError>>
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.
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
Trait Implementations§
Source§impl Debug for DecodingError
impl Debug for DecodingError
Source§impl Display for DecodingError
impl Display for DecodingError
Source§impl Error for DecodingError
impl Error for DecodingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<DecodingError> for AnyError
impl From<DecodingError> for AnyError
Source§fn from(value: DecodingError) -> AnyError
fn from(value: DecodingError) -> AnyError
Source§impl From<DecodingError> for ParseError
impl From<DecodingError> for ParseError
Source§fn from(source: DecodingError) -> Self
fn from(source: DecodingError) -> Self
Source§impl StackError for DecodingError
impl StackError for DecodingError
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
Auto Trait Implementations§
impl Freeze for DecodingError
impl !RefUnwindSafe for DecodingError
impl Send for DecodingError
impl Sync for DecodingError
impl Unpin for DecodingError
impl !UnwindSafe for DecodingError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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:
- Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from [z32],
+
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - 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
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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub 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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint data.
Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
Sets the direct addresses and returns the updated endpoint data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint data.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<EndpointAddr> for EndpointData
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§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§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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
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:
- Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from [z32],
+
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
ExceededError - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTH bytes.
Enums§
Constants§
- IROH_
TXT_NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - 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
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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
-Sourcepub 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
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint data.
Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
Sets the direct addresses and returns the updated endpoint data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint data.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§impl From<EndpointAddr> for EndpointData
Trait Implementations§
Source§impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointData
Source§impl Default for EndpointData
Source§fn default() -> EndpointData
Returns the “default value” for a type. Read moreSource§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§impl Eq for EndpointData
Source§impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
§impl Freeze for EndpointData
§impl RefUnwindSafe for EndpointData
§impl Send for EndpointData
§impl Sync for EndpointData
§impl Unpin for EndpointData
§impl UnwindSafe for EndpointData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
Module endpoint_info
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
+
Module endpoint_info
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
_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:
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
Exceeded Error - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTHbytes.
Enums§
Constants§
- IROH_
TXT_ NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for [
EndpointId] to encode to and decode from [z32], +
Structs§
- Endpoint
Data - Data about an endpoint that may be published to and resolved from discovery services.
- Endpoint
Info - Information about an endpoint that may be published to and resolved from discovery services.
- MaxLength
Exceeded Error - Error returned when an input value is too long for
UserData. - User
Data - Under the hood this is a UTF-8 String is no longer than
UserData::MAX_LENGTHbytes.
Enums§
Constants§
- IROH_
TXT_ NAME - The DNS name for the iroh TXT record.
Traits§
- Endpoint
IdExt - Extension methods for
EndpointIdto encode to and decode from [z32], which is the encoding used in [pkarr] domain names.
EndpointData
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
impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
pub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
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
impl EndpointData
Sourcepub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
pub fn new(addrs: impl IntoIterator<Item = TransportAddr>) -> Self
Creates a new EndpointData with a relay URL and a set of direct addresses.
Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint data.
Sourcepub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
pub fn with_ip_addrs(self, addresses: BTreeSet<SocketAddr>) -> Self
Sets the direct addresses and returns the updated endpoint data.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
pub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint data.
-Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
pub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
pub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
pub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointData
impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
fn clone(&self) -> EndpointData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointData
impl Debug for EndpointData
Source§impl Default for EndpointData
impl Default for EndpointData
Source§fn default() -> EndpointData
fn default() -> EndpointData
Source§impl From<EndpointAddr> for EndpointData
impl From<EndpointAddr> for EndpointData
Trait Implementations§
Source§impl Clone for EndpointData
impl Clone for EndpointData
Source§fn clone(&self) -> EndpointData
fn clone(&self) -> EndpointData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointData
impl Debug for EndpointData
Source§impl Default for EndpointData
impl Default for EndpointData
Source§fn default() -> EndpointData
fn default() -> EndpointData
Source§impl From<EndpointAddr> for EndpointData
impl From<EndpointAddr> for EndpointData
Source§fn from(endpoint_addr: EndpointAddr) -> Self
fn from(endpoint_addr: EndpointAddr) -> Self
Source§impl PartialEq for EndpointData
impl PartialEq for EndpointData
impl Eq for EndpointData
impl StructuralPartialEq for EndpointData
Auto Trait Implementations§
impl Freeze for EndpointData
impl RefUnwindSafe for EndpointData
impl Send for EndpointData
impl Sync for EndpointData
impl Unpin for EndpointData
impl UnwindSafe for EndpointData
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the endpoint this is about.
+This struct couples a EndpointId with its associated EndpointData.
+Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
§data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
-Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
-Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
+Implementations§
Source§impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
+Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
+Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
-Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
+Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
+Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub 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].
Sourcepub 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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
-Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
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
Trait Implementations§
Source§impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
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§impl Eq for EndpointInfo
Source§impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
§impl Freeze for EndpointInfo
§impl RefUnwindSafe for EndpointInfo
§impl Send for EndpointInfo
§impl Sync for EndpointInfo
§impl Unpin for EndpointInfo
§impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
- dns
Non-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.
- dns
Non-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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
QuicConfig - 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: EndpointIdThe remote endpoint to relay to.
+Fields
§dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
Returns a duplicate of the value. Read more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
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
§SerDe
§FrameTypeError
§InvalidPublicKey
§InvalidPublicKey
§InvalidFrame
Fields
§meta: MetaCaptured call-site metadata
§InvalidFrameType
§InvalidProtocolMessageEncoding
§TooSmall
Fields
§meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
Trait Implementations§
Source§impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more1.0.0 · Source§fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()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 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 fmt_message(&self, f: &mut Formatter<'_>) -> Result
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.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
EndpointInfo
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: EndpointIdThe [EndpointId] of the endpoint this is about.
This struct couples a EndpointId with its associated EndpointData.
Fields§
§endpoint_id: EndpointIdThe EndpointId of the endpoint this is about.
data: EndpointDataThe information published about the endpoint.
-Implementations§
Source§impl EndpointInfo
impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
pub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
pub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
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
impl EndpointInfo
Sourcepub fn new(endpoint_id: EndpointId) -> Self
pub fn new(endpoint_id: EndpointId) -> Self
Creates a new EndpointInfo with an empty EndpointData.
Sourcepub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
pub fn from_parts(endpoint_id: EndpointId, data: EndpointData) -> Self
Creates a new EndpointInfo from its parts.
Sourcepub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
pub fn with_relay_url(self, relay_url: Option<RelayUrl>) -> Self
Sets the relay URL and returns the updated endpoint info.
Sourcepub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
pub fn with_ip_addrs(self, addrs: BTreeSet<SocketAddr>) -> Self
Sets the IP based addresses and returns the updated endpoint info.
Sourcepub fn with_user_data(self, user_data: Option<UserData>) -> Self
pub fn with_user_data(self, user_data: Option<UserData>) -> Self
Sets the user-defined data and returns the updated endpoint info.
-Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
pub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a [EndpointAddr] by cloning the needed fields.
Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
pub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a [EndpointAddr] without cloning.
Sourcepub fn to_endpoint_addr(&self) -> EndpointAddr
pub fn to_endpoint_addr(&self) -> EndpointAddr
Converts into a EndpointAddr by cloning the needed fields.
Sourcepub fn into_endpoint_addr(self) -> EndpointAddr
pub fn into_endpoint_addr(self) -> EndpointAddr
Converts into a EndpointAddr without cloning.
Sourcepub fn from_txt_lookup(
domain_name: String,
lookup: impl Iterator<Item = TxtRecordData>,
@@ -21,21 +21,21 @@
) -> Result<Self, ParseError>
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].
Sourcepub fn to_pkarr_signed_packet(
&self,
- secret_key: &SecretKey,
+ secret_key: &SecretKey,
ttl: u32,
) -> Result<SignedPacket, EncodingError>
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.
Sourcepub fn to_txt_strings(&self) -> Vec<String>
pub fn to_txt_strings(&self) -> Vec<String>
Converts into a list of {key}={value} strings.
Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
+Methods from Deref<Target = EndpointData>§
Sourcepub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
pub fn relay_urls(&self) -> impl Iterator<Item = &RelayUrl>
Returns the relay URL of the endpoint.
Sourcepub fn user_data(&self) -> Option<&UserData>
pub fn user_data(&self) -> Option<&UserData>
Returns the optional user-defined data of the endpoint.
Sourcepub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
pub fn ip_addrs(&self) -> impl Iterator<Item = &SocketAddr>
Returns the direct addresses of the endpoint.
Sourcepub fn clear_ip_addrs(&mut self)
pub fn clear_ip_addrs(&mut self)
Removes all direct addresses from the endpoint data.
Sourcepub fn clear_relay_urls(&mut self)
pub fn clear_relay_urls(&mut self)
Removes all direct addresses from the endpoint data.
-Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
+Sourcepub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
pub fn add_addrs(&mut self, addrs: impl IntoIterator<Item = TransportAddr>)
Add addresses to the endpoint data.
Sourcepub fn set_user_data(&mut self, user_data: Option<UserData>)
pub fn set_user_data(&mut self, user_data: Option<UserData>)
Sets the user-defined data of the endpoint data.
-Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
+Sourcepub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
pub fn addrs(&self) -> impl Iterator<Item = &TransportAddr>
Returns the full list of all known addresses
Trait Implementations§
Source§impl Clone for EndpointInfo
impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
fn clone(&self) -> EndpointInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointInfo
impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
impl From<EndpointAddr> for EndpointInfo
Source§impl From<EndpointInfo> for EndpointAddr
impl From<EndpointInfo> for EndpointAddr
Source§fn from(value: EndpointInfo) -> Self
fn from(value: EndpointInfo) -> Self
Source§impl PartialEq for EndpointInfo
impl PartialEq for EndpointInfo
Trait Implementations§
Source§impl Clone for EndpointInfo
impl Clone for EndpointInfo
Source§fn clone(&self) -> EndpointInfo
fn clone(&self) -> EndpointInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EndpointInfo
impl Debug for EndpointInfo
Source§impl Deref for EndpointInfo
impl Deref for EndpointInfo
Source§impl DerefMut for EndpointInfo
impl DerefMut for EndpointInfo
Source§impl From<EndpointAddr> for EndpointInfo
impl From<EndpointAddr> for EndpointInfo
Source§fn from(addr: EndpointAddr) -> Self
fn from(addr: EndpointAddr) -> Self
Source§impl From<EndpointInfo> for EndpointAddr
impl From<EndpointInfo> for EndpointAddr
Source§fn from(value: EndpointInfo) -> Self
fn from(value: EndpointInfo) -> Self
Source§impl PartialEq for EndpointInfo
impl PartialEq for EndpointInfo
impl Eq for EndpointInfo
impl StructuralPartialEq for EndpointInfo
Auto Trait Implementations§
impl Freeze for EndpointInfo
impl RefUnwindSafe for EndpointInfo
impl Send for EndpointInfo
impl Sync for EndpointInfo
impl Unpin for EndpointInfo
impl UnwindSafe for EndpointInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
-
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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§
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
+Required Methods§
Sourcefn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
+Sourcefn 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.
-
EndpointIdExt
pub trait EndpointIdExt {
// Required methods
fn to_z32(&self) -> String;
- fn from_z32(s: &str) -> Result<EndpointId, DecodingError>;
-}Expand description
Extension methods for [ Extension methods for EndpointId] to encode to and decode from [z32],
+ fn from_z32(s: &str) -> Result<EndpointId, DecodingError>;
+}Expand description
EndpointId to encode to and decode from [z32],
which is the encoding used in [pkarr] domain names.
Required Methods§
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
impl EndpointIdExt for EndpointId
Implementors§
Required Methods§
Sourcefn to_z32(&self) -> String
fn to_z32(&self) -> String
Encodes a EndpointId in z-base-32 encoding.
Sourcefn from_z32(s: &str) -> Result<EndpointId, DecodingError>
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
impl EndpointIdExt for EndpointId
Implementors§
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.
- dns
Non- 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.
- dns
Non- 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.
- server
server - A fully-fledged iroh-relay server over HTTP or HTTPS.
Structs§
- Ping
Tracker - Tracks pings on a single relay connection.
- Relay
Config - Information on a specific relay server.
- Relay
Map - List of relay server configurations to be used in an iroh endpoint.
- Relay
Quic Config - Configuration for speaking to the QUIC endpoint on the relay server to do QUIC address discovery.
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: EndpointIdThe remote endpoint to relay to.
+Fields
dst_endpoint_id: EndpointIdThe remote endpoint to relay to.
Trait Implementations§
Source§impl Clone for ClientToRelayMsg
impl Clone for ClientToRelayMsg
Source§fn clone(&self) -> ClientToRelayMsg
fn clone(&self) -> ClientToRelayMsg
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientToRelayMsg
impl Debug for ClientToRelayMsg
Source§impl PartialEq for ClientToRelayMsg
impl PartialEq for ClientToRelayMsg
Source§impl Sink<ClientToRelayMsg> for Client
impl Sink<ClientToRelayMsg> for Client
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 @@
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
SerDe
FrameTypeError
InvalidPublicKey
InvalidPublicKey
InvalidFrame
Fields
meta: MetaCaptured call-site metadata
InvalidFrameType
InvalidProtocolMessageEncoding
TooSmall
Fields
meta: MetaCaptured call-site metadata
-Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for RecvError
impl From<Error> for RecvError
Source§fn from(source: ProtoError) -> Self
fn from(source: ProtoError) -> Self
Source§impl From<FrameTypeError> for Error
impl From<FrameTypeError> for Error
Source§fn from(source: FrameTypeError) -> Self
fn from(source: FrameTypeError) -> Self
Source§impl StackError for Error
impl StackError for Error
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
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 Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for RecvError
impl From<Error> for RecvError
Source§fn from(source: ProtoError) -> Self
fn from(source: ProtoError) -> Self
Source§impl From<FrameTypeError> for Error
impl From<FrameTypeError> for Error
Source§fn from(source: FrameTypeError) -> Self
fn from(source: FrameTypeError) -> Self
Source§impl From<KeyParsingError> for Error
impl From<KeyParsingError> for Error
Source§fn from(source: KeyParsingError) -> Self
fn from(source: KeyParsingError) -> Self
Source§impl StackError for Error
impl StackError for Error
Source§fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
fn as_std(&self) -> &(dyn Error + Send + Sync + 'static)
Source§fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
fn into_std(self: Box<Self>) -> Box<dyn Error + Send + Sync>
Source§fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
fn fmt_message(&self, f: &mut Formatter<'_>) -> Result
Source§fn is_transparent(&self) -> bool
fn is_transparent(&self) -> bool
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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
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: EndpointIdThe [EndpointId] of the original sender.
+Fields
§remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
§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: StringIf 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
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
Sourcepub 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
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for AccessConfig
§impl !RefUnwindSafe for AccessConfig
§impl Send for AccessConfig
§impl Sync for AccessConfig
§impl Unpin for AccessConfig
§impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s https [RelayUrl].
+Sourcepub 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.
-Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
Get the server’s http [RelayUrl].
+Sourcepub 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.
Sourcepub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
RelayToClientMsg
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: EndpointIdThe [EndpointId] of the original sender.
Fields
remote_endpoint_id: EndpointIdThe EndpointId of the original sender.
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: StringIf 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
pub enum AccessConfig {
Everyone,
- Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>),
+ Restricted(Box<dyn Fn(EndpointId) -> Boxed<Access> + Send + Sync + 'static>),
}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
impl AccessConfig
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
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
impl AccessConfig
Sourcepub async fn is_allowed(&self, endpoint: EndpointId) -> bool
pub async fn is_allowed(&self, endpoint: EndpointId) -> bool
Is this endpoint allowed?
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AccessConfig
impl !RefUnwindSafe for AccessConfig
impl Send for AccessConfig
impl Sync for AccessConfig
impl Unpin for AccessConfig
impl !UnwindSafe for AccessConfig
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
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.
Sourcepub fn http_addr(&self) -> Option<SocketAddr>
pub fn http_addr(&self) -> Option<SocketAddr>
The socket address the HTTP server is listening on.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
pub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
pub fn certificates(&self) -> Option<Vec<CertificateDer<'static>>>
The certificates chain if configured with manual TLS certificates.
-Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
pub fn https_url(&self) -> Option<RelayUrl>
test-utils only.Get the server’s https [RelayUrl].
Sourcepub fn https_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
pub fn https_url(&self) -> Option<RelayUrl>
test-utils only.Get the server’s https RelayUrl.
This uses Self::https_addr so it’s mostly useful for local development.
Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
pub fn http_url(&self) -> Option<RelayUrl>
test-utils only.Get the server’s http [RelayUrl].
Sourcepub fn http_url(&self) -> Option<RelayUrl>
Available on crate feature test-utils only.
pub fn http_url(&self) -> Option<RelayUrl>
test-utils only.Get the server’s http RelayUrl.
This uses Self::http_addr so it’s mostly useful for local development.
Sourcepub fn metrics(&self) -> &RelayMetrics
pub fn metrics(&self) -> &RelayMetrics
Returns the metrics collected in the relay server.
Trait Implementations§
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 Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
impl<T> Any for Twhere
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
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
+Fields§
§url: RelayUrlThe 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 more1.0.0 · Source§fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read moreSource§impl Debug for RelayConfig
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 moreSource§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§impl Display for RelayConfig
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§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read moreSource§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
Sourcepub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub 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>.
-Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
-Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
+Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
Converts to this type from the input type.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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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 moreSource§impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Creates a value from an iterator. Read moreSource§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"],["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"],["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
RelayConfig
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: RelayUrlThe [RelayUrl] where this relay server can be dialed.
Fields§
§url: RelayUrlThe 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
impl Clone for RelayConfig
Source§fn clone(&self) -> RelayConfig
fn clone(&self) -> RelayConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RelayConfig
impl Debug for RelayConfig
Source§impl<'de> Deserialize<'de> for RelayConfig
impl<'de> Deserialize<'de> for RelayConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
- __D: Deserializer<'de>,
Source§impl Display for RelayConfig
impl Display for RelayConfig
Source§impl From<RelayConfig> for RelayMap
impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
fn from(value: RelayConfig) -> Self
Source§impl From<RelayUrl> for RelayConfig
impl From<RelayUrl> for RelayConfig
Source§impl FromIterator<RelayConfig> for RelayMap
impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Source§impl Ord for RelayConfig
impl Ord for RelayConfig
Source§impl Display for RelayConfig
impl Display for RelayConfig
Source§impl From<RelayConfig> for RelayMap
impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
fn from(value: RelayConfig) -> Self
Source§impl From<RelayUrl> for RelayConfig
impl From<RelayUrl> for RelayConfig
Source§impl FromIterator<RelayConfig> for RelayMap
impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Source§impl Ord for RelayConfig
impl Ord for RelayConfig
Source§fn cmp(&self, other: &RelayConfig) -> Ordering
fn cmp(&self, other: &RelayConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for RelayConfig
impl PartialEq for RelayConfig
Source§fn eq(&self, other: &RelayConfig) -> bool
fn eq(&self, other: &RelayConfig) -> bool
self and other values to be equal, and is used by ==.1.0.0 · Source§fn ne(&self, other: &Rhs) -> bool
fn ne(&self, other: &Rhs) -> bool
!=. 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
impl RelayMap
Sourcepub fn urls<T>(&self) -> Twhere
- T: FromIterator<RelayUrl>,
pub fn urls<T>(&self) -> Twhere
- 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>.
Sourcepub fn relays<T>(&self) -> T
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>.
Sourcepub fn contains(&self, url: &RelayUrl) -> bool
pub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
Sourcepub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
pub fn get(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Returns the config for a relay.
+Sourcepub fn contains(&self, url: &RelayUrl) -> bool
pub fn contains(&self, url: &RelayUrl) -> bool
Returns true if a relay with url is contained in this this relay map.
Sourcepub fn insert(
&self,
- url: RelayUrl,
+ url: RelayUrl,
endpoint: Arc<RelayConfig>,
) -> Option<Arc<RelayConfig>>
pub fn insert( &self, - url: RelayUrl, + url: RelayUrl, endpoint: Arc<RelayConfig>, ) -> Option<Arc<RelayConfig>>
Inserts a new relay into the relay map.
-Sourcepub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
pub fn remove(&self, url: &RelayUrl) -> Option<Arc<RelayConfig>>
Removes an existing relay by its URL.
+Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
fn from(value: RelayConfig) -> Self
Trait Implementations§
Source§impl From<RelayConfig> for RelayMap
impl From<RelayConfig> for RelayMap
Source§fn from(value: RelayConfig) -> Self
fn from(value: RelayConfig) -> Self
Source§impl FromIterator<Arc<RelayConfig>> for RelayMap
impl FromIterator<Arc<RelayConfig>> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = Arc<RelayConfig>>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Arc<RelayConfig>>>(iter: T) -> Self
Source§impl FromIterator<RelayConfig> for RelayMap
impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Source§impl FromIterator<RelayUrl> for RelayMap
impl FromIterator<RelayUrl> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self
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
impl FromIterator<Arc<RelayConfig>> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = Arc<RelayConfig>>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Arc<RelayConfig>>>(iter: T) -> Self
Source§impl FromIterator<RelayConfig> for RelayMap
impl FromIterator<RelayConfig> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = RelayConfig>>(iter: T) -> Self
Source§impl FromIterator<RelayUrl> for RelayMap
impl FromIterator<RelayUrl> for RelayMap
Source§fn from_iter<T: IntoIterator<Item = RelayUrl>>(iter: T) -> Self
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
impl PartialEq for RelayMap
Source§fn eq(&self, other: &Self) -> bool
fn eq(&self, other: &Self) -> bool
self and other values to be equal, and is used by ==.1.0.0 · Source§fn ne(&self, other: &Rhs) -> bool
fn ne(&self, other: &Rhs) -> bool
!=. 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}