Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

example + handling import of package

  • Loading branch information...
commit 29c95fba7e3fbc8d1a33e889b3c6a7d3ec7acfb8 1 parent 81aaeba
Subho Banerjee ssbanerje authored

Showing 2 changed files with 21 additions and 0 deletions. Show diff stats Hide diff stats

  1. +16 0 examples/load-balancing/polling_webserver.js
  2. +5 0 index.js
16 examples/load-balancing/polling_webserver.js
... ... @@ -0,0 +1,16 @@
  1 +var ndns = require('../../lib/ndns');
  2 +var http = require('http');
  3 +
  4 +ndns.poller.client.startPoller();
  5 +
  6 +http.createServer(function (req, res) {
  7 + var startTime = new Date();
  8 +
  9 + res.writeHead(200, {'Content-Type': 'text/plain'});
  10 + res.end('Hello World\n');
  11 +
  12 + var endTime = new Date();
  13 + ndns.poller.client.notifyResponseTime(endTime.getTime()-startTime.getTime());
  14 +}).listen(1337, "127.0.0.1");
  15 +
  16 +console.log('Server running at http://127.0.0.1:1337/');
5 index.js
... ... @@ -0,0 +1,5 @@
  1 +//
  2 +// NDNS - DNS Server in Node
  3 +//
  4 +
  5 +module.exports = require('./lib/ndns');

0 comments on commit 29c95fb

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