Skip to content

Commit c954192

Browse files
committed
[LibWebRTC] Allow UDP ports range configuration with an env var
Setting WEBKIT_WEBRTC_PEER_PORT_RANGE to some string like "20000:30000" overrides the value set by the webrtc-udp-ports-range websetting.
1 parent f2f919d commit c954192

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProvider.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,10 @@ rtc::scoped_refptr<webrtc::PeerConnectionInterface> LibWebRTCProvider::createPee
399399
if (!factory)
400400
return nullptr;
401401

402+
auto portRangeFromEnvironment = StringView::fromLatin1(std::getenv("WEBKIT_WEBRTC_PEER_PORT_RANGE"));
403+
if (!portRangeFromEnvironment.isEmpty())
404+
setPortAllocatorRange(portRangeFromEnvironment);
405+
402406
if (auto portRange = portAllocatorRange())
403407
portAllocator->SetPortRange(portRange->first, portRange->second);
404408

0 commit comments

Comments
 (0)