pub const DEFAULT_RELAY_QUIC_PORT: u16 = 7842; // 7_842u16Expand description
The default QUIC port used by the Relay server to accept QUIC connections +
Constant DEFAULT_RELAY_QUIC_PORT
pub const DEFAULT_RELAY_QUIC_PORT: u16 = 7842; // 7_842u16Expand description
The default QUIC port used by the Relay server to accept QUIC connections for QUIC address discovery
The port is “QUIC” typed on a phone keypad. The default QUIC port used by the Relay server to accept QUIC connections diff --git a/pr/3069/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html b/pr/3069/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html index 27042a1b0b..35b76bab1d 100644 --- a/pr/3069/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html +++ b/pr/3069/docs/iroh/defaults/constant.DEFAULT_STUN_PORT.html @@ -1,4 +1,4 @@ -
pub const DEFAULT_STUN_PORT: u16 = 3478; // 3_478u16Expand description
The default STUN port used by the Relay server.
+Constant DEFAULT_STUN_PORT
pub const DEFAULT_STUN_PORT: u16 = 3478; // 3_478u16Expand description
The default STUN port used by the Relay server.
The STUN port as defined by RFC 8489 The default STUN port used by the Relay server.
diff --git a/pr/3069/docs/iroh/metrics/struct.RelayMetrics.html b/pr/3069/docs/iroh/metrics/struct.RelayMetrics.html index f181b97fbc..59bc34d596 100644 --- a/pr/3069/docs/iroh/metrics/struct.RelayMetrics.html +++ b/pr/3069/docs/iroh/metrics/struct.RelayMetrics.html @@ -1,4 +1,4 @@ -pub struct RelayMetrics {Show 21 fields
+RelayMetrics in iroh::metrics - Rust Struct RelayMetrics
pub struct RelayMetrics {Show 21 fields
pub bytes_sent: Counter,
pub bytes_recv: Counter,
pub send_packets_sent: Counter,
@@ -42,7 +42,7 @@
§unique_client_keys: CounterNumber of unique client keys per day
§websocket_accepts: CounterNumber of accepted websocket connections
§relay_accepts: CounterNumber of accepted ‘iroh derp http’ connection upgrades
-Trait Implementations§
Source§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
+Trait Implementations§
§impl Metric for Metrics
§fn new(registry: &mut Registry) -> Self
Available on crate feature metrics only.Initializes this metric group.§fn with_metric<T, F>(f: F)where
F: FnOnce(&Self) -> T,
Available on crate feature metrics only.Access to this metrics group to record a metric.
Only records if this metric is registered in the global registry.Auto Trait Implementations§
§impl Freeze for Metrics
§impl RefUnwindSafe for Metrics
§impl Send for Metrics
§impl Sync for Metrics
§impl Unpin for Metrics
§impl UnwindSafe for Metrics
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
diff --git a/pr/3069/docs/iroh/struct.RelayMap.html b/pr/3069/docs/iroh/struct.RelayMap.html
index 6455a2a69f..db261a0740 100644
--- a/pr/3069/docs/iroh/struct.RelayMap.html
+++ b/pr/3069/docs/iroh/struct.RelayMap.html
@@ -1,26 +1,26 @@
-RelayMap in iroh - Rust pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
-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 default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
Creates a new RelayMap with a single relay server configured.
+RelayMap in iroh - Rust Struct RelayMap
pub struct RelayMap { /* private fields */ }
Expand description
Configuration of all the relay servers that can be used.
+Implementations§
§impl RelayMap
pub fn nodes(&self) -> impl Iterator<Item = &Arc<RelayNode>>
Returns an Iterator over all known nodes.
+pub fn contains_node(&self, url: &RelayUrl) -> bool
Is this a known node?
+pub fn default_from_node(url: RelayUrl, stun_port: u16) -> RelayMap
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_nodes<I>(
+
pub fn from_nodes<I>(
value: impl IntoIterator<Item = I>,
) -> Result<RelayMap, Error>
Trait Implementations§
Source§impl Eq for RelayMap
Source§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
Blanket Implementations§
Trait Implementations§
§impl Eq for RelayMap
§impl StructuralPartialEq for RelayMap
Auto Trait Implementations§
§impl Freeze for RelayMap
§impl RefUnwindSafe for RelayMap
§impl Send for RelayMap
§impl Sync for RelayMap
§impl Unpin for RelayMap
§impl UnwindSafe for RelayMap
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/3069/docs/iroh/struct.RelayNode.html b/pr/3069/docs/iroh/struct.RelayNode.html
index 7da0ec16ae..1ddae9195e 100644
--- a/pr/3069/docs/iroh/struct.RelayNode.html
+++ b/pr/3069/docs/iroh/struct.RelayNode.html
@@ -1,8 +1,8 @@
-RelayNode in iroh - Rust pub struct RelayNode {
+RelayNode in iroh - Rust Struct RelayNode
pub struct RelayNode {
pub url: RelayUrl,
pub stun_only: bool,
pub stun_port: u16,
- pub quic: Option<RelayQuicConfig>,
+ 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.
@@ -11,24 +11,24 @@
functionality is used.
§stun_port: u16The stun port of the relay server.
Setting this to 0 means the default STUN port is used.
-§quic: Option<RelayQuicConfig>Configuration to speak to the QUIC endpoint on the relay server.
+§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<'de> Deserialize<'de> for RelayNode
Source§fn deserialize<__D>(
+
Trait Implementations§
§impl<'de> Deserialize<'de> for RelayNode
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RelayNode, <__D as Deserializer<'de>>::Error>where
- __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more§impl Ord for RelayNode
Source§impl PartialOrd for RelayNode
§impl Serialize for RelayNode
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
- __S: Serializer,
Serialize this value into the given Serde serializer. Read moreSource§impl Eq for RelayNode
Source§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
Blanket Implementations§
Source§impl<T> Any for Twhere
+ __S: Serializer,
Serialize this value into the given Serde serializer. Read more§impl Eq for RelayNode
§impl StructuralPartialEq for RelayNode
Auto Trait Implementations§
§impl Freeze for RelayNode
§impl RefUnwindSafe for RelayNode
§impl Send for RelayNode
§impl Sync for RelayNode
§impl Unpin for RelayNode
§impl UnwindSafe for RelayNode
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/3069/docs/iroh/test_utils/fn.run_relay_server.html b/pr/3069/docs/iroh/test_utils/fn.run_relay_server.html
index befdb59842..4ebdc2a805 100644
--- a/pr/3069/docs/iroh/test_utils/fn.run_relay_server.html
+++ b/pr/3069/docs/iroh/test_utils/fn.run_relay_server.html
@@ -1,4 +1,4 @@
-run_relay_server in iroh::test_utils - Rust pub async fn run_relay_server() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN and QUIC enabled suitable for tests.
+run_relay_server in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3069/docs/iroh/test_utils/fn.run_relay_server_with.html b/pr/3069/docs/iroh/test_utils/fn.run_relay_server_with.html
index a73916f65e..ba6f84cdfd 100644
--- a/pr/3069/docs/iroh/test_utils/fn.run_relay_server_with.html
+++ b/pr/3069/docs/iroh/test_utils/fn.run_relay_server_with.html
@@ -1,9 +1,9 @@
run_relay_server_with in iroh::test_utils - Rust pub async fn run_relay_server_with(
- stun: Option<StunConfig>,
+ stun: Option<StunConfig>,
quic: bool,
-) -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server.
+) -> Result<(RelayMap, RelayUrl, Server)>Available on crate feature test-utils only.Expand description
Runs a relay server.
stun can be set to None to disable stun, or set to Some StunConfig,
to enable stun on a specific socket.
-If quic is set to true, it will make the appropriate QuicConfig from the generated tls certificates and run the quic server at a random free port.
+If quic is set to true, it will make the appropriate [QuicConfig] from the generated tls certificates and run the quic server at a random free port.
The return value is similar to run_relay_server.
\ No newline at end of file
diff --git a/pr/3069/docs/iroh/test_utils/fn.run_relay_server_with_stun.html b/pr/3069/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
index bdff0055f8..974d3f306b 100644
--- a/pr/3069/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
+++ b/pr/3069/docs/iroh/test_utils/fn.run_relay_server_with_stun.html
@@ -1,4 +1,4 @@
-run_relay_server_with_stun in iroh::test_utils - Rust pub async fn run_relay_server_with_stun() -> Result<(RelayMap, RelayUrl, Server)>
Available on crate feature test-utils only.Expand description
Runs a relay server with STUN enabled suitable for tests.
+run_relay_server_with_stun in iroh::test_utils - Rust
\ No newline at end of file
diff --git a/pr/3069/docs/iroh_relay/client/enum.ReceivedMessage.html b/pr/3069/docs/iroh_relay/client/enum.ReceivedMessage.html
index 400028a952..2777fc2aba 100644
--- a/pr/3069/docs/iroh_relay/client/enum.ReceivedMessage.html
+++ b/pr/3069/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/3069/docs/iroh_relay/client/struct.Client.html b/pr/3069/docs/iroh_relay/client/struct.Client.html
index 33eed831b5..6a41e97406 100644
--- a/pr/3069/docs/iroh_relay/client/struct.Client.html
+++ b/pr/3069/docs/iroh_relay/client/struct.Client.html
@@ -15,7 +15,7 @@ or the Sourcepub fn finish_ping(&mut self, ping: [u8; 8])
Finish a ping message
Sourcepub async fn send(
&mut self,
- remote_node: NodeId,
+ remote_node: NodeId,
payload: Bytes,
) -> Result<(), ClientError>
Send a packet to the server.
If there is no underlying active relay connection, it creates one before attempting to
diff --git a/pr/3069/docs/iroh_relay/client/struct.ClientBuilder.html b/pr/3069/docs/iroh_relay/client/struct.ClientBuilder.html
index 64aeee12e9..2c74a6c299 100644
--- a/pr/3069/docs/iroh_relay/client/struct.ClientBuilder.html
+++ b/pr/3069/docs/iroh_relay/client/struct.ClientBuilder.html
@@ -1,6 +1,6 @@
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>) -> Self
Create a new ClientBuilder
-Sourcepub fn server_url(self, url: impl Into<RelayUrl>) -> Self
Sets the server url
+Implementations§
Source§impl ClientBuilder
Sourcepub fn new(url: impl Into<RelayUrl>) -> Self
Create a new ClientBuilder
+Sourcepub fn server_url(self, url: impl Into<RelayUrl>) -> Self
Sets the server url
Sourcepub fn protocol(self, protocol: Protocol) -> Self
Sets whether to connect to the relay via websockets or not.
Set to use non-websocket, normal relaying by default.
Sourcepub fn address_family_selector<S>(self, selector: S) -> Selfwhere
@@ -15,8 +15,8 @@ work anyway, so we don’t artificially delay the connection speed.
May only be used in tests.
Sourcepub fn proxy_url(self, url: Url) -> Self
Set an explicit proxy url to proxy all HTTP(S) traffic through.
Sourcepub fn key_cache_capacity(self, capacity: usize) -> Self
Set the capacity of the cache for public keys.
-Sourcepub fn server_public_key(self, server_public_key: PublicKey) -> Self
The expected [PublicKey] of the relay server we are connecting to.
+Sourcepub fn server_public_key(self, server_public_key: PublicKey) -> Self
The expected PublicKey of the relay server we are connecting to.
Trait Implementations§
Auto Trait Implementations§
§impl Freeze for ClientBuilder
§impl !RefUnwindSafe for ClientBuilder
§impl Send for ClientBuilder
§impl Sync for ClientBuilder
§impl Unpin for ClientBuilder
§impl !UnwindSafe for ClientBuilder
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/3069/docs/iroh_relay/server/struct.Server.html b/pr/3069/docs/iroh_relay/server/struct.Server.html
index 0c86c3e45e..bb6c505b3d 100644
--- a/pr/3069/docs/iroh_relay/server/struct.Server.html
+++ b/pr/3069/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.
-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/3069/docs/iroh_relay/struct.RelayMap.html b/pr/3069/docs/iroh_relay/struct.RelayMap.html
index f69c9124c5..2f8d052e51 100644
--- a/pr/3069/docs/iroh_relay/struct.RelayMap.html
+++ b/pr/3069/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/3069/docs/iroh_relay/struct.RelayNode.html b/pr/3069/docs/iroh_relay/struct.RelayNode.html
index 5a4af90c83..ebdf471da6 100644
--- a/pr/3069/docs/iroh_relay/struct.RelayNode.html
+++ b/pr/3069/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/3069/docs/src/iroh/magicsock/relay_actor.rs.html b/pr/3069/docs/src/iroh/magicsock/relay_actor.rs.html
index 0bac624f2e..f2e31f0ff4 100644
--- a/pr/3069/docs/src/iroh/magicsock/relay_actor.rs.html
+++ b/pr/3069/docs/src/iroh/magicsock/relay_actor.rs.html
@@ -1390,9 +1390,9 @@
}
ActiveRelayMessage::CheckConnection(local_ips) => {
if let Some(fut) = self.handle_check_connection(local_ips).await {
- if ping_future.is_none() {
- ping_future.as_mut().set_future(fut);
- }
+ // We always override the future, to make sure the latest connection
+ // details are used.
+ ping_future.as_mut().set_future(fut);
}
}
ActiveRelayMessage::Shutdown => {