Add SettingsEngine option to disable Active TCP

Use SettingsEngine.DisableActiveTCP(true)
This commit is contained in:
David Zhao
2023-06-26 00:12:13 -07:00
committed by David Zhao
parent c05e366e66
commit 678ddd46e4
2 changed files with 7 additions and 0 deletions

View File

@@ -121,6 +121,7 @@ func (g *ICEGatherer) createAgent() error {
TCPMux: g.api.settingEngine.iceTCPMux,
UDPMux: g.api.settingEngine.iceUDPMux,
ProxyDialer: g.api.settingEngine.iceProxyDialer,
DisableActiveTCP: g.api.settingEngine.iceDisableActiveTCP,
}
requestedNetworkTypes := g.api.settingEngine.candidates.ICENetworkTypes

View File

@@ -86,6 +86,7 @@ type SettingEngine struct {
iceTCPMux ice.TCPMux
iceUDPMux ice.UDPMux
iceProxyDialer proxy.Dialer
iceDisableActiveTCP bool
disableMediaEngineCopy bool
srtpProtectionProfiles []dtls.SRTPProtectionProfile
receiveMTU uint
@@ -348,6 +349,11 @@ func (e *SettingEngine) SetICEProxyDialer(d proxy.Dialer) {
e.iceProxyDialer = d
}
// DisableActiveTCP disables using active TCP for ICE. Active TCP is enabled by default
func (e *SettingEngine) DisableActiveTCP(isDisabled bool) {
e.iceDisableActiveTCP = isDisabled
}
// DisableMediaEngineCopy 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.