Skip to content

bredele/signal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

signal

peer plugin to connect two remote peer connections through websocket.

Installation

with component:

$ component install bredele/signal

Usage

signal is a one liner to exchange peer session descriptions and initialize a remote peer to peer connection.

var peer = require('peer');
var chat = peer();

// connect to room foo
chat.use(signal('foo'));

use it with channel to create a chat application in a couple of lines:

var chat = peer();

chat.use(channel('foo'));
chat.use(signal('foo'));

chat.send('hello world');

signal uses the socket.io client so make sure you required it before (see example).

Signaling server

signal needs a signaling server to exchange metadata (sessions, ice candidates, etc) in order to initiate a remote peer to peer connection. You'll find a dummy implementation here.

Here's ths signaling spec used by signal:

  • join join room
  • candidate get master and slave ice candidate and broadcast it
  • master offer get session description from master peer and broadcast it
  • slave offer get session description from slave peer and broadcast it

The spec will probably change in the future to support rooms with more than two peer.

License

The MIT License (MIT)

Copyright (c) 2014 Olivier Wietrich

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

peer plugin to connect remote peer connections

Resources

License

Stars

Watchers

Forks

Packages

No packages published