You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: specs/WebRtcPortConfiguration.md
+11-15Lines changed: 11 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,17 @@ WebRTC Port Range Configuration
6
6
WebRTC by default allocates ports dynamically from the system’s ephemeral range.
7
7
In enterprise or testing environments, developers often need deterministic or firewall-friendly port allocation.
8
8
9
-
This API enables developers to configure the port range WebRTC uses for ICE candidates and media connections.
9
+
This API enables developers to configure the port range WebRTC uses for [ICE](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Protocols#ice) candidates and media connections.
10
+
10
11
The initial support is for **UDP**, with room to extend to **TCP** in the future.
11
12
12
13
By exposing a `WebRtcPortConfiguration` object on `CoreWebView2EnvironmentOptions`, developers can set and retrieve the port range before creating the WebView2 environment.
13
14
14
15
# Conceptual pages (How To)
15
16
16
-
Developers can use this API to restrict WebRTC’s UDP ports to a specific range.
17
+
Developers can use this API to restrict WebRTC’s UDP ports to a specific range which WebRTC uses for ICE candidate and media connections.
18
+
19
+
ICE stands for **Interactive Connectivity Establishment**. It is a standard method of NAT traversal used in WebRTC. It is defined in [IETF RFC 5245](https://datatracker.ietf.org/doc/html/rfc5245). ICE deals with the process of connecting media through NATs by conducting connectivity checks.
17
20
18
21
Common scenarios:
19
22
- Configure ports for **enterprise firewall compliance**.
@@ -203,10 +206,6 @@ public enum CoreWebView2WebRtcProtocolKind
203
206
/// UDP protocol for WebRTC media and ICE candidates.
204
207
/// </summary>
205
208
Udp=0,
206
-
/// <summary>
207
-
/// TCP protocol for WebRTC media and ICE candidates (future support).
208
-
/// </summary>
209
-
Tcp=1,
210
209
}
211
210
212
211
/// <summary>
@@ -222,8 +221,9 @@ public interface ICoreWebView2WebRtcPortConfiguration
222
221
/// This method allows configuring a specific port range that WebRTC will use
223
222
/// for ICE candidates and media connections for the specified protocol.
224
223
///
225
-
/// protocol specifies the WebRTC protocol type (UDP, TCP, etc.).
224
+
/// protocol specifies the WebRTC protocol type.
226
225
/// minPort and maxPort must be in the range 1025-65535 (inclusive).
226
+
/// Calls with invalid ranges return E_INVALIDARG.
227
227
/// minPort must be less than or equal to maxPort.
228
228
/// If minPort equals maxPort, it represents a single port.
229
229
///
@@ -257,14 +257,10 @@ public interface ICoreWebView2EnvironmentOptions
257
257
/// Gets the WebRTC port configuration object for configuring custom port ranges.
258
258
/// This configuration can be used to set and retrieve port range configuration
259
259
/// that WebRTC will use for ICE candidates and media connections.
260
+
/// If no range is configured, WebRTC uses the OS ephemeral port range.
261
+
/// Configuration must be completed before the environment is created. Once the environment is
0 commit comments