npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

skyway-signaling-gateway

v0.5.6

Published

A protocol gateway for Janus Gateway REST API and SkyWay Signaling Server

Downloads

2

Readme

SSG - Skyway Signaling Gateway

Signaling Gateway for Skyway and Janus Gateway

How to install and setup

$ npm -g install skyway-signaling-gateway
$ ssg setup
# register your API key.
$ ssg start

Supported features

We support three features shown below.

  1. bidirectional data channel communication
  • 3rd party interface is TCP (by default 15000)
  • interface for janus skyway plugin is also TCP (by default 14999)
  1. one-way media stream from Janus Gateway
  • leveraging streaming plugin of Janus Gateway
  1. one-way voice stream to Janus Gateway
  • 3rd party interface for this is UDP (by default 25000)

Below, we'll show up web Snipets for web app, iOS, Android to utilize these features leveraging SkyWay SDK.

web app

initialize peer

const mypeerid;
const peer = new Peer(key: MY_APIKEY);

peer.on('open', id => { mypeerid = id; });

use data channel

const conn = peer.connect(PEERID_OF_SSG, {serialization: "none", reliable: true});
conn.on('open', () => { conn.send('hello'); });

upstream client side media

navigator.mediaDevices.getUserMedia({audio: true, video: false})
  .then( stream => { peer.call(PEERID_OF_SSG, stream) } );

get media downstream from Janus Gateway

// we assume datachannel already establlished.

// set handler for Janus side media stream.
peer.on('call', stream => { $("#video").attr("src", window.URL.createObjectURL(stream) });

// request call
conn.send(`SSG:stream/start,${mypeerid}`)
...

// stop call
conn.send('SSG:stream/stop');

how to set SSG's peerid

You have two way.

  • set it in conf/skyway.yaml
  • set PEERID environment while running process
$ PEERID=ssgid node app.js

(preamble of SSG_ will be added to assigned peerid)

setting envronment will overwrite it in skyway.yaml

force OPUS

By setting FORCE_OPUS=true while starting process, you can force audio codec to opus from client to Janus Gateway.

$ FORCE_OPUS=true node app

setup apikey, origin, secure and uuid parameters from environment for development purpose

use SSG_APIKEY, SSG_ORIGIN, SSG_SECURE and SSG_UUID for each

SSG_APIKEY=XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXX SSG_ORIGIN=http://localhost SSG_UUID="test-uuid" node app.js

join room without 3rd party appp

use ROOMNAME env

ROOMNAME=testroom node app.js

set janus parameter with environment

  • JANUS_REST_SCHEME
    • http or https
  • JANUS_ENDPOINT_ADDR
    • e.g. localhost
  • JANUS_REST_PORT
    • e.g. 8089
  • JANUS_DATA_PORT
    • e.g. 14999

use MQTT interface

use MQTT_TOPIC and MQTT_URL env

MQTT_URL=mqtt://localhost MQTT_TOPIC=testtopic node app.js

How to test MQTT

  • Install mosquitto
$ sudo apt-get -y install mosquitto
  • test with mosquitto_client

Install mosquitto client

$ sudo apt-get -y install mosquitto-clients

publish

$ mosquitto_pub -m 'test' -t 'testtopic/a'

subscribe

$ mosquitto_sub -t 'testtopic/a'

Testing

run unit test

$ npm test

watch

$ npm run test:watch

license Apache-2.0