From db95398fd9d36ea3bc82f600e5251a6bdc51dcce Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 3 Jan 2025 12:18:18 +0000 Subject: [PATCH] deploy: deac578fc4a5338650b06558b6679bf7ef1f632c --- .../iroh_net_report/struct.RelayLatencies.html | 2 +- .../docs/iroh_net_report/struct.Report.html | 4 ++-- .../client/enum.ReceivedMessage.html | 8 ++++---- .../iroh_relay/client/enum.SendMessage.html | 4 ++-- .../client/struct.ClientBuilder.html | 4 ++-- .../docs/iroh_relay/server/struct.Server.html | 4 ++-- pr/3093/docs/iroh_relay/struct.RelayMap.html | 10 +++++----- pr/3093/docs/iroh_relay/struct.RelayNode.html | 4 ++-- .../src/iroh/magicsock/relay_actor.rs.html | 18 +++++++++++++++++- 9 files changed, 37 insertions(+), 21 deletions(-) diff --git a/pr/3093/docs/iroh_net_report/struct.RelayLatencies.html b/pr/3093/docs/iroh_net_report/struct.RelayLatencies.html index 010850c89d..17bdf83c57 100644 --- a/pr/3093/docs/iroh_net_report/struct.RelayLatencies.html +++ b/pr/3093/docs/iroh_net_report/struct.RelayLatencies.html @@ -1,5 +1,5 @@ RelayLatencies in iroh_net_report - Rust
iroh_net_report

Struct RelayLatencies

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

Latencies per relay node.

-

Implementations§

Source§

impl RelayLatencies

Source

pub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_

Returns an iterator over all the relays and their latencies.

+

Implementations§

Source§

impl RelayLatencies

Source

pub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_

Returns an iterator over all the relays and their latencies.

Trait Implementations§

Source§

impl Clone for RelayLatencies

Source§

fn clone(&self) -> RelayLatencies

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RelayLatencies

Source§

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

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

impl Default for RelayLatencies

Source§

fn default() -> RelayLatencies

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

impl PartialEq for RelayLatencies

Source§

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

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

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

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

impl Eq for RelayLatencies

Source§

impl StructuralPartialEq for RelayLatencies

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/pr/3093/docs/iroh_net_report/struct.Report.html b/pr/3093/docs/iroh_net_report/struct.Report.html index 1a2175c6da..dffd956afd 100644 --- a/pr/3093/docs/iroh_net_report/struct.Report.html +++ b/pr/3093/docs/iroh_net_report/struct.Report.html @@ -11,7 +11,7 @@ pub mapping_varies_by_dest_ipv6: Option<bool>, pub hair_pinning: Option<bool>, pub portmap_probe: Option<ProbeOutput>, - pub preferred_relay: Option<RelayUrl>, + pub preferred_relay: Option<RelayUrl>, pub relay_latency: RelayLatencies, pub relay_v4_latency: RelayLatencies, pub relay_v6_latency: RelayLatencies, @@ -35,7 +35,7 @@ detecting rather than using it. For now.

§hair_pinning: Option<bool>

Whether the router supports communicating between two local devices through the NATted public IP address (on IPv4).

§portmap_probe: Option<ProbeOutput>

Probe indicating the presence of port mapping protocols on the LAN.

-
§preferred_relay: Option<RelayUrl>

None for unknown

+
§preferred_relay: Option<RelayUrl>

None for unknown

§relay_latency: RelayLatencies

keyed by relay Url

§relay_v4_latency: RelayLatencies

keyed by relay Url

§relay_v6_latency: RelayLatencies

keyed by relay Url

diff --git a/pr/3093/docs/iroh_relay/client/enum.ReceivedMessage.html b/pr/3093/docs/iroh_relay/client/enum.ReceivedMessage.html index e916c781a4..196743d3c9 100644 --- a/pr/3093/docs/iroh_relay/client/enum.ReceivedMessage.html +++ b/pr/3093/docs/iroh_relay/client/enum.ReceivedMessage.html @@ -1,9 +1,9 @@ ReceivedMessage in iroh_relay::client - Rust
iroh_relay::client

Enum ReceivedMessage

Source
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 @@
 }
Expand description

The messages received from a framed relay stream.

This is a type-validated version of the Frames on the RelayCodec.

Variants§

§

ReceivedPacket

Represents an incoming packet.

-

Fields

§remote_node_id: NodeId

The NodeId of the packet sender.

+

Fields

§remote_node_id: NodeId

The [NodeId] of the packet sender.

§data: Bytes

The received packet bytes.

-
§

NodeGone(NodeId)

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

§

NodeGone(NodeId)

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

§

Ping([u8; 8])

Request from a client or server to reply to the other side with a ReceivedMessage::Pong with the given payload.

diff --git a/pr/3093/docs/iroh_relay/client/enum.SendMessage.html b/pr/3093/docs/iroh_relay/client/enum.SendMessage.html index 4a227894e8..7e43b4d825 100644 --- a/pr/3093/docs/iroh_relay/client/enum.SendMessage.html +++ b/pr/3093/docs/iroh_relay/client/enum.SendMessage.html @@ -1,9 +1,9 @@ SendMessage in iroh_relay::client - Rust
iroh_relay::client

Enum SendMessage

Source
pub enum SendMessage {
-    SendPacket(NodeId, Bytes),
+    SendPacket(NodeId, Bytes),
     Ping([u8; 8]),
     Pong([u8; 8]),
 }
Expand description

Messages we can send to a relay server.

-

Variants§

§

SendPacket(NodeId, Bytes)

Send a packet of data to the NodeId.

+

Variants§

§

SendPacket(NodeId, Bytes)

Send a packet of data to the [NodeId].

§

Ping([u8; 8])

Sends a ping message to the connected relay server.

§

Pong([u8; 8])

Sends a pong message to the connected relay server.

Trait Implementations§

Source§

impl Debug for SendMessage

Source§

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

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

impl Sink<SendMessage> for Client

Source§

type Error = ConnSendError

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

fn poll_ready( diff --git a/pr/3093/docs/iroh_relay/client/struct.ClientBuilder.html b/pr/3093/docs/iroh_relay/client/struct.ClientBuilder.html index eff40160fc..98e615a1e1 100644 --- a/pr/3093/docs/iroh_relay/client/struct.ClientBuilder.html +++ b/pr/3093/docs/iroh_relay/client/struct.ClientBuilder.html @@ -1,7 +1,7 @@ ClientBuilder in iroh_relay::client - Rust
iroh_relay::client

Struct ClientBuilder

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

Build a Client.

Implementations§

Source§

impl ClientBuilder

Source

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

Create a new ClientBuilder

Source

pub fn protocol(self, protocol: Protocol) -> Self

Sets whether to connect to the relay via websockets or not. diff --git a/pr/3093/docs/iroh_relay/server/struct.Server.html b/pr/3093/docs/iroh_relay/server/struct.Server.html index cac179ba5d..f8ea38e000 100644 --- a/pr/3093/docs/iroh_relay/server/struct.Server.html +++ b/pr/3093/docs/iroh_relay/server/struct.Server.html @@ -14,9 +14,9 @@ case there is an error in the server before it is shut down.

Source

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

The socket address the QUIC server is listening on.

Source

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

The socket address the STUN server is listening on.

Source

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

The certificates chain if configured with manual TLS certificates.

-
Source

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

Available on crate feature test-utils only.

Get the server’s https RelayUrl.

+
Source

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

Available on crate feature test-utils only.

Get the server’s https [RelayUrl].

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

-
Source

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

Available on crate feature test-utils only.

Get the server’s http RelayUrl.

+
Source

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

Available on crate feature test-utils only.

Get the server’s http [RelayUrl].

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

Trait Implementations§

Source§

impl Debug for Server

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Server

§

impl RefUnwindSafe for Server

§

impl Send for Server

§

impl Sync for Server

§

impl Unpin for Server

§

impl UnwindSafe for Server

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/pr/3093/docs/iroh_relay/struct.RelayMap.html b/pr/3093/docs/iroh_relay/struct.RelayMap.html index 2f8d052e51..f69c9124c5 100644 --- a/pr/3093/docs/iroh_relay/struct.RelayMap.html +++ b/pr/3093/docs/iroh_relay/struct.RelayMap.html @@ -1,16 +1,16 @@ RelayMap in iroh_relay - Rust
iroh_relay

Struct RelayMap

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

Configuration of all the relay servers that can be used.

-

Implementations§

Source§

impl RelayMap

Source

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

Returns the sorted relay URLs.

+

Implementations§

Source§

impl RelayMap

Source

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

Returns the sorted relay URLs.

Source

pub fn empty() -> Self

Create an empty relay map.

Source

pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>

Returns an Iterator over all known nodes.

-
Source

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

Is this a known node?

-
Source

pub fn get_node(&self, url: &RelayUrl) -> Option<&Arc<RelayNode>>

Get the given node.

+
Source

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

Is this a known node?

+
Source

pub fn get_node(&self, url: &RelayUrl) -> Option<&Arc<RelayNode>>

Get the given node.

Source

pub fn len(&self) -> usize

How many nodes are known?

Source

pub fn is_empty(&self) -> bool

Are there any nodes in this map?

-
Source

pub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self

Creates a new RelayMap with a single relay server configured.

+
Source

pub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self

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.

-
Source

pub fn from_url(url: RelayUrl) -> Self

Returns a RelayMap from a RelayUrl.

+
Source

pub fn from_url(url: RelayUrl) -> Self

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/3093/docs/iroh_relay/struct.RelayNode.html b/pr/3093/docs/iroh_relay/struct.RelayNode.html index ebdf471da6..5a4af90c83 100644 --- a/pr/3093/docs/iroh_relay/struct.RelayNode.html +++ b/pr/3093/docs/iroh_relay/struct.RelayNode.html @@ -1,11 +1,11 @@ RelayNode in iroh_relay - Rust

iroh_relay

Struct RelayNode

Source
pub struct RelayNode {
-    pub url: RelayUrl,
+    pub url: RelayUrl,
     pub stun_only: bool,
     pub stun_port: u16,
     pub quic: Option<RelayQuicConfig>,
 }
Expand description

Information on a specific relay server.

Includes the Url where it can be dialed.

-

Fields§

§url: RelayUrl

The RelayUrl where this relay server can be dialed.

+

Fields§

§url: RelayUrl

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

§stun_only: bool

Whether 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/3093/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3093/docs/src/iroh/magicsock/relay_actor.rs.html index a9876f56af..c0e17180a3 100644 --- a/pr/3093/docs/src/iroh/magicsock/relay_actor.rs.html +++ b/pr/3093/docs/src/iroh/magicsock/relay_actor.rs.html @@ -1529,7 +1529,15 @@ 1528 1529 1530 -1531
//! The relay actor.
+1531
+1532
+1533
+1534
+1535
+1536
+1537
+1538
+1539
//! The relay actor.
 //!
 //! The [`RelayActor`] handles all the relay connections.  It is helped by the
 //! [`ActiveRelayActor`] which handles a single relay connection.
@@ -2404,6 +2412,14 @@
             Some(e) => e.clone(),
             None => {
                 let handle = self.start_active_relay(url.clone());
+                if Some(&url) == self.msock.my_relay().as_ref() {
+                    if let Err(err) = handle
+                        .inbox_addr
+                        .try_send(ActiveRelayMessage::SetHomeRelay(true))
+                    {
+                        error!("Home relay not set, send to new actor failed: {err:#}.");
+                    }
+                }
                 self.active_relays.insert(url, handle.clone());
                 handle
             }