A plugin for Authorify that enable websockets. A provided router allow to use both http and websockets like a REST server. When the plugin is loaded it is available under the main namespace of the host application: app.plugin['your short plugin name'].
authorify-websocket as usual:
$ npm install --save authorify-websocket
var restify = ;var authorify =//... options;// create the http servervar server = restify;// add plugin to the serverauthorify;// get the loaded pluginvar ws = authorifypluginws;// create the websocket serverws;var router = wsrouter;// add routesrouter;router;router;router;// start the serverserver;
// create the clientvar client =//... options;// add plugin to the clientclient;
To create a single file to use in browser environment use a simple script that uses
and add the obtained
authorify-websocket.js file to your
NOTE: this file must be added AFTER
authorify.js (the client) and BEFORE your script (
index.js in this example):
// index.jsvar client = authorify; // authorify is a global exposed by authorify-client// configure the clientclient;// load pluginclient;// request a resourcevar message = field1: 'value1' field2: 'value2' ;client;
// index.html// this is the browser version of Authorify-Client
Au usual we use mocha as test framework and you can run all tests simply typing:
$ npm test
A full test for both server and client side is available into authorify package.
For more information about the client please read authorify-client documentation and the local documentation into doc` folder.
To create your own documentation you must install JSDuck and type in your terminal:
$ cd /path-of-package $ ./gen_doc.sh
See full documentation into doc folder.
The version number is laid out as: major.minor.patch and tries to follow semver as closely as possible but this is how we use our version numbering:
A major and possible breaking change has been made in the authorify core. These changes could be not backwards compatible with older versions.
New features are added or a big change has happened with one of the third party libraries.
A bug has been fixed, without any major internal and breaking changes.
To contribute to the project follow the GitHub guidelines.
This program is released under a GNU Affero General Public License version 3 or above, which in summary means:
For more convoluted language, see the LICENSE file.