@@ -2,26 +2,31 @@ use std::fmt;
2
2
3
3
use serde:: { Deserialize , Serialize } ;
4
4
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.
7
7
#[ derive( Default , Debug , PartialEq , Eq , Copy , Clone , Serialize , Deserialize ) ]
8
8
pub enum RTCIceTransportPolicy {
9
9
#[ default]
10
10
Unspecified = 0 ,
11
11
12
- /// ICETransportPolicyAll indicates any type of candidate is used .
12
+ /// Indicates that the ICE Agent can use any type of candidate.
13
13
#[ serde( rename = "all" ) ]
14
14
All = 1 ,
15
15
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.
18
26
#[ serde( rename = "relay" ) ]
19
27
Relay = 2 ,
20
28
}
21
29
22
- /// ICEGatherPolicy is the ORTC equivalent of ICETransportPolicy
23
- pub type ICEGatherPolicy = RTCIceTransportPolicy ;
24
-
25
30
const ICE_TRANSPORT_POLICY_RELAY_STR : & str = "relay" ;
26
31
const ICE_TRANSPORT_POLICY_ALL_STR : & str = "all" ;
27
32
0 commit comments