mirror of
				https://github.com/pion/webrtc.git
				synced 2025-10-31 18:52:55 +08:00 
			
		
		
		
	Add SettingsEngine option to disable Active TCP
Use SettingsEngine.DisableActiveTCP(true)
This commit is contained in:
		| @@ -121,6 +121,7 @@ func (g *ICEGatherer) createAgent() error { | |||||||
| 		TCPMux:                 g.api.settingEngine.iceTCPMux, | 		TCPMux:                 g.api.settingEngine.iceTCPMux, | ||||||
| 		UDPMux:                 g.api.settingEngine.iceUDPMux, | 		UDPMux:                 g.api.settingEngine.iceUDPMux, | ||||||
| 		ProxyDialer:            g.api.settingEngine.iceProxyDialer, | 		ProxyDialer:            g.api.settingEngine.iceProxyDialer, | ||||||
|  | 		DisableActiveTCP:       g.api.settingEngine.iceDisableActiveTCP, | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	requestedNetworkTypes := g.api.settingEngine.candidates.ICENetworkTypes | 	requestedNetworkTypes := g.api.settingEngine.candidates.ICENetworkTypes | ||||||
|   | |||||||
| @@ -86,6 +86,7 @@ type SettingEngine struct { | |||||||
| 	iceTCPMux                                 ice.TCPMux | 	iceTCPMux                                 ice.TCPMux | ||||||
| 	iceUDPMux                                 ice.UDPMux | 	iceUDPMux                                 ice.UDPMux | ||||||
| 	iceProxyDialer                            proxy.Dialer | 	iceProxyDialer                            proxy.Dialer | ||||||
|  | 	iceDisableActiveTCP                       bool | ||||||
| 	disableMediaEngineCopy                    bool | 	disableMediaEngineCopy                    bool | ||||||
| 	srtpProtectionProfiles                    []dtls.SRTPProtectionProfile | 	srtpProtectionProfiles                    []dtls.SRTPProtectionProfile | ||||||
| 	receiveMTU                                uint | 	receiveMTU                                uint | ||||||
| @@ -348,6 +349,11 @@ func (e *SettingEngine) SetICEProxyDialer(d proxy.Dialer) { | |||||||
| 	e.iceProxyDialer = d | 	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 | // 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 | // 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. | // modify codecs after signaling. Make sure not to share MediaEngines between PeerConnections. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 David Zhao
					David Zhao