补充SetNAT1To1IPs

This commit is contained in:
langhuihui
2021-05-05 09:06:13 +08:00
parent 491daaf57f
commit bee79ab760
3 changed files with 47 additions and 93 deletions

View File

@@ -222,6 +222,9 @@ func (rtc *WebRTC) GetAnswer() ([]byte, error) {
func run() {
var m MediaEngine
var s SettingEngine
if len(config.PublicIP) > 0 {
s.SetNAT1To1IPs(config.PublicIP, ICECandidateTypeHost)
}
if config.PortMin > 0 && config.PortMax > 0 {
s.SetEphemeralUDPPortRange(config.PortMin, config.PortMax)
}