{"_id":"cluster-vhost","_rev":"11-d19eea1d1832b7a5730b6b2cd59b0d9c","name":"cluster-vhost","description":"virtual host setup made easy","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"cluster-vhost","description":"virtual host management using cluster","keywords":["vhost","virtual","host","domain","name"],"version":"0.1.0","homepage":"http://github.com/AndreasMadsen/cluster-vhost","repository":{"type":"git","url":"git://github.com/AndreasMadsen/cluster-vhost.git"},"author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"main":"vhost-plugin.js","dependencies":{"http-proxy":">= 0.7.3"},"engines":{"node":"0.4.x || 0.5.x"},"_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"_id":"cluster-vhost@0.1.0","devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.96","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"a3a42b919691fb05b14fb0adcf96aa48fab58310","tarball":"https://registry.npmjs.org/cluster-vhost/-/cluster-vhost-0.1.0.tgz","integrity":"sha512-FWU9jNwsPnRJbcyVKfAcKoYbj366zs9UbjSznKEn0e8/nRAUb8T7SOB87ACwdh4ex9JeiPKRQ+Ntwk75tLqkwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPUweqZuUg/hRRYtwZ/nN+IEFXCwwH3qAlHtoWgW9RdAIgL2AWkpkemzFtdPIv/TeCjlMRhQ5MlInmfZz7pOGj+Es="}]},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}]},"0.2.4":{"name":"cluster-vhost","description":"virtual host management using cluster","version":"0.2.4","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"contributors":[{"name":"Andreas Madsen","email":"amwebdk@gmail.com"}],"repository":{"type":"git","url":"git://github.com/AndreasMadsen/cluster-vhost.git"},"keywords":["vhost","virtual","host","domain","name"],"dependencies":{"http-proxy":">= 0.7.3"},"devDependencies":{"vows":">= 0.5.11"},"main":"./lib/plugin.js","scripts":{"test":"vows test/* --spec"},"engines":{"node":"0.4.x || 0.5.x"},"_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"_id":"cluster-vhost@0.2.4","_engineSupported":false,"_npmVersion":"1.0.103","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"6389c547c1c390350fd228199e4eea0938951f69","tarball":"https://registry.npmjs.org/cluster-vhost/-/cluster-vhost-0.2.4.tgz","integrity":"sha512-GLpQ9hscKIqB9reM0KZCHJESc3ZWSJ2mwB3Iq3sdbd6gT9iBDCswJL0ZHN2uWqgjWCaDAty1+3P5t5wEbDOH3w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCygaQbcJFUF2GzxJlB4DhhYAiT74Lc/uDMKyvPLUguaQIgPZKkQIyOSTgnCOvATaQXScspD8OpMlw3/LEErRz6JVw="}]},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}]},"0.2.5":{"name":"cluster-vhost","description":"virtual host management using cluster","version":"0.2.5","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"contributors":[{"name":"Andreas Madsen","email":"amwebdk@gmail.com"}],"repository":{"type":"git","url":"git://github.com/AndreasMadsen/cluster-vhost.git"},"keywords":["vhost","virtual","host","domain","name"],"dependencies":{"http-proxy":">= 0.7.3"},"devDependencies":{"vows":">= 0.5.11"},"main":"./lib/plugin.js","scripts":{"test":"vows test/* --spec"},"engines":{"node":"0.4.x"},"_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"_id":"cluster-vhost@0.2.5","_engineSupported":false,"_npmVersion":"1.0.103","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"1874f5d1bec7fad5955b0a0d2a515fbe94e63a6a","tarball":"https://registry.npmjs.org/cluster-vhost/-/cluster-vhost-0.2.5.tgz","integrity":"sha512-kg6UkHV7kj4PWs/xj4j/GAvdUNGtNj4fTGxAH3YP59F7GcKaif1LiBLNb5ZjhDseKkI4F4MAvOnUP9b7tIFnRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDZRSL4ZTTbmzytpZ2cknvYB8fiun7SKwIQ4FF6duw7AIhAJ8AWzdSd9ZUBxIDxdhZleduqweYNLHPCIk4Nz3CQClW"}]},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}]},"1.0.0":{"name":"cluster-vhost","description":"virtual host setup made easy","version":"1.0.0","author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"scripts":{"test":"vows test/simple/* --spec --isolate"},"bin":{"vhost":"./bin/vhost"},"main":"./lib/module.js","repository":{"type":"git","url":"git://github.com/AndreasMadsen/cluster-vhost.git"},"keywords":["vhost","virtual","host","domain","name"],"dependencies":{"http-proxy":"0.8.x","immortal":"0.3.x","thintalk":"0.3.x","configme":"*"},"devDependencies":{"vows":"0.6.x","request":"2.9.x"},"license":"GPLv3","engines":{"node":">= 0.7"},"_npmUser":{"name":"andreasmadsen","email":"amwebdk@gmail.com"},"_id":"cluster-vhost@1.0.0","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.4","_nodeVersion":"v0.7.6-pre","_defaultsLoaded":true,"dist":{"shasum":"66834328ec00ca734b8abb83601b64e1918351a6","tarball":"https://registry.npmjs.org/cluster-vhost/-/cluster-vhost-1.0.0.tgz","integrity":"sha512-ziwonHgbWcfkp4Gb8IMhX39bN9HJQN36iwJ5nfGRSyxXsxhsY5yCXD6uJxHqI+y0llPe6KF7kgn3jQSPSsTZ+w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICgmYkggRaRCCK7Y1fk4cRw81KM0WDsl58s2MN1amMiUAiEAjL2WtgmRdRJLNsGKAPLgWwrinabiK0nAjMZWaoHPhTs="}]},"readme":"#cluster-vhost\n\n> cluster-vhost is a module there allow you to use as many virtual host domains\n  as you which. It is often used in combination with the\n  [cluster](http://nodejs.org/docs/latest/api/cluster.html) module but it is\n  not required.\n>\n> This module require node 0.7.0-pre or higher since the 0.6.0 cluster module isn't sophisticated enough.\n\n## Features\n - Ridiculously easy to use\n - Support http to http proxy\n - Support https to http proxy\n\n##How to use\n\n####Install:\n\n```shell\nnpm install cluster-vhost\n```\n\n####Use:\n\n```javascript\nvar cluster = require('cluster'),\n    vhost = require('cluster-vhost');\n\nvhost.use('example.org');\nvhost.on('done', function () {\n\tconsole.log(\"You can now access your app, by opening http://example.org:8001 in your browser\");\n});\nvhost.on('error', function (err) {\n\tconsole.error('not good');\n\tthrow err;\n});\n\n//Start cluster\ncluster.fork();\n```\n\n####Done:\n\nYou can now access your site on `http://example.org:8001`. Note that if you\nstarted your application as root you can access using `http://example.org`.\n\n##Configure host file\n\n*You will need to edit you [hosts](http://en.wikipedia.org/wiki/Hosts_file) file to redirect example.org to you own computer.*\n\nFirst open the file in you text editor.\n\n* On mac and linux you will find a file named `hosts` in  `/private/etc/`.\n* On windows you will find a file named `hosts` in `%WINDIR%\\system32\\drivers\\etc\\hosts`.\n\nAfter the line `localhost 127.0.0.1` create a new line with the text `example.org 127.0.0.1`.\nThe result will be:\n\n```javascript\nlocalhost   127.0.0.1\nexample.org 127.0.0.1\n```\n\n##Configure the proxy-server\n\n###Creating the file<br>\n*You do not need to create a configuration file, if none is found the module will use default values.*\n\n`cluster-vhost` can be configured with a `config.json` file. The first\nstep is to create it the in the right directory. This module will search\nfor `config.json` in its own directory and then go up in the folder tree\nuntil it finds a `config.json` file.\n\nExample: if you have your websites in `~/Sites/` and typed `npm install cluster-vhost`\nhere, you will have it in a `node_modules` folder. `cluster-vhost` will then search for\na `config.json` file in the following directories:\n\n```text\n~/Sites/node_modules/cluster-vhost/config.json\n~/Sites/node_modules/config.json\n~/Sites/config.json\n~/config.json\n```\n\n####Alternative configuration method\n\nInstead of searching for `config.json` you can also configure the `proxy-server` by using the `vhost.config()`\nmethod.\n\n`vhost.config()` method accepts a filepath or an object.\n\n* If a filepath is given it must contain a valid json string.\n* If a object is given it must contain a valid json object.\n\n```javascript\nvar cluster = require(\"cluster\"),\n\tvhost = require(\"cluster-vhost\");\n\nvhost.config('./config.json');\nvhost.use('example.org');\n\n//Start cluster\ncluster.autoFork();\n```\n\n###Writing the file\n\nBecause another `node-module` may also use your a `config.json` file,\nall `cluster-vhost` properties should be placed in a `vhost` object.\nThere are several properties you can set, all will fallback to its\ndefault value if not set.\n\n```javascript\n{\n    //Because other modules may use a config.json file place you options insite a vhost obejct.\n    \"vhost\" : {\n\n        //You can specify on what the virtual host router should listen on.\n        //You can also set it to false if you don't want it to listen for http requests.\n        \"http\" : {\n\n            //By default it will listen for http requests on 127.0.0.1:8001\n            \"port\" : 8001,\n            \"host\" : \"127.0.0.1\",\n\n            //You can also use a unix path to listen on, but this will only work if no port property is set.\n            \"path\" : \"./custom/unix/http.sock\"\n        },\n\n        //The ssl property is a path to a directory containing a key.pem and a cert.pem file.\n        //By default the ssl property is set to undefined.\n        \"ssl\" : \"./Sites/ssl/\",\n\n        //If and only if a ssl property is set you can use https, else it will fallback to false.\n        //You can in this object specify what the virtual host router should listen on, just like the http object.\n        \"https\" : {\n\n            //By default if the ssl property is set it will listen for https requests on 127.0.0.1:8002\n            \"port\" : 8002,\n            \"host\" : \"127.0.0.1\",\n\n            //Again you can also use a unix path\n            \"path\" : \"./custom/unix/https.sock\"\n        }\n    }\n}\n```\n\n##Thanks to\n\n* http-proxy-server (nodejitsu) https://github.com/nodejitsu/node-http-proxy\n\n##License\nWebNodes use the \"GPL License Version 3\"","maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}]}},"maintainers":[{"name":"andreasmadsen","email":"amwebdk@gmail.com"}],"time":{"modified":"2022-06-13T06:17:48.980Z","created":"2011-10-15T16:06:20.151Z","0.1.0":"2011-10-15T16:06:21.711Z","0.2.4":"2011-11-05T12:45:55.837Z","0.2.5":"2011-11-05T12:51:57.801Z","1.0.0":"2012-03-14T18:19:26.997Z"},"author":{"name":"Andreas Madsen","email":"amwebdk@gmail.com"},"repository":{"type":"git","url":"git://github.com/AndreasMadsen/cluster-vhost.git"}}