MDN self-hosted library · e01.org

RTCIceTransport: getLocalCandidates() method

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const localCandidates = pc
  .getSenders()[0]
  .transport.iceTransport.getLocalCandidates();

localCandidates.forEach((candidate, index) => {
  console.log(`Candidate ${index}: ${candidate.candidate}`);
});