[Ndn-lib] node-browserify

Ryan Bennett nomad.ry at gmail.com
Thu Jan 23 12:20:11 PST 2014

Hey Guys,

Had to start a new thread since I wasn't a member of the mailing list when
this went out, but I have some thoughts on NDN-js + browserify:

Browserify is indeed handy, though there are a few extra caveats regarding
using it with NDN-js:

-If browserify detects use of the "Buffer" object, it pulls in a
'browserify-buffer' module, which breaks our custom buffer class.

-bundling a bundle (ie, compiling ndn-js with browserify, and then
including the bundle via browserify in a project) creates a bit of a mess.

I've taken this into account and shimmed NDN-js into a browser ready npm
module (https://npmjs.org/package/ndn-browser-shim). If you're interested
in the steps from current library to this module, I've got an overview at
http://rosewiki.org/view/ndn-browser-shim and you can check out my fork of
ndn-js at https://github.com/rynomad/ndn-js

Apologies for not keeping the list apprised of my status on this; wasn't
sure anyone would be interested... I've been using this shim to build
NDN-BrowserKit (https://github.com/rynomad/NDN-BrowserKit) quick overview
of that projects goals for anyone interested:

-One time Key + cert generation saved in browser local storage

-WebRTC signaling over NDN resulting in datachannel based Face transport
(only works in the latest chrome release with SCTP datachannels for binary

-NDN database in indexedDB (works in newer FF + chrome, but currently has
significant memory leaks)

-Basic forwarding (expanded from forwarder.jsm in main ndn-js repo).
currently tested up to 4 hops (5 browser tabs interfaced over WebRTC)

-Daemonize in a webworker to avoid blocking the UI thread with large load
(not yet started)

-ndndc style prefix registration/interface setup API (add and destroyface
loosely implimented)

-In-memory LRU/Staleness-aware cache (currently only doing exact matches
and ejecting stale content rather than simply marking)

-ndn.io object for segmentation and reassembly of JSON and BLOBs, basic
pipelining for fetching multi-segment objects. (works but could probably
use some cleanup)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndn-lib/attachments/20140123/93cfdb28/attachment-0001.html>

More information about the Ndn-lib mailing list