{
  "name": "express-http-proxy",
  "version": "0.6.0",
  "description": "http proxy middleware for express",
  "main": "index.js",
  "scripts": {
    "test": "npm run lint && ./node_modules/.bin/mocha -R spec test/test.js",
    "lint": "./node_modules/.bin/jshint index.js test/*.js"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/villadora/express-http-proxy.git"
  },
  "keywords": [
    "express-http-proxy"
  ],
  "engines": {
    "node": ">=0.10.0"
  },
  "author": {
    "name": "villadora",
    "email": "jky239@gmail.com"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/villadora/express-http-proxy/issues"
  },
  "devDependencies": {
    "express": "^4.3.1",
    "iconv": "^2.1.4",
    "jshint": "^2.5.5",
    "mocha": "^2.1.0",
    "supertest": "^0.13.0"
  },
  "dependencies": {
    "type-is": "^1.2.0",
    "raw-body": "^1.1.6"
  },
  "contributors": [
    {
      "name": "Liam Bennett"
    },
    {
      "name": "eldereal",
      "url": "https://github.com/eldereal"
    },
    {
      "name": "Saulius Menkevičius",
      "url": "https://github.com/razzmatazz"
    },
    {
      "name": "Jérémy Lal",
      "email": "kapouer@melix.org"
    },
    {
      "name": "Wei Gao",
      "email": "jky239@gmail.com"
    }
  ],
  "readme": "# express-http-proxy [![NPM version](https://badge.fury.io/js/express-http-proxy.svg)](http://badge.fury.io/js/express-http-proxy) [![Build Status](https://travis-ci.org/villadora/express-http-proxy.svg?branch=master)](https://travis-ci.org/villadora/express-http-proxy) [![Dependency Status](https://gemnasium.com/villadora/express-http-proxy.svg)](https://gemnasium.com/villadora/express-http-proxy)\n\n\nExpress proxy middleware to forward request to another host and pass response back\n\n## Install\n\n```bash\n$ npm install express-http-proxy --save\n```\n\n## Usage\n\n```js\nvar proxy = require('express-http-proxy');\n\nvar app = require('express')();\n\napp.use('/proxy', proxy('www.google.com', {\n  forwardPath: function(req, res) {\n    return require('url').parse(req.url).path;\n  }\n}));\n\n```\n\nIf you only want to proxy get request\n\n\n```js\napp.use('/proxy', proxy('www.google.com', {\n  filter: function(req, res) {\n     return req.method == 'GET';\n  },\n  forwardPath: function(req, res) {\n    return require('url').parse(req.url).path;\n  }\n}));\n```\n\n\n\nYou can also intercept the response before sending it back to the client, or change the request options before it is sent to the target:\n\n```js\napp.use('/proxy', proxy('www.google.com', {\n  forwardPath: function(req, res) {\n    return require('url').parse(req.url).path;\n  },\n  intercept: function(rsp, data, req, res, callback) {\n       // rsp - original response from the target\n       data = JSON.parse(data.toString('utf8'));\n       callback(null, JSON.stringify(data));\n  },\n  decorateRequest: function(req) {\n       req.headers['Content-Type'] = '';\n       req.method = 'GET';\n       req.bodyContent = wrap(req.bodyContent);\n       return req;\n  }\n}));\n\n```\n\n## Release Notes\n\n| Release | Notes |\n| --- | --- |\n| 0.4.0 | Signature of `intercept` callback changed from `function(data, req, res, callback)` to `function(rsp, data, req, res, callback)` where `rsp` is the original response from the target |\n\n## Licence\n\nMIT\n<!-- do not want to make nodeinit to complicated, you can edit this whenever you want. -->\n",
  "readmeFilename": "README.md",
  "_id": "express-http-proxy@0.6.0",
  "_from": "express-http-proxy@^0.6.0"
}
