UNPKG

ndn-forwarder

Version:

NDN Forwarding daemon for node.js and the browser

14 lines (10 loc) 415 B
var ndn = require("ndn-lib") var utils = require("ndn-utils") var face = new ndn.Face({host:"localhost", port: 6464}) function onData(interest, data){ console.log("got data", interest, data) } var inst = new ndn.Interest(new ndn.Name("wiki/page/welcome-visitors")) inst.setInterestLifetimeMilliseconds(12000) console.log(inst.name.size()) face.expressInterest(inst, onData, function(){console.log("timeout")})