@@ -2,26 +2,31 @@ use std::fmt;
22
33use serde:: { Deserialize , Serialize } ;
44
5- /// ICETransportPolicy defines the ICE candidate policy surface the
6- /// permitted candidates. Only these candidates are used for connectivity checks.
5+ /// Defines the policy that will be used to determine the
6+ /// permitted ICE candidates that will be used for connectivity checks.
77#[ derive( Default , Debug , PartialEq , Eq , Copy , Clone , Serialize , Deserialize ) ]
88pub enum RTCIceTransportPolicy {
99 #[ default]
1010 Unspecified = 0 ,
1111
12- /// ICETransportPolicyAll indicates any type of candidate is used .
12+ /// Indicates that the ICE Agent can use any type of candidate.
1313 #[ serde( rename = "all" ) ]
1414 All = 1 ,
1515
16- /// ICETransportPolicyRelay indicates only media relay candidates such
17- /// as candidates passing through a TURN server are used.
16+ /// Indicates that the ICE Agent must use only media relay candidates,
17+ /// such as candidates passing through a TURN server.
18+ ///
19+ /// This can be used to prevent the remote endpoint from learning the
20+ /// user's IP addresses via STUN requests, which may be desirable in
21+ /// certain use cases.
22+ ///
23+ /// Keep in mind that media relay candidates can increase latency,
24+ /// reduce throughput, and consume more battery power than direct
25+ /// peer-to-peer connections.
1826 #[ serde( rename = "relay" ) ]
1927 Relay = 2 ,
2028}
2129
22- /// ICEGatherPolicy is the ORTC equivalent of ICETransportPolicy
23- pub type ICEGatherPolicy = RTCIceTransportPolicy ;
24-
2530const ICE_TRANSPORT_POLICY_RELAY_STR : & str = "relay" ;
2631const ICE_TRANSPORT_POLICY_ALL_STR : & str = "all" ;
2732
0 commit comments