proxy: Fix ephemeral ports range CLI flag (again)

This commit is contained in:
KokaKiwi 2022-10-12 19:33:38 +02:00
parent 8b1970a3ce
commit 10c8173120
No known key found for this signature in database
GPG key ID: 09A5A2688F13FAC1
2 changed files with 12 additions and 6 deletions

View file

@ -354,7 +354,10 @@ func (sf *SnowflakeProxy) makeWebRTCAPI() *webrtc.API {
settingsEngine := webrtc.SettingEngine{}
if sf.EphemeralMinPort != 0 && sf.EphemeralMaxPort != 0 {
settingsEngine.SetEphemeralUDPPortRange(sf.EphemeralMinPort, sf.EphemeralMaxPort)
err := settingsEngine.SetEphemeralUDPPortRange(sf.EphemeralMinPort, sf.EphemeralMaxPort)
if err != nil {
log.Fatal("Invalid port range: min > max")
}
}
settingsEngine.SetICEMulticastDNSMode(ice.MulticastDNSModeDisabled)