const restartConfig = {
iceServers: [
{
urls: "turn:asia.turn-server.net",
username: "allie@oopcode.com",
credential: "topsecretpassword",
},
],
};
myPeerConnection.setConfiguration(restartConfig);
myPeerConnection.restartIce();
myPeerConnection
.createOffer() // restartIce() causes iceRestart to be set true
.then((offer) => myPeerConnection.setLocalDescription(offer))
.then(() => {
// send the offer to the other peer using the signaling server
})
.catch(window.reportError);RTCPeerConnection: setConfiguration() method / notebook
RTCPeerConnection: setConfiguration() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.