Node.js server to receive events from a Janus server.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src update to work with node 10.x Oct 20, 2018
.gitignore
LICENSE add README and LICENSE Feb 21, 2017
README.md specify convention for plugin config options Feb 23, 2017
TODO.md
package.json update to work with node 10.x Oct 20, 2018

README.md

Overview

This server follows a dead simple plugin workflow: received events are passed directly to one or more configured plugins, which handle the processing of the event.

Setup process for Janus can be found here.

Installation

  • npm install
  • cp src/config.sample.js src/config.js, edit to taste
  • node src/server.js

Configuration

See the sample config for all configuration options.

Plugins

Currently implemented plugins are:

  • console: Write events to console.
  • file: Write events to a file (currently only supports JSON format).

Using plugins

  • Enable the plugin by adding it to the config.enabledPlugins array in the configuration file
  • Set any appropriate config options for the plugin, eg. config.plugin.file.outputFile = '/tmp/foo';

Writing plugins

A plugin must export a function which returns an object with one method, handleEvent.

The function receives two arguments:

  • config: The server configuration object.
  • logger: The server logging instance, should you wish to use it for logging purposes.

The console plugin provides the most simple example of the implementation.

Configuration options for a plugin can technically be in any structure in the configuration file, but by convention should go under their own config.plugin.[name of plugin] object.