{"_id":"httpolyglot","_rev":"12-25b975ea2e83a0fda2ee5e59cd61fad7","name":"httpolyglot","description":"Serve http and https connections over the same port with node.js","dist-tags":{"latest":"0.1.2"},"versions":{"0.0.1":{"name":"httpolyglot","version":"0.0.1","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Serve http and https connections over the same port with node.js","main":"./index","engines":{"node":">=0.10.0"},"keywords":["http","https","multiplex","polyglot"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/httpolyglot/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/mscdex/httpolyglot.git"},"bugs":{"url":"https://github.com/mscdex/httpolyglot/issues"},"homepage":"https://github.com/mscdex/httpolyglot","_id":"httpolyglot@0.0.1","_shasum":"7af360d43d2af7bd2e17f5e27771e6dc0a861f75","_from":"https://github.com/mscdex/httpolyglot/tarball/v0.0.1","_resolved":"https://github.com/mscdex/httpolyglot/tarball/v0.0.1","scripts":{},"_npmVersion":"1.4.14","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"dist":{"shasum":"7af360d43d2af7bd2e17f5e27771e6dc0a861f75","tarball":"https://registry.npmjs.org/httpolyglot/-/httpolyglot-0.0.1.tgz","integrity":"sha512-RdHbuhN3dm7uQ0UoZPiolLEpX2gYdYcaB07GPCrsQPoYpl72OIMoMC4iMWZvJs0YOtJqvZyvkq2MyoPnVl6k3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEjcND2mH9jM7G4FNwv1iEiLgyt+83/oZeLU5yoMJhchAiEAujj6uYqdJAMvoD3KqWYPfqLxlu2FSY7cLVFcw3cLFjk="}]}},"0.0.2":{"name":"httpolyglot","version":"0.0.2","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Serve http and https connections over the same port with node.js","main":"./index","engines":{"node":">=0.10.0"},"keywords":["http","https","multiplex","polyglot"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/httpolyglot/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/mscdex/httpolyglot.git"},"bugs":{"url":"https://github.com/mscdex/httpolyglot/issues"},"homepage":"https://github.com/mscdex/httpolyglot","_id":"httpolyglot@0.0.2","_shasum":"a5fbdd5bbc12deffb790a40b02a75aa40bbbb799","_from":"https://github.com/mscdex/httpolyglot/tarball/v0.0.2","_resolved":"https://github.com/mscdex/httpolyglot/tarball/v0.0.2","scripts":{},"_npmVersion":"1.4.14","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"dist":{"shasum":"a5fbdd5bbc12deffb790a40b02a75aa40bbbb799","tarball":"https://registry.npmjs.org/httpolyglot/-/httpolyglot-0.0.2.tgz","integrity":"sha512-tcN6jCdh7PoCfcBzQYqGI1HrxNoy1GGGv/LeZQijLzMizauQlhQhWXsYa0Dpu1/kxpLoSOVCr9LCkwxCgtAyzA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH5Z/nKpPWXKN1VCd6BtxpK34ZZVy4QdTHMJ1bTXeSRLAiEAqf6WXMYPLKirusMKW+5Pkw81ou5pkMkWJKNMXCKXwro="}]}},"0.1.0":{"name":"httpolyglot","version":"0.1.0","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Serve http and https connections over the same port with node.js","main":"./index","engines":{"node":">=0.10.0"},"keywords":["http","https","multiplex","polyglot"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/httpolyglot/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/mscdex/httpolyglot.git"},"bugs":{"url":"https://github.com/mscdex/httpolyglot/issues"},"homepage":"https://github.com/mscdex/httpolyglot","_id":"httpolyglot@0.1.0","_shasum":"3407aec3cd300ef52c008ae21f6eb2633b90357c","_from":"https://github.com/mscdex/httpolyglot/tarball/v0.1.0","_resolved":"https://github.com/mscdex/httpolyglot/tarball/v0.1.0","scripts":{},"_npmVersion":"1.4.14","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"dist":{"shasum":"3407aec3cd300ef52c008ae21f6eb2633b90357c","tarball":"https://registry.npmjs.org/httpolyglot/-/httpolyglot-0.1.0.tgz","integrity":"sha512-ADrXmBotWC/l0BWmmQ7F2eba0Da5jtz3xiaychu5gqBGtMZP1fwLtcqm80jYWSEOWxWT8tx+lveIwoNuLUC5oQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2SmWHRfe9nKRQb73XxUk+wz7eGbIJh8zIlO4ZW1OfsAIhAKxiBruM4MJxIkYHCgC4rnyfLWx5pKdsbaillUcJMQ5n"}]}},"0.1.1":{"name":"httpolyglot","version":"0.1.1","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Serve http and https connections over the same port with node.js","main":"./index","engines":{"node":">=0.10.0"},"keywords":["http","https","multiplex","polyglot"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/httpolyglot/raw/master/LICENSE"}],"repository":{"type":"git","url":"http://github.com/mscdex/httpolyglot.git"},"bugs":{"url":"https://github.com/mscdex/httpolyglot/issues"},"homepage":"https://github.com/mscdex/httpolyglot","_id":"httpolyglot@0.1.1","_shasum":"cd0f5c995cbb95dde325d16a7537f90c0048e53d","_from":"https://github.com/mscdex/httpolyglot/tarball/v0.1.1","_resolved":"https://github.com/mscdex/httpolyglot/tarball/v0.1.1","scripts":{},"_npmVersion":"1.4.28","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"dist":{"shasum":"cd0f5c995cbb95dde325d16a7537f90c0048e53d","tarball":"https://registry.npmjs.org/httpolyglot/-/httpolyglot-0.1.1.tgz","integrity":"sha512-zYGgsA9zD2Rx0giv+lGz2SO/fipH//blltF/qH1eY6k+xBUidW6J6E0JoZ1YFoobIcIT8zL5jG/sB0c+oI1ZvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBXi2nfuQ2Ad7CxGc7UqOnbDPnK+RGvGFOoXrO9pG4wMAiEA/zSpVkOLQt8iRNdHDtYrt1aujBmhPKEc2Q1FxeZkxWk="}]}},"0.1.2":{"name":"httpolyglot","version":"0.1.2","author":{"name":"Brian White","email":"mscdex@mscdex.net"},"description":"Serve http and https connections over the same port with node.js","main":"./lib/index.js","scripts":{"test":"node test/test.js"},"engines":{"node":">=0.10.0"},"keywords":["http","https","multiplex","polyglot"],"licenses":[{"type":"MIT","url":"http://github.com/mscdex/httpolyglot/raw/master/LICENSE"}],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/httpolyglot.git"},"bugs":{"url":"https://github.com/mscdex/httpolyglot/issues"},"homepage":"https://github.com/mscdex/httpolyglot#readme","_id":"httpolyglot@0.1.2","_shasum":"e4d347fe8984a62f467d4060df527f1851f6997b","_resolved":"https://github.com/mscdex/httpolyglot/tarball/v0.1.2","_from":"https://github.com/mscdex/httpolyglot/tarball/v0.1.2","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"mscdex","email":"mscdex@mscdex.net"},"maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"dist":{"shasum":"e4d347fe8984a62f467d4060df527f1851f6997b","tarball":"https://registry.npmjs.org/httpolyglot/-/httpolyglot-0.1.2.tgz","integrity":"sha512-ouHI1AaQMLgn4L224527S5+vq6hgvqPteurVfbm7ChViM3He2Wa8KP1Ny7pTYd7QKnDSPKcN8JYfC8r/lmsE3A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9n42sCdxacaDJTmBJha+r++j7uP9ppPBJWs/O+DFFAQIgaY2A/U8Gcj4JiYu1F3wcJvE04Uh9AogYJqm788A0MrA="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/httpolyglot-0.1.2.tgz_1480183651862_0.46438468364067376"}}},"readme":"\nDescription\n===========\n\nA module for serving http and https connections over the same port.\n\n\nRequirements\n============\n\n* [node.js](http://nodejs.org/) -- v0.10.0 or newer\n\n\nInstall\n============\n\n npm install httpolyglot\n\n\nExamples\n========\n\n* Simple usage:\n\n```javascript\nvar httpolyglot = require('httpolyglot');\nvar fs = require('fs');\n\nhttpolyglot.createServer({\n key: fs.readFileSync('server.key'),\n cert: fs.readFileSync('server.crt')\n}, function(req, res) {\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.end((req.socket.encrypted ? 'HTTPS' : 'HTTP') + ' Connection!');\n}).listen(9000, 'localhost', function() {\n console.log('httpolyglot server listening on port 9000');\n // visit http://localhost:9000 and https://localhost:9000 in your browser ...\n});\n```\n\n* Simple redirect of all http connections to https:\n\n```javascript\nvar httpolyglot = require('httpolyglot');\nvar fs = require('fs');\n\nhttpolyglot.createServer({\n key: fs.readFileSync('server.key'),\n cert: fs.readFileSync('server.crt')\n}, function(req, res) {\n if (!req.socket.encrypted) {\n res.writeHead(301, { 'Location': 'https://localhost:9000' });\n return res.end();\n }\n res.writeHead(200, { 'Content-Type': 'text/plain' });\n res.end('Welcome, HTTPS user!');\n}).listen(9000, 'localhost', function() {\n console.log('httpolyglot server listening on port 9000');\n // visit http://localhost:9000 and https://localhost:9000 in your browser ...\n});\n```\n\n\nAPI\n===\n\nExports\n-------\n\n* **Server** - A class similar to https.Server (except instances have `setTimeout()` from http.Server).\n\n* **createServer**(< _object_ >tlsConfig[, < _function_ >requestListener]) - _Server_ - Creates and returns a new Server instance.\n\nHow it Works\n============\n\nTLS and HTTP connections are easy to distinguish based on the first byte sent by clients trying to connect. See [this comment](https://github.com/mscdex/httpolyglot/issues/3#issuecomment-173680155) for more information.\n","maintainers":[{"name":"mscdex","email":"mscdex@mscdex.net"}],"time":{"modified":"2022-06-18T22:20:58.490Z","created":"2014-07-16T02:51:57.637Z","0.0.1":"2014-07-16T02:51:57.637Z","0.0.2":"2014-07-17T02:50:37.084Z","0.1.0":"2014-07-26T15:45:41.448Z","0.1.1":"2015-02-19T21:55:52.474Z","0.1.2":"2016-11-26T18:07:32.389Z"},"homepage":"https://github.com/mscdex/httpolyglot#readme","keywords":["http","https","multiplex","polyglot"],"repository":{"type":"git","url":"git+ssh://git@github.com/mscdex/httpolyglot.git"},"author":{"name":"Brian White","email":"mscdex@mscdex.net"},"bugs":{"url":"https://github.com/mscdex/httpolyglot/issues"},"readmeFilename":"README.md","users":{"victor0801x":true}}