The RTCIceCandidate interface's read-only tcpType property is included on TCP candidates to provide additional details about the candidate type.
The tcpType field's value is set when the RTCIceCandidate() constructor is used. You can't directly set its value; instead, its value is automatically extracted from the candidate a-line, if it's formatted properly.
var tcpType = RTCIceCandidate.tcpType;
A DOMString whose value is one of those defined by the RTCIceTcpCandidateType enumerated type.
"active""passive""so"tcpType is null for UDP candidates.
In this example, the candidate's protocol and tcpType are used to adjust the user interface for simultaneous-open TCP candidates.
if (candidate.protocol == "tcp" && candidate.tcpType == "so") {
adjustForSimultaneousOpen(candidate);
}
| Specification | Status | Comment |
|---|---|---|
| WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCIceCandidate.tcpType' in that specification. | Candidate Recommendation | Initial definition. |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | No | Yes | No | No | No | ? |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | No | No | Yes | No | No | ? | Yes |
RTCIceCandidate.protocolRTCIceCandidate.type
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate/tcpType