1.0.0 • Published 6 years ago

icebreaker.io v1.0.0

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
6 years ago

icebreaker.io

icebreaker.io enables peer-to-peer real-time communications, using WebRTC technology. It is built on top of socket.io, and it basically allows two peers to resolve how to connect over the internet and start an RTCPeerConnection. It consists in:

Context

WebRTC enables peer-to-peer communications, but the signaling methods and protocols needed for peers to discover each other are not defined by it. The reasoning behind this is summarized in the JavaScript Session Establishment Protocol (JSEP) IETF draft. This is why a signaling server is needed, so peers can discover and exchange information prior to establishing the WebRTC connection, but also after that, like:

  • ICE candidates information.
  • Session Description metadata (media details, transport addresses, etc).
  • Errors.
  • Remote peer disconnection.
  • Etc.

Installation

npm install icebreaker.io --save

How to use

icebreaker.io uses the same interface as socket.io, since it is built on top of it. As an example, below you can find how to start icebreaker.io along with Express:

const express = require('express');
const https = require('https');
const credentials = require('../your-credentials'); // credentials are needed for HTTPS
const icebreaker = require('icebreaker.io');

const app = express();
const server = https.createServer(credentials, app);
server.listen(8443);
// start signaling server
icebreaker(server);

Demo project

You can find a fully working demo project that uses both server and client icebreaker.io libraries here. It is a very basic video-chat application.

Tests

npm run test

This command runs the gulp task test, which runs the unit tests in the tests directory.

License

GPLv3