title: WebRTC LAN p2p VIDEO CHAT using PYZMQ possible?
body: <p>I have built a messaging/chat application for my local network (all WINDOWS) using pyzmq and pyqt for UI, it is based on the <a href="http://zguide.zeromq.org/py%3aall#toc98" rel="nofollow" title="majordomo pattern">majordomo pattern</a>. It's setup this way: </p>
  
  <ul>
  <li>each machine on the network has a <strong>client/worker</strong> pair</li>
  <li>they connect to a <em>'server'</em> <strong>broker</strong> via pyzmq and register <strong>sessions</strong></li>
  <li><strong>sessions</strong> are broadcasted by <em>'server'</em> <strong>broker</strong> to <strong>clients</strong></li>
  <li>when <em>'sender</em>' <strong>client</strong> sends a message to a specific <strong>session</strong>, <strong>broker</strong> routes the message to the corresponding <strong>worker</strong> destination, a <em>reply</em> is generated by <strong>worker</strong>, and it gets routed by the broker back to the <em>'sender'</em> <strong>client</strong> (ending loop, confirming delivery)</li>
  </ul>
  
  <p>Everything is working well, text messages are formed in 'client' pyqt UI and received by 'worker'pyqt UI. 
  Now I'm looking to build upon this skeleton to add video chat to my application... I have been looking into webRTC and would like to find a way to implement it.</p>
  
  <p>This is how webRTC  works From what I gather (<strong>could be severely wrong here, please correct me</strong>):</p>
  
  <ul>
  <li><strong>Machine A</strong>'s Chrome browser opens local video/audio stream from webcam/mic via <em>javascript function</em>
  <strong>webkitGetUserMedia</strong>, then creates a <em>(Machine A)</em> <strong>URL</strong> for the stream via <em>javascript function</em> <strong>webkitURL</strong></li>
  <li>Sends <em>(Machine A)</em> <strong>URL</strong> to <strong>Machine B</strong>'s Chrome browser via <strong>signaling server</strong></li>
  <li><strong>Machine B</strong>'s Chrome browser accepts and loads <em>(Machine A)</em> <strong>URL</strong>, sets up it's own local video/audio stream from webcam.mic via previously mentioned <em>javascript functions</em> and replies with a <em>(Machine B)</em> <strong>URL</strong> back to <strong>Machine A</strong> via <strong>signaling server</strong></li>
  <li><strong>Machine A</strong>'s Chrome browser is displaying <em>(Machine B)</em> video/audio | <strong>Machine B</strong>'s Chrome browser is displaying <em>(Machine A)</em> video/audio</li>
  </ul>
  
  <p>Is that the process? or is this a totally wring assumption of how peers connect to each other?</p>
  
  <p>If Correct , I would like to adapt my current pyzmq application to act as a signaling server for creating connections between machines, Since IP addresses of my machines are known to me and I can configure my firewall to give access to needed ports I'm trying to eliminate any extra STUN/TURN servers for this setup, I am not planning to go outside of my LAN and access remote machines. And I would like to handle everything(as much as possible) with Python and included batteries(Avoiding Node.js).</p>
  
  <p>So the main question is how should I go about integrating webRTC to my setup? Does webRTC need specific prerequisite libraries or API to be built and running on the signaling server or peer machines? any code examples/advice/links would be appreciated.</p>