pub struct RelayLatencies(/* private fields */);Expand description
Latencies per relay node.
-Implementations§
Source§impl RelayLatencies
impl RelayLatencies
Sourcepub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_
pub fn iter(&self) -> impl Iterator<Item = (&RelayUrl, Duration)> + '_
Returns an iterator over all the relays and their latencies.
+Implementations§
Trait Implementations§
Source§impl Clone for RelayLatencies
impl Clone for RelayLatencies
Source§fn clone(&self) -> RelayLatencies
fn clone(&self) -> RelayLatencies
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RelayLatencies
impl Debug for RelayLatencies
Source§impl Default for RelayLatencies
impl Default for RelayLatencies
Source§fn default() -> RelayLatencies
fn default() -> RelayLatencies
Source§impl PartialEq for RelayLatencies
impl PartialEq for RelayLatencies
impl Eq for RelayLatencies
impl StructuralPartialEq for RelayLatencies
Auto Trait Implementations§
impl Freeze for RelayLatencies
impl RefUnwindSafe for RelayLatencies
impl Send for RelayLatencies
impl Sync for RelayLatencies
impl Unpin for RelayLatencies
impl UnwindSafe for RelayLatencies
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
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: RelayLatencieskeyed by relay Url
§relay_v4_latency: RelayLatencieskeyed by relay Url
§relay_v6_latency: RelayLatencieskeyed 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 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
§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 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§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 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 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.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN 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.
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
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 pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
Creates a new RelayMap with a single relay server configured.
+Sourcepub 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.
-Sourcepub 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 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: RelayUrlThe RelayUrl where this relay server can be dialed.
+Fields§
§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/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
}
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
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: RelayLatencieskeyed by relay Url
§relay_v4_latency: RelayLatencieskeyed by relay Url
§relay_v6_latency: RelayLatencieskeyed 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 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
§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 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§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 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 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.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN 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.
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
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 pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
Creates a new RelayMap with a single relay server configured.
+Sourcepub 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.
-Sourcepub 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 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: RelayUrlThe RelayUrl where this relay server can be dialed.
+Fields§
§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/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
}
Whether the router supports communicating between two local devices through the NATted public IP address (on IPv4).
Probe indicating the presence of port mapping protocols on the LAN.
-None for unknown
None for unknown
keyed by relay Url
keyed by relay Url
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 @@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
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.
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
impl Debug for SendMessage
Source§impl Sink<SendMessage> for Client
impl Sink<SendMessage> for Client
Source§type Error = ConnSendError
type Error = ConnSendError
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 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 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.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN 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.
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
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 pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
Creates a new RelayMap with a single relay server configured.
+Sourcepub 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.
-Sourcepub 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 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: RelayUrlThe RelayUrl where this relay server can be dialed.
+Fields§
§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/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
}
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 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 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.
Sourcepub fn quic_addr(&self) -> Option<SocketAddr>
The socket address the QUIC server is listening on.
Sourcepub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN 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.
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
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 pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
Creates a new RelayMap with a single relay server configured.
+Sourcepub 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.
-Sourcepub 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 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: RelayUrlThe RelayUrl where this relay server can be dialed.
+Fields§
§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/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
}
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 protocol(self, protocol: Protocol) -> Self
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.
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 stun_addr(&self) -> Option<SocketAddr>
pub fn stun_addr(&self) -> Option<SocketAddr>
The socket address the STUN 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.
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
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 pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
Creates a new RelayMap with a single relay server configured.
+Sourcepub 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.
-Sourcepub 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 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: RelayUrlThe RelayUrl where this relay server can be dialed.
+Fields§
§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/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
}
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
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 pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
Implementations§
Source§impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
Creates a new RelayMap with a single relay server configured.
+Sourcepub 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.
-Sourcepub 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 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: RelayUrlThe RelayUrl where this relay server can be dialed.
+Fields§
§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/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
}
pub struct RelayMap { /* private fields */ }Expand description
Configuration of all the relay servers that can be used.
-Implementations§
Source§impl RelayMap
impl RelayMap
Implementations§
Source§impl RelayMap
impl RelayMap
Sourcepub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
-Sourcepub fn contains_node(&self, url: &RelayUrl) -> bool
pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
pub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
Creates a new RelayMap with a single relay server configured.
Sourcepub fn default_from_node(url: RelayUrl, stun_port: u16) -> Self
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.
Sourcepub fn from_url(url: RelayUrl) -> Self
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 @@
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: RelayUrlThe RelayUrl where this relay server can be dialed.
Fields§
§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/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
}