Struct webrtc::api::setting_engine::SettingEngine
source · pub struct SettingEngine { /* private fields */ }
Expand description
SettingEngine allows influencing behavior in ways that are not supported by the WebRTC API. This allows us to support additional use-cases without deviating from the WebRTC API elsewhere.
Implementations§
source§impl SettingEngine
impl SettingEngine
sourcepub fn detach_data_channels(&mut self)
pub fn detach_data_channels(&mut self)
detach_data_channels enables detaching data channels. When enabled data channels have to be detached in the OnOpen callback using the DataChannel.Detach method.
sourcepub fn set_srtp_protection_profiles(
&mut self,
profiles: Vec<SrtpProtectionProfile>
)
pub fn set_srtp_protection_profiles( &mut self, profiles: Vec<SrtpProtectionProfile> )
set_srtp_protection_profiles allows the user to override the default srtp Protection Profiles
The default srtp protection profiles are provided by the function defaultSrtpProtectionProfiles
sourcepub fn set_ice_timeouts(
&mut self,
disconnected_timeout: Option<Duration>,
failed_timeout: Option<Duration>,
keep_alive_interval: Option<Duration>
)
pub fn set_ice_timeouts( &mut self, disconnected_timeout: Option<Duration>, failed_timeout: Option<Duration>, keep_alive_interval: Option<Duration> )
set_ice_timeouts sets the behavior around ICE Timeouts
- disconnected_timeout is the duration without network activity before a Agent is considered disconnected. Default is 5 Seconds
- failed_timeout is the duration without network activity before a Agent is considered failed after disconnected. Default is 25 Seconds
- keep_alive_interval is how often the ICE Agent sends extra traffic if there is no activity, if media is flowing no traffic will be sent. Default is 2 seconds
sourcepub fn set_host_acceptance_min_wait(&mut self, t: Option<Duration>)
pub fn set_host_acceptance_min_wait(&mut self, t: Option<Duration>)
set_host_acceptance_min_wait sets the icehost_acceptance_min_wait
sourcepub fn set_srflx_acceptance_min_wait(&mut self, t: Option<Duration>)
pub fn set_srflx_acceptance_min_wait(&mut self, t: Option<Duration>)
set_srflx_acceptance_min_wait sets the icesrflx_acceptance_min_wait
sourcepub fn set_prflx_acceptance_min_wait(&mut self, t: Option<Duration>)
pub fn set_prflx_acceptance_min_wait(&mut self, t: Option<Duration>)
set_prflx_acceptance_min_wait sets the iceprflx_acceptance_min_wait
sourcepub fn set_relay_acceptance_min_wait(&mut self, t: Option<Duration>)
pub fn set_relay_acceptance_min_wait(&mut self, t: Option<Duration>)
set_relay_acceptance_min_wait sets the icerelay_acceptance_min_wait
sourcepub fn set_udp_network(&mut self, udp_network: UDPNetwork)
pub fn set_udp_network(&mut self, udp_network: UDPNetwork)
set_udp_network allows ICE traffic to come through Ephemeral or UDPMux. UDPMux drastically simplifying deployments where ports will need to be opened/forwarded. UDPMux should be started prior to creating PeerConnections.
sourcepub fn set_lite(&mut self, lite: bool)
pub fn set_lite(&mut self, lite: bool)
set_lite configures whether or not the ice agent should be a lite agent
sourcepub fn set_network_types(&mut self, candidate_types: Vec<NetworkType>)
pub fn set_network_types(&mut self, candidate_types: Vec<NetworkType>)
set_network_types configures what types of candidate networks are supported during local and server reflexive gathering.
sourcepub fn set_interface_filter(&mut self, filter: InterfaceFilterFn)
pub fn set_interface_filter(&mut self, filter: InterfaceFilterFn)
set_interface_filter sets the filtering functions when gathering ICE candidates This can be used to exclude certain network interfaces from ICE. Which may be useful if you know a certain interface will never succeed, or if you wish to reduce the amount of information you wish to expose to the remote peer
sourcepub fn set_ip_filter(&mut self, filter: IpFilterFn)
pub fn set_ip_filter(&mut self, filter: IpFilterFn)
set_ip_filter sets the filtering functions when gathering ICE candidates This can be used to exclude certain ip from ICE. Which may be useful if you know a certain ip will never succeed, or if you wish to reduce the amount of information you wish to expose to the remote peer
sourcepub fn set_nat_1to1_ips(
&mut self,
ips: Vec<String>,
candidate_type: RTCIceCandidateType
)
pub fn set_nat_1to1_ips( &mut self, ips: Vec<String>, candidate_type: RTCIceCandidateType )
set_nat_1to1_ips sets a list of external IP addresses of 1:1 (D)NAT and a candidate type for which the external IP address is used. This is useful when you are host a server using Pion on an AWS EC2 instance which has a private address, behind a 1:1 DNAT with a public IP (e.g. Elastic IP). In this case, you can give the public IP address so that Pion will use the public IP address in its candidate instead of the private IP address. The second argument, candidate_type, is used to tell Pion which type of candidate should use the given public IP address. Two types of candidates are supported:
ICECandidateTypeHost: The public IP address will be used for the host candidate in the SDP. ICECandidateTypeSrflx: A server reflexive candidate with the given public IP address will be added to the SDP.
Please note that if you choose ICECandidateTypeHost, then the private IP address won’t be advertised with the peer. Also, this option cannot be used along with mDNS.
If you choose ICECandidateTypeSrflx, it simply adds a server reflexive candidate with the public IP. The host candidate is still available along with mDNS capabilities unaffected. Also, you cannot give STUN server URL at the same time. It will result in an error otherwise.
sourcepub fn set_answering_dtls_role(&mut self, role: DTLSRole) -> Result<()>
pub fn set_answering_dtls_role(&mut self, role: DTLSRole) -> Result<()>
set_answering_dtls_role sets the dtls_transport role that is selected when offering The dtls_transport role controls if the WebRTC Client as a client or server. This may be useful when interacting with non-compliant clients or debugging issues.
DTLSRoleActive: Act as dtls_transport Client, send the ClientHello and starts the handshake DTLSRolePassive: Act as dtls_transport Server, wait for ClientHello
sourcepub fn set_vnet(&mut self, vnet: Option<Arc<Net>>)
pub fn set_vnet(&mut self, vnet: Option<Arc<Net>>)
set_vnet sets the VNet instance that is passed to ice VNet is a virtual network layer, allowing users to simulate different topologies, latency, loss and jitter. This can be useful for learning WebRTC concepts or testing your application in a lab environment
sourcepub fn set_ice_multicast_dns_mode(
&mut self,
multicast_dns_mode: MulticastDnsMode
)
pub fn set_ice_multicast_dns_mode( &mut self, multicast_dns_mode: MulticastDnsMode )
set_ice_multicast_dns_mode controls if ice queries and generates mDNS ICE Candidates
sourcepub fn set_multicast_dns_host_name(&mut self, host_name: String)
pub fn set_multicast_dns_host_name(&mut self, host_name: String)
set_multicast_dns_host_name sets a static HostName to be used by ice instead of generating one on startup This should only be used for a single PeerConnection. Having multiple PeerConnections with the same HostName will cause undefined behavior
sourcepub fn set_ice_credentials(
&mut self,
username_fragment: String,
password: String
)
pub fn set_ice_credentials( &mut self, username_fragment: String, password: String )
set_ice_credentials sets a staic uFrag/uPwd to be used by ice This is useful if you want to do signalless WebRTC session, or having a reproducible environment with static credentials
sourcepub fn disable_certificate_fingerprint_verification(
&mut self,
is_disabled: bool
)
pub fn disable_certificate_fingerprint_verification( &mut self, is_disabled: bool )
disable_certificate_fingerprint_verification disables fingerprint verification after dtls_transport Handshake has finished
sourcepub fn allow_insecure_verification_algorithm(&mut self, is_allowed: bool)
pub fn allow_insecure_verification_algorithm(&mut self, is_allowed: bool)
allow_insecure_verification_algorithm allows the usage of certain signature verification algorithm that are known to be vulnerable or deprecated.
sourcepub fn set_dtls_replay_protection_window(&mut self, n: usize)
pub fn set_dtls_replay_protection_window(&mut self, n: usize)
set_dtls_replay_protection_window sets a replay attack protection window size of dtls_transport connection.
sourcepub fn set_srtp_replay_protection_window(&mut self, n: usize)
pub fn set_srtp_replay_protection_window(&mut self, n: usize)
set_srtp_replay_protection_window sets a replay attack protection window size of srtp session.
sourcepub fn set_srtcp_replay_protection_window(&mut self, n: usize)
pub fn set_srtcp_replay_protection_window(&mut self, n: usize)
set_srtcp_replay_protection_window sets a replay attack protection window size of srtcp session.
sourcepub fn disable_srtp_replay_protection(&mut self, is_disabled: bool)
pub fn disable_srtp_replay_protection(&mut self, is_disabled: bool)
disable_srtp_replay_protection disables srtp replay protection.
sourcepub fn disable_srtcp_replay_protection(&mut self, is_disabled: bool)
pub fn disable_srtcp_replay_protection(&mut self, is_disabled: bool)
disable_srtcp_replay_protection disables srtcp replay protection.
sourcepub fn set_sdp_media_level_fingerprints(
&mut self,
sdp_media_level_fingerprints: bool
)
pub fn set_sdp_media_level_fingerprints( &mut self, sdp_media_level_fingerprints: bool )
set_sdp_media_level_fingerprints configures the logic for dtls_transport Fingerprint insertion If true, fingerprints will be inserted in the sdp at the fingerprint level, instead of the session level. This helps with compatibility with some webrtc implementations.
sourcepub fn disable_media_engine_copy(&mut self, is_disabled: bool)
pub fn disable_media_engine_copy(&mut self, is_disabled: bool)
disable_media_engine_copy stops the MediaEngine from being copied. This allows a user to modify the MediaEngine after the PeerConnection has been constructed. This is useful if you wish to modify codecs after signaling. Make sure not to share MediaEngines between PeerConnections.
sourcepub fn set_receive_mtu(&mut self, receive_mtu: usize)
pub fn set_receive_mtu(&mut self, receive_mtu: usize)
set_receive_mtu sets the size of read buffer that copies incoming packets. This is optional. Leave this 0 for the default receive_mtu
sourcepub fn set_mid_generator(
&mut self,
f: impl Fn(isize) -> String + Send + Sync + 'static
)
pub fn set_mid_generator( &mut self, f: impl Fn(isize) -> String + Send + Sync + 'static )
Sets a callback used to generate mid for transceivers created by this side of the RTCPeerconnection. By having separate “naming schemes” for mids generated by either side of a connection, it’s possible to reduce complexity when handling SDP offers/answers clashing.
The isize
argument is currently greatest seen numeric mid. Since mids don’t need to be numeric
this doesn’t necessarily indicating anything.
Note that the spec says: All MID values MUST be generated in a fashion that does not leak user information, e.g., randomly or using a per-PeerConnection counter, and SHOULD be 3 bytes or less, to allow them to efficiently fit into the RTP header extension
Trait Implementations§
source§impl Clone for SettingEngine
impl Clone for SettingEngine
source§fn clone(&self) -> SettingEngine
fn clone(&self) -> SettingEngine
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more