Skip to content

Commit

Permalink
Rebase of Taylor's NetworkType PR (#274)
Browse files Browse the repository at this point in the history
* Adding "networkType" field to RTCIceCandidateStats.

Fixes #257.

Exposes the type of network interface a local ICE candidate is using.
Defined such that it will be present for srflx/relay candidates as well,
exposing the type of network interface used to communicate with the
STUN/TURN server.

RTCNetworkType is based on this enum:
http://wicg.github.io/netinfo/#dom-connectiontype

With the only differences being that "none" isn't applicable, since every
ICE candidate is using *some* network interface, and "mixed" isn't
applicable since every ICE candidate is tied to only one interface.

* Adding note about cases where "networkType" may be misleading.

* Moving "other" and "unknown" to the end.

* Merged "other" and "unknown", added "vpn"
  • Loading branch information
alvestrand authored and vr000m committed Nov 16, 2017
1 parent 1fb53ba commit 84f3393
Showing 1 changed file with 121 additions and 0 deletions.
121 changes: 121 additions & 0 deletions webrtc-stats.html
Expand Up @@ -2242,6 +2242,7 @@ <h3>
<pre class="idl">dictionary RTCIceCandidateStats : RTCStats {
DOMString transportId;
boolean isRemote;
RTCNetworkType networkType;
DOMString ip;
long port;
DOMString protocol;
Expand Down Expand Up @@ -2277,6 +2278,27 @@ <h2>
<code>true</code> indicates that this represents a remote candidate.
</p>
</dd>
<dt>
<dfn><code>networkType</code></dfn> of type <span class=
"idlMemberType"><a>RTCNetworkType</a></span>
</dt>
<dd>
<p>
Represents the type of network interface used by the base of
a local candidate (the address the ICE agent sends from).
Only present for local candidates; it's not possible to know
what type of
network interface a remote candidate is using.
</p>
<div class="note">
This stat only tells you about the network interface used by
the first "hop"; it's possible that a connection will be
bottlenecked by another type of network. For example, when
using Wi-Fi tethering, the <code>networkType</code> of the
relevant candidate would be <code>"wifi"</code>, even when
the next hop is over a cellular connection.
</div>
</dd>
<dt>
<dfn><code>ip</code></dfn> of type <span class=
"idlMemberType"><a>DOMString</a></span>
Expand Down Expand Up @@ -2365,6 +2387,105 @@ <h2>
</dl>
</section>
</div>
<section>
<h3>
<dfn>RTCNetworkType</dfn> enum
</h3>
<div>
<pre class="idl">
enum RTCNetworkType {
"bluetooth",
"cellular",
"ethernet",
"wifi",
"wimax",
"vpn",
"unknown"
};</pre>
<table data-link-for="RTCNetworkType" data-dfn-for=
"RTCNetworkType" class="simple">
<tbody>
<tr>
<th colspan="2">
Enumeration description
</th>
</tr>
<tr>
<td>
<dfn><code>bluetooth</code></dfn>
</td>
<td>
<p>
A Bluetooth connection.
</p>
</td>
</tr>
<tr>
<td>
<dfn><code>cellular</code></dfn>
</td>
<td>
<p>
A cellular connection (e.g., EDGE, HSPA, LTE, etc.).
</p>
</td>
</tr>
<tr>
<td>
<dfn><code>ethernet</code></dfn>
</td>
<td>
<p>
An Ethernet connection.
</p>
</td>
</tr>
<tr>
<td>
<dfn><code>wifi</code></dfn>
</td>
<td>
<p>
A Wi-Fi connection.
</p>
</td>
</tr>
<tr>
<td>
<dfn><code>wimax</code></dfn>
</td>
<td>
<p>
A WiMAX connection.
</p>
</td>
</tr>
<tr>
<td>
<dfn><code>vpn</code></dfn>
</td>
<td>
<p>
The connection runs over a VPN. The underlying network
type is not available.
</p>
</td>
</tr>
<tr>
<td>
<dfn><code>unknown</code></dfn>
</td>
<td>
<p>
The user agent is unable or unwilling to identify the
underlying connection technology.
</p>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</section>
<section id="candidatepair-dict*">
<h3>
Expand Down

0 comments on commit 84f3393

Please sign in to comment.