Skip to content

Commit 678ddd4

Browse files
committed
Add SettingsEngine option to disable Active TCP
Use SettingsEngine.DisableActiveTCP(true)
1 parent c05e366 commit 678ddd4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

icegatherer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ func (g *ICEGatherer) createAgent() error {
121121
TCPMux: g.api.settingEngine.iceTCPMux,
122122
UDPMux: g.api.settingEngine.iceUDPMux,
123123
ProxyDialer: g.api.settingEngine.iceProxyDialer,
124+
DisableActiveTCP: g.api.settingEngine.iceDisableActiveTCP,
124125
}
125126

126127
requestedNetworkTypes := g.api.settingEngine.candidates.ICENetworkTypes

settingengine.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ type SettingEngine struct {
8686
iceTCPMux ice.TCPMux
8787
iceUDPMux ice.UDPMux
8888
iceProxyDialer proxy.Dialer
89+
iceDisableActiveTCP bool
8990
disableMediaEngineCopy bool
9091
srtpProtectionProfiles []dtls.SRTPProtectionProfile
9192
receiveMTU uint
@@ -348,6 +349,11 @@ func (e *SettingEngine) SetICEProxyDialer(d proxy.Dialer) {
348349
e.iceProxyDialer = d
349350
}
350351

352+
// DisableActiveTCP disables using active TCP for ICE. Active TCP is enabled by default
353+
func (e *SettingEngine) DisableActiveTCP(isDisabled bool) {
354+
e.iceDisableActiveTCP = isDisabled
355+
}
356+
351357
// DisableMediaEngineCopy stops the MediaEngine from being copied. This allows a user to modify
352358
// the MediaEngine after the PeerConnection has been constructed. This is useful if you wish to
353359
// modify codecs after signaling. Make sure not to share MediaEngines between PeerConnections.

0 commit comments

Comments
 (0)