Add EnableLoopbackCandidate flag

Add EnableLoopbackCandidate flag
This commit is contained in:
cnderrauber
2022-11-23 10:15:46 +08:00
committed by cnderrauber
parent 5faad1ed07
commit c75da54795
2 changed files with 18 additions and 10 deletions

View File

@@ -37,16 +37,17 @@ type SettingEngine struct {
ICERelayAcceptanceMinWait *time.Duration
}
candidates struct {
ICELite bool
ICENetworkTypes []NetworkType
InterfaceFilter func(string) bool
IPFilter func(net.IP) bool
NAT1To1IPs []string
NAT1To1IPCandidateType ICECandidateType
MulticastDNSMode ice.MulticastDNSMode
MulticastDNSHostName string
UsernameFragment string
Password string
ICELite bool
ICENetworkTypes []NetworkType
InterfaceFilter func(string) bool
IPFilter func(net.IP) bool
NAT1To1IPs []string
NAT1To1IPCandidateType ICECandidateType
MulticastDNSMode ice.MulticastDNSMode
MulticastDNSHostName string
UsernameFragment string
Password string
IncludeLoopbackCandidate bool
}
replayProtection struct {
DTLS *uint
@@ -195,6 +196,12 @@ func (e *SettingEngine) SetNAT1To1IPs(ips []string, candidateType ICECandidateTy
e.candidates.NAT1To1IPCandidateType = candidateType
}
// SetIncludeLoopbackCandidate enable pion to gather loopback candidates, it is useful
// for some VM have public IP mapped to loopback interface
func (e *SettingEngine) SetIncludeLoopbackCandidate(include bool) {
e.candidates.IncludeLoopbackCandidate = include
}
// SetAnsweringDTLSRole sets the DTLS role that is selected when offering
// The DTLS role controls if the WebRTC Client as a client or server. This
// may be useful when interacting with non-compliant clients or debugging issues.