mirror of
https://github.com/pion/webrtc.git
synced 2025-11-01 11:12:50 +08:00
Add EnableLoopbackCandidate flag
Add EnableLoopbackCandidate flag
This commit is contained in:
@@ -108,6 +108,7 @@ func (g *ICEGatherer) createAgent() error {
|
|||||||
IPFilter: g.api.settingEngine.candidates.IPFilter,
|
IPFilter: g.api.settingEngine.candidates.IPFilter,
|
||||||
NAT1To1IPs: g.api.settingEngine.candidates.NAT1To1IPs,
|
NAT1To1IPs: g.api.settingEngine.candidates.NAT1To1IPs,
|
||||||
NAT1To1IPCandidateType: nat1To1CandiTyp,
|
NAT1To1IPCandidateType: nat1To1CandiTyp,
|
||||||
|
IncludeLoopback: g.api.settingEngine.candidates.IncludeLoopbackCandidate,
|
||||||
Net: g.api.settingEngine.vnet,
|
Net: g.api.settingEngine.vnet,
|
||||||
MulticastDNSMode: mDNSMode,
|
MulticastDNSMode: mDNSMode,
|
||||||
MulticastDNSHostName: g.api.settingEngine.candidates.MulticastDNSHostName,
|
MulticastDNSHostName: g.api.settingEngine.candidates.MulticastDNSHostName,
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ type SettingEngine struct {
|
|||||||
MulticastDNSHostName string
|
MulticastDNSHostName string
|
||||||
UsernameFragment string
|
UsernameFragment string
|
||||||
Password string
|
Password string
|
||||||
|
IncludeLoopbackCandidate bool
|
||||||
}
|
}
|
||||||
replayProtection struct {
|
replayProtection struct {
|
||||||
DTLS *uint
|
DTLS *uint
|
||||||
@@ -195,6 +196,12 @@ func (e *SettingEngine) SetNAT1To1IPs(ips []string, candidateType ICECandidateTy
|
|||||||
e.candidates.NAT1To1IPCandidateType = candidateType
|
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
|
// SetAnsweringDTLSRole sets the DTLS role that is selected when offering
|
||||||
// The DTLS role controls if the WebRTC Client as a client or server. This
|
// 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.
|
// may be useful when interacting with non-compliant clients or debugging issues.
|
||||||
|
|||||||
Reference in New Issue
Block a user