pub struct WebRtcConfig {
pub advertise_on_nostr: Option<bool>,
pub auto_connect: Option<bool>,
pub accept_connections: Option<bool>,
pub mtu: Option<u16>,
pub max_connections: Option<usize>,
pub connect_timeout_ms: Option<u64>,
pub ice_gather_timeout_ms: Option<u64>,
pub data_channel_label: Option<String>,
pub ordered: Option<bool>,
pub max_retransmits: Option<u16>,
pub stun_servers: Option<Vec<String>>,
pub resolve_mdns_candidates: Option<bool>,
}Expand description
WebRTC transport instance configuration.
WebRTC negotiates over an existing authenticated FIPS session and carries ordinary FIPS datagrams over an SCTP data channel.
Fields§
§advertise_on_nostr: Option<bool>Whether this transport should be advertised on Nostr overlay discovery. Default: false.
auto_connect: Option<bool>Whether to automatically connect to discovered WebRTC peers. Default: false.
accept_connections: Option<bool>Accept inbound WebRTC offers. Defaults to advertise_on_nostr: a
non-advertising adapter has no inbound listener policy unless enabled.
mtu: Option<u16>Data-channel MTU. Defaults to 1200.
max_connections: Option<usize>Maximum simultaneous WebRTC peer connections. Defaults to 6 and is additionally bounded by the configured ICE socket budget.
connect_timeout_ms: Option<u64>Outbound connect timeout in milliseconds. Defaults to 30000.
ice_gather_timeout_ms: Option<u64>Non-trickle ICE gathering timeout in milliseconds. Defaults to 2000.
data_channel_label: Option<String>Data channel label. Defaults to “fips”.
ordered: Option<bool>Ordered data channel delivery. Default: true.
max_retransmits: Option<u16>Maximum retransmits for partial reliability. Default: unset, which uses WebRTC’s reliable data-channel mode. Set to 0 for datagram-like delivery.
stun_servers: Option<Vec<String>>Override STUN servers for this transport. Supports up to three stun:
URLs. When unset, node.discovery.nostr.stun_servers is used.
resolve_mdns_candidates: Option<bool>Resolve browser .local ICE candidates through one shared mDNS owner.
Every peer connection keeps its own ICE mDNS mode disabled. Default:
true. Disable this for environments where multicast DNS is unavailable.
Implementations§
Source§impl WebRtcConfig
impl WebRtcConfig
Sourcepub fn advertise_on_nostr(&self) -> bool
pub fn advertise_on_nostr(&self) -> bool
Whether this WebRTC transport should be advertised on Nostr discovery.
Sourcepub fn auto_connect(&self) -> bool
pub fn auto_connect(&self) -> bool
Whether this transport auto-connects to discovered peers.
Sourcepub fn accept_connections(&self) -> bool
pub fn accept_connections(&self) -> bool
Whether this transport accepts inbound offers.
Sourcepub fn max_connections(&self) -> usize
pub fn max_connections(&self) -> usize
Get the maximum number of peer connections.
Sourcepub fn connect_timeout_ms(&self) -> u64
pub fn connect_timeout_ms(&self) -> u64
Get the connect timeout in milliseconds.
Sourcepub fn ice_gather_timeout_ms(&self) -> u64
pub fn ice_gather_timeout_ms(&self) -> u64
Get the ICE gathering timeout in milliseconds.
Sourcepub fn data_channel_label(&self) -> &str
pub fn data_channel_label(&self) -> &str
Get the data channel label.
Sourcepub fn max_retransmits(&self) -> Option<u16>
pub fn max_retransmits(&self) -> Option<u16>
Get the configured max retransmits. None uses WebRTC’s reliable mode.
Sourcepub fn resolve_mdns_candidates(&self) -> bool
pub fn resolve_mdns_candidates(&self) -> bool
Whether browser .local ICE candidates should be resolved.
Sourcepub fn stun_servers<'a>(&'a self, fallback: &'a [String]) -> Vec<String>
pub fn stun_servers<'a>(&'a self, fallback: &'a [String]) -> Vec<String>
Resolve STUN servers, falling back to node discovery STUN servers.
Trait Implementations§
Source§impl Clone for WebRtcConfig
impl Clone for WebRtcConfig
Source§fn clone(&self) -> WebRtcConfig
fn clone(&self) -> WebRtcConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebRtcConfig
impl Debug for WebRtcConfig
Source§impl Default for WebRtcConfig
impl Default for WebRtcConfig
Source§fn default() -> WebRtcConfig
fn default() -> WebRtcConfig
Source§impl<'de> Deserialize<'de> for WebRtcConfig
impl<'de> Deserialize<'de> for WebRtcConfig
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>,
Auto Trait Implementations§
impl Freeze for WebRtcConfig
impl RefUnwindSafe for WebRtcConfig
impl Send for WebRtcConfig
impl Sync for WebRtcConfig
impl Unpin for WebRtcConfig
impl UnsafeUnpin for WebRtcConfig
impl UnwindSafe for WebRtcConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more