WebRTC UDP port range issue

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

WebRTC UDP port range issue

Postby AmalKahlout » Wed May 05, 2021 7:35 am

Hello,
We have .Net desktop app that uses CefSharp. In our app we use WebRTC to create one to one video calls. we are trying to use the chromium policy "WebRtcUdpPortRange" to restrict WebRTC to use a certain UDP ports range, by adding the key "WebRtcUdpPortRange" of type string in registry keys. but the WebRTC is still using random ports, not ports from the range we set in the registry key.

We added Registry string key in the HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE as the following path:
\SOFTWARE\Policies\Chromium
Key name: WebRtcUdpPortRange
Key Value: 52700-60000

Please advice how to restrict the WebRTC to use a certain UDP Ports range.

Thank you.
AmalKahlout
Newbie
 
Posts: 2
Joined: Wed May 05, 2021 7:14 am

Re: WebRTC UDP port range issue

Postby amaitland » Wed May 05, 2021 3:00 pm

CEF doesn't currently support querying the registry so the result you are seeing is expected.

Quick search in the chromium source suggests there is a preference you can try setting.

https://source.chromium.org/chromium/ch ... s=chromium

http://cefsharp.github.io/api/89.0.x/ht ... eAsync.htm
http://cefsharp.github.io/api/89.0.x/ht ... ontext.htm
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: WebRTC UDP port range issue

Postby AmalKahlout » Sun May 09, 2021 5:13 pm

Problem solved after adding "webrtc.udp_port_range" preference as following:

Cef.UIThreadTaskFactory.StartNew(delegate
{
using (var context = Cef.GetGlobalRequestContext())
{
string errorMessage;
context.SetPreference("webrtc.udp_port_range", "60000-62500", out errorMessage);
}
});

Thank you!
AmalKahlout
Newbie
 
Posts: 2
Joined: Wed May 05, 2021 7:14 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 42 guests