Skip to content
Browse files

example + handling import of package

  • Loading branch information...
1 parent 81aaeba commit 29c95fba7e3fbc8d1a33e889b3c6a7d3ec7acfb8 @ssbanerje ssbanerje committed Nov 3, 2011
Showing with 21 additions and 0 deletions.
  1. +16 −0 examples/load-balancing/polling_webserver.js
  2. +5 −0 index.js
View
16 examples/load-balancing/polling_webserver.js
@@ -0,0 +1,16 @@
+var ndns = require('../../lib/ndns');
+var http = require('http');
+
+ndns.poller.client.startPoller();
+
+http.createServer(function (req, res) {
+ var startTime = new Date();
+
+ res.writeHead(200, {'Content-Type': 'text/plain'});
+ res.end('Hello World\n');
+
+ var endTime = new Date();
+ ndns.poller.client.notifyResponseTime(endTime.getTime()-startTime.getTime());
+}).listen(1337, "127.0.0.1");
+
+console.log('Server running at http://127.0.0.1:1337/');
View
5 index.js
@@ -0,0 +1,5 @@
+//
+// NDNS - DNS Server in Node
+//
+
+module.exports = require('./lib/ndns');

0 comments on commit 29c95fb

Please sign in to comment.
Something went wrong with that request. Please try again.