Created
April 16, 2020 13:27
-
-
Save fernandoc1/fecd2656124628f7f5849042a5148fbe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <body> | |
| </body> | |
| </html> | |
| <!-- Reference: https://github.com/brkho/client-server-webrtc-example/blob/master/client/example-client.js --> | |
| <!-- stund -v -h 192.168.18.3 -a 127.0.0.1 --> | |
| <script> | |
| var config = {iceServers: [{ url: 'stun:localhost:3478'}]}; | |
| rtcPeerConnection = new RTCPeerConnection(config); | |
| var dataChannelConfig = {ordered: true, maxRetransmits: 10}; | |
| dataChannel = rtcPeerConnection.createDataChannel('dc', dataChannelConfig); | |
| rtcPeerConnection.createOffer(function (description) | |
| { | |
| console.log("DESCRIPTION:", description); | |
| }).then(function (offer) | |
| { | |
| console.log("OFFER:", offer); | |
| return rtcPeerConnection.setLocalDescription(offer); | |
| }).catch(function(reason) | |
| { | |
| console.log("REASON:", reason); | |
| }); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment