#mobiletea 3
gin + tonic
navigator.getUserMedia({video: true, audio:true},
onStreamReady, onStreamError);
function createPC() {
pc = new RTCPeerConnection( configuration);
// send any ice candidates to the other peer
pc.onicecandidate = function (evt) {
signalingChannel.send(JSON.stringify({"candidate": evt.candidate }));
};
// process addition of remote streams
pc.onaddstream = function (evt) {handleIncomingStream( evt.stream);};
}
var http = require('http');
http.createServer( function (req, res) {
res.writeHead( 200, {' Content-Type': 'text/ plain'});
res.end(' Hello World!\n'); }).listen( 8500, "127.0.0.1");
console.log('Server running at http://127.0.0.1:8500/');
npm install webrtc.io
Behind the scene there is a node.js WebSocket implementation (http://einaros.github.com/ws/)