Disable UDP and STUN when proxy is set

This commit is contained in:
Oscar Mira 2020-12-22 14:11:34 +01:00
parent 9a5698762b
commit 087a188ff3
No known key found for this signature in database
GPG key ID: B371B98C5DC32237

View file

@ -2210,6 +2210,15 @@ PeerConnection::InitializePortAllocator_n(
RTC_LOG(LS_INFO) << "TCP candidates are disabled.";
}
if (configuration.proxy_info.type != rtc::PROXY_NONE) {
port_allocator_flags |= cricket::PORTALLOCATOR_DISABLE_UDP |
cricket::PORTALLOCATOR_DISABLE_UDP_RELAY |
cricket::PORTALLOCATOR_DISABLE_STUN |
cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION |
cricket::PORTALLOCATOR_DISABLE_DEFAULT_LOCAL_CANDIDATE;
RTC_LOG(LS_INFO) << "UDP candidates, relay over UDP, and STUN are disabled.";
}
if (configuration.candidate_network_policy ==
kCandidateNetworkPolicyLowCost) {
port_allocator_flags |= cricket::PORTALLOCATOR_DISABLE_COSTLY_NETWORKS;