Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

240
Visualizações
WebRTC: ICE failed, add a TURN server and see about:webrtc for more details

I'm trying to make a simple connection, but run into the error which is the title of this post.

My code for the caller and answerer are below:

STUN Server

const servers = {iceServers: [{urls: ['stun:stun1.l.google.com:19302']}]}

Peer A (Caller)

let peer = new RTCPeerConnection(servers)
let chnl = peer.createDataChannel("channel")
chnl.onopen = e => console.log("Connection opened")
chnl.onmessage = e => console.log("New message: " + e.data)
peer.onicecandidate = e => console.log(JSON.stringify(e.candidate))
peer.createOffer().then(offer => peer.setLocalDescription(offer)).then(a => console.log(peer.localDescription))

Peer B (Answerer)

let peer = new RTCPeerConnection(servers)
peer.ondatachannel= e => {
    peer.chnl = e.channel
    peer.chnl.onopen = e => console.log("Connection opened")
    peer.chnl.onmessage = e => console.log("New message: " + e.data)
}
peer.onicecandidate = e => console.log(JSON.stringify(e.candidate))
peer.setRemoteDescription(offer)
peer.createAnswer().then(answer=> peer.setLocalDescription(answer)).then(a => console.log(peer.localDescription))

I was running this code in 2 separate tabs of Firefox's console. I would copy the offer and answer logged from the onicecandidate callback and set these as the answerer's and caller's remote descriptions, respectively. At this moment, I would receive the error: WebRTC: ICE failed, add a TURN server and see about:webrtc for more details. I'm unsure how to resolve this.

Thank you

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda