First native version of the NDN protocol written in Javascript ( Also refereed 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 ccnx protocol

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

Firefox uses the protocol extension to load any URI starting with ccnx, for example
ccnx:/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 ccnx protocol

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

The browser loads the latest version and changes the address to:
ccnx:/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-ccnx 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:
ccnx.MinSuffixComponent= non-negative int
ccnx.MaxSuffixComponents= non-negative int
ccnx.ChildSelector= non-negative int
ccnx.AnswerOriginKind= non-negative int
ccnx.Scope= non-negative int
ccnx.InterestLifetime= non-negative int
ccnx.PublisherPublicKeyDigest= % escaped value
ccnx.Nonce= % escaped value

TODO: implement ccnx.Exclude. 

* Multiple segments in the ccnx 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.

