An brief introduction with RTC.io



Completely Static

Set Timeout
setTimeout(function() {
$.get('/api/status', function(data) {
...
});
}, 5000);
WebSockets

Nice wrapper and polyfil for WebSockets
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.get(
'/',
function(req, res){
res.sendfile('index.html');
}
);
io.on(
'connection',
function(socket){
socket.on(
'chat message',
function(msg){
io.emit('chat message', msg);
}
);
}
);
http.listen(3000, function(){
console.log('listening on *:3000');
});...
<ul id="messages"></ul>
<form action="">
<input id="m" autocomplete="off" />
<button>Send</button>
</form>
<script src="/socket.io/socket.io.js" />
<script src="://code.jquery.com/jquery-1.11.1.js" />
<script>
var socket = io();
$('form').submit(function(){
socket.emit('chat message', $('#m').val());
$('#m').val('');
return false;
});
socket.on('chat message', function(msg){
$('#messages').append($('<li>').text(msg));
});
</script>
...Server
Browser

ICE

ICE
rtc.io is a collection of node.js modules that simplify WebRTC development.
https://github.com/garrows/bam
http://caniuse.com/#feat=rtcpeerconnection
