0.1.0 • Published 8 years ago

http-both v0.1.0

Weekly downloads
4
License
-
Repository
github
Last release
8 years ago

HTTP-BOTH

Creates a node server that will listen for both http and https requests.

Installation

Npm

npm install http-both

Example

var both    = require('http-both');
var options = {
  key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
  cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};

// Server will handle http and https requests.
both.createServer(options, function (req, res) {
  res.writeHead(200);
  res.end("hello world\n");
}).listen(80);

Contributions

  • Use gulp to run tests.

Please feel free to create a PR!