Client for a browser-based content distribution network using WebRTC
var webcdn = new WebCDN();
webcdn.init('ws://webcdn.michelberger.info:1337', function() {
console.log("Your WebCDN is ready!");
});Currently, we are offering a coordinator server for testing purposes at ws://webcdn.michelberger.info:1337.
$ bower install webcdnor
$ npm install webcdn-clientExposed by including webcdn.jsinto your project.
Creates a new WebCDN client:
var webcdn = new WebCDN();Optionally, the first argument of the WebCDN constructor can be an options object.
The following options are supported:
bucketUrlString - Set the root URL for static resource hosting (optional)trackGeolocationBoolean - Enable the HTML5 Geolocation API (optional)
Connects to a given coordinatorUrl and fires optionally a callback function with error signature (if any).
The client is automatically a peer of the WebCDN network identified with its uuid.
webcdn.init('ws://webcdn.michelberger.info:1337', function() {
console.log("Your WebCDN is ready!");
});Loads a specific resource identified by a unique contentHash, explicitly.
webcdn.load('35c22d5973cb21ae0887eda12185747e7a94cd74');To view the examples, clone the WebCDN repo and install the dependencies:
$ git clone [email protected]:pmichelberger/webcdn-client.git
$ cd webcdn-client
$ npm installThen run grunt and visit http://localhost:8000/examples. Open the same URL via a second browser window and visit your browser network & console panel.
To run the test suite, first install the dependencies, then run grunt and visit http:localhost:8000/tests:
$ npm install && bower install
$ grunt