1783765.html (578B)
1 <script> 2 var timeout = async function (cmd) { 3 const timer = new Promise((resolve, reject) => { 4 const id = setTimeout(() => { 5 clearTimeout(id) 6 reject(new Error('Promise timed out!')) 7 }, 750) 8 }) 9 return Promise.race([cmd, timer]) 10 } 11 window.addEventListener('load', async () => { 12 let a = new RTCPeerConnection({ 13 'iceServers': [{'urls': 'stun:23.21.150.121'}], 14 'peerIdentity': 'x', 15 }) 16 let b = await timeout(a.createOffer({ })) 17 a.setLocalDescription(b) 18 try { a.setRemoteDescription(b) } catch (e) {} 19 a.setLocalDescription(b) 20 }) 21 </script>