cFirst native version of the NDN protocol written in Javascript (also referred to as CCN).

The goal of this project is to improve the current implementation of the NDN.JS API that allows users to create applications running on top of the NDN network. The goal is to have a lightweight version of the protocol, which can run on browsers. The main intent is to enable browser-based applications to use NDN directly without requiring a binary build of the CCNx code. In particular, the goal is to have an AJAX-style dynamic data access. The goal is also to have a lighter version of the protocol, which would be better suited for embedded systems. Furthermore, the goal is that NDN.JS communicates with CCNx nodes (routers).

The current status of NDN.JS allows for JavaScript applications running on browsers to send interest packets and retrieve data packets. This includes encoding and decoding data packets.

This is currently done in the following way:

var ndn = new NDN();
ndn.transport.connectWebSocket(ndn);
        
var AsyncGetClosure = function AsyncGetClosure() {
    // Inherit from Closure.
    Closure.call(this);
};		
AsyncGetClosure.prototype.upcall = function(kind, upcallInfo) {
    if (kind == Closure.UPCALL_CONTENT) {
        console.log("Received " + upcallInfo.contentObject.name.to_uri());
        console.log(upcallInfo.contentObject.content);
    }
    return Closure.RESULT_OK;
};

ndn.expressInterest(new Name("/ndn/ucla.edu/apps/ndn-js-test/hello.txt"), new AsyncGetClosure());

*** Firefox extension for the ndn protocol

NDN.JS also includes a Firefox extension for the ndn protocol.  To install, either download
https://github.com/remap/ndn-js/blob/master/js/ndnProtocol.xpi
or use js/ndnProtocol.xpi in the distribution.  In Firefox, open
Tools > Add-ons.  In the "gear" or "wrench" menu, click Install Add-on From File and open
ndnProtocol.xpi.  Restart Firefox.

Firefox uses the protocol extension to load any URI starting with ndn, for example
ndn:/ndn/ucla.edu/apps/lwndn-test/trig-table

When the page is loaded, Firefox updates the address bar with the full matched name from the
retrieved content object including the version, but without the implicit digest or segment number 
(see below).

* Interest selectors in the ndn protocol

You can add interest selectors. For example, this uses 1 to select the "rightmost" child (latest version).
ndn:/ndn/ucla.edu/apps/ndn-js-test/hello.txt?ndn.ChildSelector=1&key=value#ref

The browser loads the latest version and changes the address to:
ndn:/ndn/ucla.edu/apps/ndn-js-test/hello.txt/%FD%05%0B%16z%22%D1?key=value#ref

The child selector was used and removed. Note that the other non-ndn query values and 
ref "?key=value#ref" are still present, in case they are needed by the web application.

The following selector keys are supported:
ndn.MinSuffixComponent= non-negative int
ndn.MaxSuffixComponents= non-negative int
ndn.ChildSelector= non-negative int
ndn.AnswerOriginKind= non-negative int
ndn.Scope= non-negative int
ndn.InterestLifetime= non-negative int
ndn.PublisherPublicKeyDigest= % escaped value
ndn.Nonce= % escaped value

TODO: implement ndn.Exclude. 

* Multiple segments in the ndn protocol

A URI for content with multiple segments is handled as follows.
If the URI has a segment number, just retrieve that segment and return the content to the browser.

Otherwise look at the name in the returned ContentObject.  If the returned name has no segment number,
just return the content to the browser. If the name has a segment number which isn't 0, store it 
and express an interest for segment 0. Read segments in order and return each content to the browser 
as we go until we get the segment for FinalBlockID.

