From 6b3486519ed4d4f24f5a1769fe37dc78b0235db4 Mon Sep 17 00:00:00 2001 From: Damon Oehlman Date: Thu, 14 Aug 2014 09:12:23 +1000 Subject: [PATCH] Added docs on the new primusPath option --- README.md | 16 +++++++++++++++- primus-loader.js | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 13eb187..301d4c1 100644 --- a/README.md +++ b/README.md @@ -318,12 +318,26 @@ pc.createOffer( ); ``` -### loadPrimus(signalhost, callback) +### loadPrimus(signalhost, opts?, callback) This is a convenience function that is patched into the signaller to assist with loading the `primus.js` client library from an `rtc-switchboard` signaling server. +In the case that you wish to load `primus.js` from a location other than +the default location of `{{ signalhost }}/rtc.io/primus.js` you can +provide an options object which allows for the following customizations: + +- `primusPath` (default: `/rtc.io/primus.js`) + + The path at which the `primus.js` file can be found on the signalhost. + + __NOTE:__ The above options are passed through when creating a + signaller object, and thus packages such as + [rtc-quickconnect](https://github.com/rtc-io/rtc-quickconnect) + will allow you to make the customisation with it's top level + options also. + ### signaller process handling When a signaller's underling messenger emits a `data` event this is diff --git a/primus-loader.js b/primus-loader.js index 9706b19..a8d415b 100644 --- a/primus-loader.js +++ b/primus-loader.js @@ -13,6 +13,20 @@ var primusUrl = formatter('{{ signalhost }}{{ primusPath }}'); with loading the `primus.js` client library from an `rtc-switchboard` signaling server. + In the case that you wish to load `primus.js` from a location other than + the default location of `{{ signalhost }}/rtc.io/primus.js` you can + provide an options object which allows for the following customizations: + + - `primusPath` (default: `/rtc.io/primus.js`) + + The path at which the `primus.js` file can be found on the signalhost. + + __NOTE:__ The above options are passed through when creating a + signaller object, and thus packages such as + [rtc-quickconnect](https://github.com/rtc-io/rtc-quickconnect) + will allow you to make the customisation with it's top level + options also. + **/ module.exports = function(signalhost, opts, callback) { var anchor = document.createElement('a');