title: WebRTC Server PeerJS get data stream
body: <p>I'd like to set up a video calling service while doing server-side work with the video stream in Node.js. Compatibility wasn't an issue for my project, so WebRTC seemed the obvious choice. I found PeerJS, which allows for really simple usage of WebRTC. Wh server can be started in a Node.js script.</p>
  
  <p>I want to take this video stream and do some computations with OpenCV on the server. I considered using something like Binary.js to transfer video data, but that would be much slower. How can I get the WebRTC video stream on my Node.js server?</p>
  
  <p>Something like the following</p>
  
  <pre><code>var PeerServer = require('peer').PeerServer;
  var server = new PeerServer({ port: 9000 });
  
  server.on('data', function (data)
  {
       do_something_with_open_cv(data);
  });
  </code></pre>
  
  <p>Obviously this would require the video chunks to be complete frames. Can I access this stream in such a manner?</p>