Introduce UDPMux in SettingsEngine, single-port

When set, Pion will handle ICE connections over UDPMux
This commit is contained in:
David Zhao
2021-04-12 21:58:35 -07:00
committed by Sean DuBois
parent fb4b5826ae
commit d0a52518b0
5 changed files with 19 additions and 8 deletions

View File

@@ -58,6 +58,7 @@ type SettingEngine struct {
BufferFactory func(packetType packetio.BufferPacketType, ssrc uint32) io.ReadWriteCloser
LoggerFactory logging.LoggerFactory
iceTCPMux ice.TCPMux
iceUDPMux ice.UDPMux
iceProxyDialer proxy.Dialer
disableMediaEngineCopy bool
}
@@ -252,6 +253,13 @@ func (e *SettingEngine) SetICETCPMux(tcpMux ice.TCPMux) {
e.iceTCPMux = tcpMux
}
// SetICEUDPMux allows ICE traffic to come through a single UDP port, drastically
// simplifying deployments where ports will need to be opened/forwarded.
// UDPMux should be started prior to creating PeerConnections.
func (e *SettingEngine) SetICEUDPMux(udpMux ice.UDPMux) {
e.iceUDPMux = udpMux
}
// SetICEProxyDialer sets the proxy dialer interface based on golang.org/x/net/proxy.
func (e *SettingEngine) SetICEProxyDialer(d proxy.Dialer) {
e.iceProxyDialer = d