0.0.7 • Published 4 years ago

websig v0.0.7

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Introduction

Websig is P2P Signalling server for WEBRTC built on top of IPFSPubSub and WEBRTC Protocol. It is able to create peer to peer webrtc data channels and audio/video conferencing in your frontend applications

Please 🌟 the Repo if you liked it. Thanks !

Usuage

  1. Install the library
$ npm i websig --save
const websig = require('websig')
// Place in your STUN/TURN server to tackle Nating issues
const server = {
    'iceServers': [{
        'urls': 'stun:global.stun.twilio.com:3478?transport=udp'
    }]
};
const roomname = 'test';
const webrtc =  new websig(roomname, server);
// establish a webrtc datachannel connection
webrtc.ispeerjoined.subscribe(data => {
    if (data) {
        webrtc.connectWEBRTC();
        webrtc.datachannelData.subscribe(msg => {
            console.log("data is =>", msg);
        }, error => {
            console.log(error)
        })
    }
}, error => {
    console.log(error)
})
// sending message
webrtc.send('Hello World!!');

Supports

  1. Browserify
  2. React
  3. VUE

Todo

  • Support Audio/Video channels
  • Create an example app using websig
  • Add support for Angular and TS
  • Support Multi Party webrtc channels

Example app

  1. Navigate to example folder
$ cd example
$ npm i 
  1. Run browserify
$ browserify app.js -o public/js/app.js -d
  1. Run the app
$ http-server

Author

SaifRehman