pub async fn client(
- server_addr: NodeAddr,
- relay_url: Option<RelayUrl>,
+ server_addr: NodeAddr,
+ relay_url: Option<RelayUrl>,
opt: Opt,
) -> Result<ClientStats>Expand description
Create and run a client
diff --git a/pr/3254/docs/iroh_bench/iroh/fn.client.html b/pr/3254/docs/iroh_bench/iroh/fn.client.html index 8b8b396e77..ac27c69ccc 100644 --- a/pr/3254/docs/iroh_bench/iroh/fn.client.html +++ b/pr/3254/docs/iroh_bench/iroh/fn.client.html @@ -1,6 +1,6 @@
pub fn server_endpoint(
rt: &Runtime,
- relay_url: &Option<RelayUrl>,
+ relay_url: &Option<RelayUrl>,
opt: &Opt,
-) -> (NodeAddr, Endpoint)Creates a server endpoint which runs on the given runtime
+) -> (NodeAddr, Endpoint)Creates a server endpoint which runs on the given runtime
pub enum ReceivedMessage {
ReceivedPacket {
- remote_node_id: NodeId,
+ remote_node_id: NodeId,
data: Bytes,
},
- NodeGone(NodeId),
+ NodeGone(NodeId),
Ping([u8; 8]),
Pong([u8; 8]),
KeepAlive,
@@ -17,9 +17,9 @@
}The messages received from a framed relay stream.
This is a type-validated version of the Frames on the RelayCodec.
Represents an incoming packet.
-Indicates that the client identified by the underlying public key had previously sent you a packet but has now disconnected from the server.
Request from a client or server to reply to the
other side with a ReceivedMessage::Pong with the given payload.
pub enum SendMessage {
- SendPacket(NodeId, Bytes),
+ SendPacket(NodeId, Bytes),
Ping([u8; 8]),
Pong([u8; 8]),
}Messages we can send to a relay server.
-Send a packet of data to the [NodeId].
Send a packet of data to the NodeId.
Sends a ping message to the connected relay server.
Sends a pong message to the connected relay server.
pub struct ClientBuilder { /* private fields */ }Build a Client.
Create a new ClientBuilder
Sets whether to connect to the relay via websockets or not.
diff --git a/pr/3254/docs/iroh_relay/dns/struct.DnsResolver.html b/pr/3254/docs/iroh_relay/dns/struct.DnsResolver.html
index 7270973c6a..d2139dabc0 100644
--- a/pr/3254/docs/iroh_relay/dns/struct.DnsResolver.html
+++ b/pr/3254/docs/iroh_relay/dns/struct.DnsResolver.html
@@ -67,9 +67,9 @@ at T+0ms, T+200ms and T+300ms. The timeout is applied as stated in
summary of all errors otherwise.
Looks up node info by [NodeId] and origin domain name.
Looks up node info by NodeId and origin domain name.
To lookup nodes that published their node info to the DNS servers run by n0,
pass N0_DNS_NODE_ORIGIN_PROD as origin.
Looks up node info by DNS name.
@@ -84,10 +84,10 @@ at T+0ms, T+200ms and T+300ms. The result of the first successful call is return summary of all errors otherwise.Looks up node info by [NodeId] and origin domain name.
Looks up node info by NodeId 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/3254/docs/iroh_relay/index.html b/pr/3254/docs/iroh_relay/index.html
index 2d0820c0a5..a2df5b13e3 100644
--- a/pr/3254/docs/iroh_relay/index.html
+++ b/pr/3254/docs/iroh_relay/index.html
@@ -25,6 +25,6 @@ Tailscale.
pub use protos::relay::MAX_PACKET_SIZE;Client, which allows to establish connections to a relay server.wasm_browserNodeId].pub use protos::relay::MAX_PACKET_SIZE;Client, which allows to establish connections to a relay server.wasm_browserNodeId.serverSupport for handling DNS resource records for dialing by [NodeId].
Dialing by [NodeId] is supported by iroh nodes publishing Pkarr records to DNS
+
Support for handling DNS resource records for dialing by NodeId.
Dialing by NodeId is supported by iroh nodes 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-node-id>.<origin-domain> TXT
_iroh is the record name as defined by IROH_TXT_NAME.
<z32-node-id> is the z-base-32 encoding of the [NodeId].
<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:
UserData.UserData::MAX_LENGTH bytes.NodeId] to encode to and decode from [z32],
+UserData.UserData::MAX_LENGTH bytes.NodeId to encode to and decode from [z32],
which is the encoding used in [pkarr] domain names.pub struct NodeData { /* private fields */ }Data about a node 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 node’s [NodeId], only the data about a certain
-node. See NodeInfo for a struct that contains a [NodeId] with associated NodeData.
This struct does not include the node’s NodeId, only the data about a certain
+node. See NodeInfo for a struct that contains a NodeId with associated NodeData.
Creates a new NodeData with a relay URL and a set of direct addresses.
Sets the relay URL and returns the updated node data.
+Sets the relay URL and returns the updated node data.
Sets the direct addresses and returns the updated node data.
Sets the user-defined data and returns the updated node data.
-Returns the optional user-defined data of the node.
Returns the direct addresses of the node.
Removes all direct addresses from the node data.
@@ -22,9 +22,9 @@ node. See IntoIterator<Item = SocketAddr>, )Adds direct addresses to the node data.
-Sets the relay URL of the node data.
+Sets the relay URL of the node data.
Sets the user-defined data of the node data.
-pub struct NodeInfo {
- pub node_id: NodeId,
+ pub node_id: NodeId,
pub data: NodeData,
}Information about a node that may be published to and resolved from discovery services.
-This struct couples a [NodeId] with its associated NodeData.
node_id: NodeIdThe [NodeId] of the node this is about.
node_id: NodeIdThe NodeId of the node this is about.
data: NodeDataThe information published about the node.
-Creates a new NodeInfo from its parts.
Sets the relay URL and returns the updated node info.
+Creates a new NodeInfo from its parts.
Sets the relay URL and returns the updated node info.
Sets the direct addresses and returns the updated node info.
Sets the user-defined data and returns the updated node info.
-Converts into a [NodeAddr] by cloning the needed fields.
Converts into a [NodeAddr] without cloning.
Converts into a NodeAddr by cloning the needed fields.
Converts into a NodeAddr without cloning.
wasm_browser only.Parses a NodeInfo from a TXT records lookup.
Parses a NodeInfo from a [pkarr::SignedPacket].
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.
Converts into a list of {key}={value} strings.
Returns the optional user-defined data of the node.
Returns the direct addresses of the node.
Removes all direct addresses from the node data.
@@ -32,9 +32,9 @@ &mut self, addrs: impl IntoIterator<Item = SocketAddr>, )Adds direct addresses to the node data.
-Sets the relay URL of the node data.
+Sets the relay URL of the node data.
Sets the user-defined data of the node data.
-pub trait NodeIdExt {
// Required methods
fn to_z32(&self) -> String;
- fn from_z32(s: &str) -> Result<NodeId>;
-}Extension methods for [ Extension methods for NodeId] to encode to and decode from [z32],
+ fn from_z32(s: &str) -> Result<NodeId>;
+}Expand description
NodeId to encode to and decode from [z32],
which is the encoding used in [pkarr] domain names.
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
pub enum AccessConfig {
Everyone,
- Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>),
+ Restricted(Box<dyn Fn(NodeId) -> Boxed<Access> + Send + Sync + 'static>),
}server only.Controls which nodes are allowed to use the relay.
Everyone
-Only nodes for which the function returns Access::Allow.
Is this node allowed?
The socket address the QUIC server is listening on.
The socket address the STUN server is listening on.
The certificates chain if configured with manual TLS certificates.
-test-utils only.Get the server’s https [RelayUrl].
test-utils only.Get the server’s https RelayUrl.
This uses Self::https_addr so it’s mostly useful for local development.
pub struct RelayMap { /* private fields */ }Configuration of all the relay servers that can be used.
-Returns an Iterator over all known nodes.
Is this a known node?
-Is this a known node?
+Creates a new RelayMap with a single relay server configured.
Creates a new RelayMap with a single relay server configured.
Allows to set a custom STUN port and different IP addresses for IPv4 and IPv6. If IP addresses are provided, no DNS lookup will be performed.
Sets the port to the default DEFAULT_RELAY_QUIC_PORT.
Returns a RelayMap from a RelayUrl.
This will use the default STUN port, the default QUIC port
(as defined by the iroh-relay crate) and IP addresses
resolved from the URL’s host name via DNS.
diff --git a/pr/3254/docs/iroh_relay/struct.RelayNode.html b/pr/3254/docs/iroh_relay/struct.RelayNode.html
index ea4bac1ff5..3c32544d4f 100644
--- a/pr/3254/docs/iroh_relay/struct.RelayNode.html
+++ b/pr/3254/docs/iroh_relay/struct.RelayNode.html
@@ -1,11 +1,11 @@
pub struct RelayNode {
- pub url: RelayUrl,
+ pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
pub quic: Option<RelayQuicConfig>,
}Information on a specific relay server.
Includes the Url where it can be dialed.
-url: RelayUrlThe [RelayUrl] where this relay server can be dialed.
url: RelayUrlThe RelayUrl where this relay server can be dialed.
stun_only: boolWhether this relay server should only be used for STUN requests.
This essentially allows you to use a normal STUN server as a relay node, no relay functionality is used.
diff --git a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html index 16de2a031a..78dfe7eea7 100644 --- a/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html +++ b/pr/3254/docs/src/iroh/magicsock/relay_actor.rs.html @@ -2211,7 +2211,7 @@ state.ping_tracker.pong_received(data) } ReceivedMessage::Health { problem } => { - let problem = problem.as_deref().unwrap_or_else(|| "unknown"); + let problem = problem.as_deref().unwrap_or("unknown"); warn!("Relay server reports problem: {problem}"); } ReceivedMessage::KeepAlive | ReceivedMessage::ServerRestarting { .. } => { diff --git a/pr/3254/docs/trait.impl/core/convert/trait.From.js b/pr/3254/docs/trait.impl/core/convert/trait.From.js index 4845173837..a9d798ac36 100644 --- a/pr/3254/docs/trait.impl/core/convert/trait.From.js +++ b/pr/3254/docs/trait.impl/core/convert/trait.From.js @@ -1,9 +1,9 @@ (function() { - var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryItem> for NodeInfo"],["impl From<RemoteInfo> for NodeAddr"],["impl<T> From<T> for ConcurrentDiscovery"]]],["iroh_base",[["impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr"],["impl From<ParseError> for RelayUrlParseError"],["impl From<Url> for RelayUrl"],["impl From<NodeAddr> for NodeTicket"],["impl From<PublicKey> for NodeAddr"],["impl From<RelayUrl> for Url"],["impl From<NodeTicket> for NodeAddr"],["impl From<DecodeError> for KeyParsingError"],["impl From<DecodeError> for Error"],["impl From<Error> for KeyParsingError"],["impl From<Error> for Error"],["impl From<SigningKey> for SecretKey"],["impl From<VerifyingKey> for PublicKey"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<Error> for ConnSendError"],["impl From<NodeInfo> for NodeAddr"],["impl From<Error> for ConnSendError"],["impl From<NodeAddr> for NodeData"],["impl From<NodeAddr> for NodeInfo"],["impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver"],["impl From<TxtLookup> for TxtLookup"]]]]); + var implementors = Object.fromEntries([["iroh",[["impl From<DiscoveryItem> for NodeInfo"],["impl From<RemoteInfo> for NodeAddr"],["impl<T> From<T> for ConcurrentDiscovery"]]],["iroh_base",[["impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr"],["impl From<ParseError> for RelayUrlParseError"],["impl From<Url> for RelayUrl"],["impl From<NodeAddr> for NodeTicket"],["impl From<PublicKey> for NodeAddr"],["impl From<RelayUrl> for Url"],["impl From<NodeTicket> for NodeAddr"],["impl From<DecodeError> for KeyParsingError"],["impl From<DecodeError> for Error"],["impl From<Error> for KeyParsingError"],["impl From<Error> for Error"],["impl From<SigningKey> for SecretKey"],["impl From<VerifyingKey> for PublicKey"],["impl From<[u8; 32]> for SecretKey"]]],["iroh_relay",[["impl From<Error> for ConnSendError"],["impl From<NodeAddr> for NodeData"],["impl From<NodeAddr> for NodeInfo"],["impl From<NodeInfo> for NodeAddr"],["impl From<Error> for ConnSendError"],["impl From<Resolver<GenericConnector<TokioRuntimeProvider>>> for DnsResolver"],["impl From<TxtLookup> for TxtLookup"]]]]); if (window.register_implementors) { window.register_implementors(implementors); } else { window.pending_implementors = implementors; } })() -//{"start":57,"fragment_lengths":[1632,5343,2281]} \ No newline at end of file +//{"start":57,"fragment_lengths":[1632,5343,2647]} \ No newline at end of file