title: How to use WebRTC APIs in Node.js without browser or any HTML?
body: <p>So i'm making a command line application which will send text messages between two clients using WebRTC and Node.js with socket.io signalling. But when i'm using the RTCPeerConnection api there is this error :</p>
  
  <pre><code>myConnection = new RTCPeerConnection(configuration, { 
      ^
  
  ReferenceError: RTCPeerConnection is not defined
  </code></pre>
  
  <p>The code segment is :</p>
  
  <pre><code>
  var configuration = { 
      "iceServers": [{ "url": "stun:stun.1.google.com:19302" }] 
  }; 
  
  myConnection = new RTCPeerConnection(configuration, { 
          optional: [{RtpDataChannels: true}] 
       }); 
  
       console.log("RTCPeerConnection object was created"); 
       console.log(myConnection); 
  
       //setup ice handling 
       //when the browser finds an ice candidate we send it to another peer 
       myConnection.onicecandidate = function (event) { 
          console.log("Ice candidates found");
          if (event.candidate) { 
             send({ 
                type: "candidate", 
                candidate: event.candidate 
             });
          } 
       }; 
  
  </code></pre>
  
  <p>But when I include this js file in an HTML file as a script then it works fine. Does it have something to with the fact that WebRTC is a browser API and doesn't work outside it? I really don't wanna use a library for WebRTC. What should I do to make use of WebRTC apis without a browser?</p>