Skip to content

Node.js server to receive events from a Janus server.

License

Notifications You must be signed in to change notification settings

stirlab/janus-event-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Node.js server to receive events from a Janus server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published