title: How can I use the getUserMedia() API with Node.js to stream media in real time?
body: <p>Learning how to capture video and audio in my web browser took a simple google search, resulting in the simplest example of a working test, which plays my own video and audio back to me:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia);
  
  if (navigator.getUserMedia) {
    navigator.getUserMedia(
  
      // constraints
      {
        video: true,
        audio: true
      },
  
      // successCallback
      function(localMediaStream) {
        var video = document.querySelector('video');
        video.src = window.URL.createObjectURL(localMediaStream);
        // Do something with the video here, e.g. video.play()
      },
  
      // errorCallback
      function(err) {
        console.log("The following error occured: " + err);
      });
  } else {
    console.log("getUserMedia not supported");
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>video {
    width: 100%;
    height: 420px;
    background-color: black;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;video autoplay&gt;&lt;/video&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>but from there, the search criteria becomes tricky. Searching <code>Stream audio &amp; video with Node.js</code> shows tutorials to stream video from the server to the client, but my question, how to stream audio and video from one client, to the server, to another client, is nowhere to be found. ]</p>
  
  <p>I want to learn the fundamental steps of doing this. I'd like to really understand it in a simple way before considering the use of additional APIs to speed up the process. I'm open to Socket.io, but that's a common, standard API.</p>
  
  <p>Hence my question:</p>
  
  <p>How, in the simplest possible form, can I stream video and audio data from one  client to another through a Node.js server?</p>