{"name":"foxy","version":"3.0.0","description":"Proxy with response modding","main":"index.js","scripts":{"test":"mocha --recursive test/specs"},"repository":{"type":"git","url":"https://github.com/shakyShane/foxy"},"keywords":["proxy"],"author":{"name":"Shane Osbourne"},"license":"MIT","bugs":{"url":"https://github.com/shakyShane/foxy/issues"},"homepage":"https://github.com/shakyShane/foxy","dependencies":{"http-proxy":"^1.1.6","resp-modifier":"^0.1.2"},"devDependencies":{"browser-sync":"^1.5.2","chai":"^1.9.1","connect":"^2.15.0","connect-gzip":"^0.1.6","gulp":"^3.6.2","gulp-jshint":"^1.5.5","mocha":"^1.18.2","portscanner-plus":"^0.1.0","sinon":"^1.9.1","socket.io":"^0.9.16","socket.io-client":"^0.9.16","supertest":"^0.12.1","lodash":"^2.4.1","multiline":"^1.0.1"},"gitHead":"98db417c23b138d3eca51730f47bbb3bac753916","_id":"foxy@3.0.0","_shasum":"77b6fde54daf39753c063fb7111c3e445733d978","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"shakyshane","email":"shakyshane@gmail.com"},"maintainers":[{"name":"shakyshane","email":"shakyshane@gmail.com"}],"dist":{"shasum":"77b6fde54daf39753c063fb7111c3e445733d978","tarball":"http://registry-npm.ywwl.com/foxy/download/foxy-3.0.0.tgz","integrity":"sha512-EIWHkpElpT79Nbu5Maq1F0fTgcbVInn8j49q+8H9jUdiChKDGhwZtBqMZT5hgCscSzkExlDkSL/ty2L4YNQfMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZ19LtURuLawnudzok4uil6Che9AH7/YJH0qGIVsQbzAiAHum2WSA7jaEBOY1H/fjqJFrs/DdGI8cz2aj3An/xWxA=="}],"size":2646,"noattachment":false,"key":"/foxy/-/foxy-3.0.0.tgz"},"directories":{},"readme":"##Foxy \n[![Travis branch](https://img.shields.io/travis/shakyShane/foxy/master.svg?style=flat-square&label=linux)](https://travis-ci.org/shakyShane/foxy)\n[![AppVeyor branch](https://img.shields.io/appveyor/ci/shakyshane/foxy/master.svg?style=flat-square&label=windows)]()\n\nProxy with response moddin'\n\n##cli\nFirst, install globally\n```bash\n$ npm install -g foxy\n```\n\nThen, if you wanted to proxy a local vhost such as `http://magento.dev` run:\n```bash\n$ foxy http://magento.dev\n```\n\nA random port will be used, but if you want to provide your own:\n```bash\n$ foxy http://magento.dev --port 3000\n```\n\n##api\n```js\nvar foxy = require(\"foxy\");\n\nvar proxy = foxy(\"http://localhost:3000\").listen(8000);\n\n// Now access the site through http://localhost:8000\n```\n\nBuilt-in middleware will re-write html on the fly to update any urls & there'll also be the option\nfor additional rules for the re-writing.\n\n## Additional re-write rules\n\nLet's say you want to change the text `Home Page` to be `Homepage Rocks`, you can do that easily by \nproviding additional `rules`\n\n```js\nvar foxy = require(\"foxy\");\n\nvar config = {\n    rules: [\n        {\n            match: /Home Page/g,\n            fn: function () {\n                return \"Homepage Rocks\"\n            }\n        }\n    ]\n};\n\nvar proxy = foxy(\"http://localhost:3000\", config).listen(8000);\n```\n\n## white/black lists\n\nYou can force some paths to always be processed by the middlewares.\n\n```js\nvar proxy = foxy(\"http://wordpress.dev\", {\n    whitelist: [\"/wp-admin/admin-ajax.php\"], // whitelist checked first\n    blacklist: [\"/wp-admin/**\"],\n}).listen(8000);\n```\n\n## proxyResponse middleware\n\nYou can add middleware-like functions which process the proxy response.\n\n```js\nvar foxy = require(\"foxy\");\n\nvar config = {\n    proxyRes: [\n        function(proxyRes, req, config) {\n            // do something with the proxyRes object which comes from node-http-proxy\n        }\n    ]\n};\n\nvar proxy = foxy(\"http://localhost:3000\", config).listen(8000);\n```\n\n#TODO\n\n- [ ] https\n\n\n","publish_time":1414186030273,"_cnpm_publish_time":1414186030273,"dist-tags":{"latest":"11.1.5"}}