{"_id":"@yqg/http-proxy-middleware","_rev":"39-4a52a7d6c0eea6e9cd33777b82bd5171","name":"@yqg/http-proxy-middleware","dist-tags":{"alpha":"2.1.0-alpha.1","latest":"2.1.6"},"versions":{"2.1.0-alpha":{"name":"@yqg/http-proxy-middleware","version":"2.1.0-alpha","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","_id":"@yqg/http-proxy-middleware@2.1.0-alpha","maintainers":[{"name":"jxlnljt","email":"jxlnljt@163.com"},{"name":"yqg-owner","email":"developer@yangqianguan.com"},{"name":"yulodl","email":"yulodl@gmail.com"},{"name":"center620","email":"463867101@qq.com"},{"name":"zhchy","email":"zhchy666@gmail.com"},{"name":"guxiaodai","email":"1839815933@qq.com"},{"name":"northseacoder","email":"646388689@qq.com"},{"name":"wenxiujiang","email":"wenxiu_jiang@163.com"},{"name":"zzj5470816","email":"zhangzhijie547@163.com"},{"name":"lixiaoxue","email":"523786175@qq.com"},{"name":"yyh_","email":"2938025925@qq.com"},{"name":"szll","email":"1004274212@qq.com"},{"name":"zhayoyang","email":"2251396833@qq.com"}],"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"dist":{"shasum":"81a183be3ae7e7e12c7c14655cf95064971bcebe","tarball":"https://registry.npmjs.org/@yqg/http-proxy-middleware/-/http-proxy-middleware-2.1.0-alpha.tgz","fileCount":33,"integrity":"sha512-+gt+emp1TPqy7kLg98jHK21uNjJ6+/LQ0ZFPk9Cm1hBRPtonJV2ILKmRedlgHuNDyuR5AOzou8aKkd1hl0+RCg==","signatures":[{"sig":"MEUCIGmaa1Qm0TT8ehgK7LzjnZnPq6gE5r1hDoh46anDlDV+AiEAlqb+m2nY8I8KB7949AUHjJKxulLHWxNZseqlQO6kJqM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":65996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNZVYCRA9TVsSAnZWagAAd0UP/RMyk94j29Pm8kHp96T4\n6XxGFBhII177lB2y9eU1As2oj+kS5JJ8QFxPYTu7Jjt1Kfm04E5wXCXuUSSM\nFj1FmEReyIEuCuUAUkd0FpndS+JPVTNgA2gohi8xcDC+pdtmJ4jgRXg+M7NE\ngx+UHALSocv/7Lsjm89krIAwpNIDDBqSdU7yARyi6Csjnu29jYbQlLGya907\nEHQExiFcZGLPo4fbOlccr6Grjun2Y5JsayInKdHEe7h0MuP+2fnV/oL86ld5\nm7835tEPR8TdDZCSdV0DbDPZMLCmnfBE7iLBwGLhMxJIcXgMFuHoeCTqVUeG\n/lW1haT1hMFIhseWa3+23vD77bEbamdPT+tyKRtI4/e5yMVspV3wkTCypUfU\n05dTBZlgiBPGRNwvJOfG3UtCKTszbZQkyypoYJOukK2AP+Q2S1vdNYncTrD7\nahdRapyJDtj1yq/XaCxVZVG9NRSZC5+ylpaFRZlSellQS96doTGlzXPGR3IX\nXSx6ETYqj1M+OEc+0ELqWLa/NsEmJ5bQEa/0ruAluqW/Qqe+RKSxXoSlISLw\nEVcbPpIcQI5rTHh+ItTWj+x6sKSYQvNenIjZl94mg5RatL3eTz6t8t5uWHVU\n7T2ZWrPA7MLsDL3pjkJmJIMTD+e5C3/m264tOpwBk5QN6qfXushCsyBGqAr1\n8dP2\r\n=krB0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.0.0"},"gitHead":"454969fea7df0ad0fee85bec23675dbd76e2e2d1","scripts":{"lint":"yarn prettier && yarn eslint","test":"jest","build":"tsc","clean":"rm -rf dist && rm -rf coverage","eslint":"eslint '{src,test}/**/*.ts'","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo","pretest":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","lint:fix":"yarn prettier:fix && yarn eslint:fix","prebuild":"yarn clean","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","eslint:fix":"yarn eslint --fix","precoverage":"yarn build","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\""},"_npmUser":{"name":"yulodl","email":"yulodl@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"_npmVersion":"7.21.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","directories":{},"_nodeVersion":"16.8.0","dependencies":{"is-glob":"^4.0.1","http-proxy":"^1.18.1","micromatch":"^4.0.2","body-parser":"^1.19.0","is-plain-obj":"^3.0.0","@types/http-proxy":"^1.17.5"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.1.0","jest":"^27.0.6","open":"^8.2.1","husky":"^7.0.1","eslint":"^7.32.0","connect":"^3.7.0","express":"^4.17.1","mockttp":"^2.2.2","ts-jest":"^27.0.4","get-port":"^5.1.1","prettier":"^2.3.2","@types/ws":"^7.4.7","supertest":"^6.1.5","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","lint-staged":"^11.1.2","browser-sync":"^2.27.5","@types/express":"^4.17.13","@types/is-glob":"^4.0.2","@commitlint/cli":"^13.1.0","@types/supertest":"^2.0.11","@types/micromatch":"^4.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.29.1","@commitlint/config-conventional":"^13.1.0","@typescript-eslint/eslint-plugin":"^4.29.1"},"_npmOperationalInternal":{"tmp":"tmp/http-proxy-middleware_2.1.0-alpha_1630901592328_0.7540796508985455","host":"s3://npm-registry-packages"}},"2.1.0-alpha.1":{"name":"@yqg/http-proxy-middleware","version":"2.1.0-alpha.1","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","_id":"@yqg/http-proxy-middleware@2.1.0-alpha.1","maintainers":[{"name":"jxlnljt","email":"jxlnljt@163.com"},{"name":"yqg-owner","email":"developer@yangqianguan.com"},{"name":"yulodl","email":"yulodl@gmail.com"},{"name":"center620","email":"463867101@qq.com"},{"name":"zhchy","email":"zhchy666@gmail.com"},{"name":"guxiaodai","email":"1839815933@qq.com"},{"name":"northseacoder","email":"646388689@qq.com"},{"name":"wenxiujiang","email":"wenxiu_jiang@163.com"},{"name":"zzj5470816","email":"zhangzhijie547@163.com"},{"name":"lixiaoxue","email":"523786175@qq.com"},{"name":"yyh_","email":"2938025925@qq.com"},{"name":"szll","email":"1004274212@qq.com"},{"name":"zhayoyang","email":"2251396833@qq.com"}],"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"dist":{"shasum":"36a41378f4a432700cf714a223f0e88fbfa1bc9b","tarball":"https://registry.npmjs.org/@yqg/http-proxy-middleware/-/http-proxy-middleware-2.1.0-alpha.1.tgz","fileCount":33,"integrity":"sha512-qADUV3uwTumuEwye6uECiIBhY3g+VGYfv1LsCXERPZw8+ZnRi5NeqRNfEGscyR7GMSB15/stqtjnFTp/uxpFGA==","signatures":[{"sig":"MEUCIF1MhY2gMjk1bElu/4323dFEw59WCnfa/+dh4GTXYRPjAiEA6CvXmnvq/ClqJjbc/VRcwgWWI0TAo/ukTfUQIrwIgZ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":66303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhNxL9CRA9TVsSAnZWagAAyZkP/2uoJsDCzyzjjmyafIlH\niH/3izky9eIMCC13PjV+o9S6fz3Wp07dq4sxbSGrp8DFpXGfOoQ3IjqTstds\nYCxDJBi6TmZtbiWGPatfA/6coGZSwQ9ZR+/jIm41uKoSmDKRceNKWnBAQyDt\nGnXeRuHFBifmQeF2O8OhLX4bksrenvbjttV+zUgHrxvwc4Jpg86sIlkFH5Ls\nv7rPo0ZsUa3MNS4LIY6Uo/WneYBA1jdmTKJZ7aXjVETu30X1+dC+vmXHIn3Z\nLmDJvYr3tzdEjw8Fr/hECBhCtJf3JiJ7TuOjme1jp2Jf0zE42OT9CamlVFb6\nkqj0JSsQOOcDcmEugGLfc91wkJsoDnB13EYaPlNwOzfeS0sxMC3u33EpVRHy\ngXxcmFVSivmsqDcXNEnMVVIkC5O2eKwqhl647sJT7fy2/kvL6B8oUXZvKjUk\nK/+dWLTU9ImxOf7jcjN3E+UvRPtCPNxmguEWmv07PkMBPPZlfU0S06NR+nez\nywWzZ6TsgKDEzSyD07alx6fKhGRtnUG+OWW/SLjTHaqwtjIDfYRwsJ+0ZQGK\neFpI2IixD1/4blm+lV9xSbGFbLsxMRnI3i4asAh76fOX67pb4nSpREc6LLSg\n2DkPO+TrOa7tTFe9Nj1prx5r91DPT4y3VY2eAWxqEsGMiDcWnPwmeh5C1LRO\n61in\r\n=9eKd\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","readme":"# http-proxy-middleware\n\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/chimurai/http-proxy-middleware/CI/master?style=flat-square)](https://github.com/chimurai/http-proxy-middleware/actions?query=branch%3Amaster)\n[![Coveralls](https://img.shields.io/coveralls/chimurai/http-proxy-middleware.svg?style=flat-square)](https://coveralls.io/r/chimurai/http-proxy-middleware)\n[![dependency Status](https://img.shields.io/david/chimurai/http-proxy-middleware.svg?style=flat-square)](https://david-dm.org/chimurai/http-proxy-middleware#info=dependencies)\n[![dependency Status](https://snyk.io/test/npm/http-proxy-middleware/badge.svg?style=flat-square)](https://snyk.io/test/npm/http-proxy-middleware)\n[![npm](https://img.shields.io/npm/v/http-proxy-middleware?color=%23CC3534&style=flat-square)](https://www.npmjs.com/package/http-proxy-middleware)\n\nNode.js proxying made simple. Enable load balance & retryable. Configure proxy middleware with ease for [connect](https://github.com/senchalabs/connect), [express](https://github.com/strongloop/express), [browser-sync](https://github.com/BrowserSync/browser-sync) and [many more](#compatible-servers).\n\nPowered by the popular Nodejitsu [`http-proxy`](https://github.com/nodejitsu/node-http-proxy). [![GitHub stars](https://img.shields.io/github/stars/nodejitsu/node-http-proxy.svg?style=social&label=Star)](https://github.com/nodejitsu/node-http-proxy)\n\n## ⚠️ Note\n\nThis page is showing documentation for version v1.x.x ([release notes](https://github.com/chimurai/http-proxy-middleware/releases))\n\nIf you're looking for v0.x documentation. Go to:\nhttps://github.com/chimurai/http-proxy-middleware/tree/v0.21.0#readme\n\n## TL;DR\n\nProxy `/api` requests to `http://www.example.org`\n\n```javascript\n// javascript\n\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst app = express();\n\napp.use('/api', createProxyMiddleware({ target: 'http://www.example.org', changeOrigin: true }));\napp.listen(3000);\n\n// http://localhost:3000/api/foo/bar -> http://www.example.org/api/foo/bar\n```\n\n```typescript\n// typescript\n\nimport * as express from 'express';\nimport { createProxyMiddleware, Filter, Options, RequestHandler } from 'http-proxy-middleware';\n\nconst app = express();\n\napp.use('/api', createProxyMiddleware({ target: 'http://www.example.org', changeOrigin: true }));\napp.listen(3000);\n\n// http://localhost:3000/api/foo/bar -> http://www.example.org/api/foo/bar\n```\n\n_All_ `http-proxy` [options](https://github.com/nodejitsu/node-http-proxy#options) can be used, along with some extra `http-proxy-middleware` [options](#options).\n\n:bulb: **Tip:** Set the option `changeOrigin` to `true` for [name-based virtual hosted sites](http://en.wikipedia.org/wiki/Virtual_hosting#Name-based).\n\n## Table of Contents\n\n<!-- MarkdownTOC autolink=true bracket=round depth=2 -->\n\n- [Install](#install)\n- [Core concept](#core-concept)\n- [Example](#example)\n- [Context matching](#context-matching)\n- [Options](#options)\n  - [http-proxy-middleware options](#http-proxy-middleware-options)\n  - [http-proxy events](#http-proxy-events)\n  - [http-proxy options](#http-proxy-options)\n- [Shorthand](#shorthand)\n  - [app.use\\(path, proxy\\)](#appusepath-proxy)\n- [WebSocket](#websocket)\n  - [External WebSocket upgrade](#external-websocket-upgrade)\n- [Intercept and manipulate requests](#intercept-and-manipulate-requests)\n- [Intercept and manipulate responses](#intercept-and-manipulate-responses)\n- [Working examples](#working-examples)\n- [Recipes](#recipes)\n- [Compatible servers](#compatible-servers)\n- [Tests](#tests)\n- [Changelog](#changelog)\n- [License](#license)\n\n<!-- /MarkdownTOC -->\n\n## Install\n\n```bash\n$ npm install --save-dev http-proxy-middleware\n```\n\n## Core concept\n\nProxy middleware configuration.\n\n#### createProxyMiddleware([context,] config)\n\n```javascript\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst apiProxy = createProxyMiddleware('/api', { target: 'http://www.example.org' });\n//                                    \\____/   \\_____________________________/\n//                                      |                    |\n//                                    context             options\n\n// 'apiProxy' is now ready to be used as middleware in a server.\n```\n\n- **context**: Determine which requests should be proxied to the target host.\n  (more on [context matching](#context-matching))\n- **options.target**: target host to proxy to. _(protocol + host)_\n\n(full list of [`http-proxy-middleware` configuration options](#options))\n\n#### createProxyMiddleware(uri [, config])\n\n```javascript\n// shorthand syntax for the example above:\nconst apiProxy = createProxyMiddleware('http://www.example.org/api');\n```\n\nMore about the [shorthand configuration](#shorthand).\n\n## Example\n\nAn example with `express` server.\n\n```javascript\n// include dependencies\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\n// proxy middleware options\nconst options = {\n  target: 'http://www.example.org', // target host\n  changeOrigin: true, // needed for virtual hosted sites\n  ws: true, // proxy websockets\n  pathRewrite: {\n    '^/api/old-path': '/api/new-path', // rewrite path\n    '^/api/remove/path': '/path', // remove base path\n  },\n  router: {\n    // when request.headers.host == 'dev.localhost:3000',\n    // override target 'http://www.example.org' to 'http://localhost:8000'\n    'dev.localhost:3000': 'http://localhost:8000',\n  },\n};\n\n// create the proxy (without context)\nconst exampleProxy = createProxyMiddleware(options);\n\n// mount `exampleProxy` in web server\nconst app = express();\napp.use('/api', exampleProxy);\napp.listen(3000);\n```\n\n## Context matching\n\nProviding an alternative way to decide which requests should be proxied; In case you are not able to use the server's [`path` parameter](http://expressjs.com/en/4x/api.html#app.use) to mount the proxy or when you need more flexibility.\n\n[RFC 3986 `path`](https://tools.ietf.org/html/rfc3986#section-3.3) is used for context matching.\n\n```ascii\n         foo://example.com:8042/over/there?name=ferret#nose\n         \\_/   \\______________/\\_________/ \\_________/ \\__/\n          |           |            |            |        |\n       scheme     authority       path        query   fragment\n```\n\n- **path matching**\n\n  - `createProxyMiddleware({...})` - matches any path, all requests will be proxied.\n  - `createProxyMiddleware('/', {...})` - matches any path, all requests will be proxied.\n  - `createProxyMiddleware('/api', {...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `createProxyMiddleware(['/api', '/ajax', '/someotherpath'], {...})`\n\n- **wildcard path matching**\n\n  For fine-grained control you can use wildcard matching. Glob pattern matching is done by _micromatch_. Visit [micromatch](https://www.npmjs.com/package/micromatch) or [glob](https://www.npmjs.com/package/glob) for more globbing examples.\n\n  - `createProxyMiddleware('**', {...})` matches any path, all requests will be proxied.\n  - `createProxyMiddleware('**/*.html', {...})` matches any path which ends with `.html`\n  - `createProxyMiddleware('/*.html', {...})` matches paths directly under path-absolute\n  - `createProxyMiddleware('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api`\n  - `createProxyMiddleware(['/api/**', '/ajax/**'], {...})` combine multiple patterns\n  - `createProxyMiddleware(['/api/**', '!**/bad.json'], {...})` exclusion\n\n  **Note**: In multiple path matching, you cannot use string paths and wildcard paths together.\n\n- **custom matching**\n\n  For full control you can provide a custom function to determine which requests should be proxied or not.\n\n  ```javascript\n  /**\n   * @return {Boolean}\n   */\n  const filter = function (pathname, req) {\n    return pathname.match('^/api') && req.method === 'GET';\n  };\n\n  const apiProxy = createProxyMiddleware(filter, {\n    target: 'http://www.example.org',\n  });\n  ```\n\n## Options\n\n### http-proxy-middleware options\n\n- **option.pathRewrite**: object/function, rewrite target's url path. Object-keys will be used as _RegExp_ to match paths.\n\n  ```javascript\n  // rewrite path\n  pathRewrite: {'^/old/api' : '/new/api'}\n\n  // remove path\n  pathRewrite: {'^/remove/api' : ''}\n\n  // add base path\n  pathRewrite: {'^/' : '/basepath/'}\n\n  // custom rewriting\n  pathRewrite: function (path, req) { return path.replace('/api', '/base/api') }\n\n  // custom rewriting, returning Promise\n  pathRewrite: async function (path, req) {\n    const should_add_something = await httpRequestToDecideSomething(path);\n    if (should_add_something) path += \"something\";\n    return path;\n  }\n  ```\n\n- **option.router**: object/function, re-target `option.target` for specific requests.\n\n  ```javascript\n  // Use `host` and/or `path` to match requests. First match will be used.\n  // The order of the configuration matters.\n  router: {\n      'integration.localhost:3000' : 'http://localhost:8001',  // host only\n      'staging.localhost:3000'     : 'http://localhost:8002',  // host only\n      'localhost:3000/api'         : 'http://localhost:8003',  // host + path\n      '/rest'                      : 'http://localhost:8004'   // path only\n  }\n\n  // Custom router function (string target)\n  router: function(req) {\n      return 'http://localhost:8004';\n  }\n\n  // Custom router function (target object)\n  router: function(req) {\n      return {\n          protocol: 'https:', // The : is required\n          host: 'localhost',\n          port: 8004\n      };\n  }\n\n  // Asynchronous router function which returns promise\n  router: async function(req) {\n      const url = await doSomeIO();\n      return url;\n  }\n  ```\n\n- **option.logLevel**: string, ['debug', 'info', 'warn', 'error', 'silent']. Default: `'info'`\n\n- **option.logProvider**: function, modify or replace log provider. Default: `console`.\n\n  ```javascript\n  // simple replace\n  function logProvider(provider) {\n    // replace the default console log provider.\n    return require('winston');\n  }\n  ```\n\n  ```javascript\n  // verbose replacement\n  function logProvider(provider) {\n    const logger = new (require('winston').Logger)();\n\n    const myCustomProvider = {\n      log: logger.log,\n      debug: logger.debug,\n      info: logger.info,\n      warn: logger.warn,\n      error: logger.error,\n    };\n    return myCustomProvider;\n  }\n  ```\n\n### http-proxy events\n\nSubscribe to [http-proxy events](https://github.com/nodejitsu/node-http-proxy#listening-for-proxy-events):\n\n- **option.onError**: function, subscribe to http-proxy's `error` event for custom error handling.\n\n  ```javascript\n  function onError(err, req, res, target) {\n    res.writeHead(500, {\n      'Content-Type': 'text/plain',\n    });\n    res.end('Something went wrong. And we are reporting a custom error message.');\n  }\n  ```\n\n- **option.onProxyRes**: function, subscribe to http-proxy's `proxyRes` event.\n\n  ```javascript\n  function onProxyRes(proxyRes, req, res) {\n    proxyRes.headers['x-added'] = 'foobar'; // add new header to response\n    delete proxyRes.headers['x-removed']; // remove header from response\n  }\n  ```\n\n- **option.onProxyReq**: function, subscribe to http-proxy's `proxyReq` event.\n\n  ```javascript\n  function onProxyReq(proxyReq, req, res) {\n    // add custom header to request\n    proxyReq.setHeader('x-added', 'foobar');\n    // or log the req\n  }\n  ```\n\n- **option.onProxyReqWs**: function, subscribe to http-proxy's `proxyReqWs` event.\n\n  ```javascript\n  function onProxyReqWs(proxyReq, req, socket, options, head) {\n    // add custom header\n    proxyReq.setHeader('X-Special-Proxy-Header', 'foobar');\n  }\n  ```\n\n- **option.onOpen**: function, subscribe to http-proxy's `open` event.\n\n  ```javascript\n  function onOpen(proxySocket) {\n    // listen for messages coming FROM the target here\n    proxySocket.on('data', hybiParseAndLogMessage);\n  }\n  ```\n\n- **option.onClose**: function, subscribe to http-proxy's `close` event.\n\n  ```javascript\n  function onClose(res, socket, head) {\n    // view disconnected websocket connections\n    console.log('Client disconnected');\n  }\n  ```\n\n### http-proxy options\n\nThe following options are provided by the underlying [http-proxy](https://github.com/nodejitsu/node-http-proxy#options) library.\n\n- **option.target**: url string to be parsed with the url module\n- **option.forward**: url string to be parsed with the url module\n- **option.agent**: object to be passed to http(s).request (see Node's [https agent](http://nodejs.org/api/https.html#https_class_https_agent) and [http agent](http://nodejs.org/api/http.html#http_class_http_agent) objects)\n- **option.ssl**: object to be passed to https.createServer()\n- **option.ws**: true/false: if you want to proxy websockets\n- **option.xfwd**: true/false, adds x-forward headers\n- **option.secure**: true/false, if you want to verify the SSL Certs\n- **option.toProxy**: true/false, passes the absolute URL as the `path` (useful for proxying to proxies)\n- **option.prependPath**: true/false, Default: true - specify whether you want to prepend the target's path to the proxy path\n- **option.ignorePath**: true/false, Default: false - specify whether you want to ignore the proxy path of the incoming request (note: you will have to append / manually if required).\n- **option.localAddress** : Local interface string to bind for outgoing connections\n- **option.changeOrigin**: true/false, Default: false - changes the origin of the host header to the target URL\n- **option.preserveHeaderKeyCase**: true/false, Default: false - specify whether you want to keep letter case of response header key\n- **option.auth** : Basic authentication i.e. 'user:password' to compute an Authorization header.\n- **option.hostRewrite**: rewrites the location hostname on (301/302/307/308) redirects.\n- **option.autoRewrite**: rewrites the location host/port on (301/302/307/308) redirects based on requested host/port. Default: false.\n- **option.protocolRewrite**: rewrites the location protocol on (301/302/307/308) redirects to 'http' or 'https'. Default: null.\n- **option.cookieDomainRewrite**: rewrites domain of `set-cookie` headers. Possible values:\n  - `false` (default): disable cookie rewriting\n  - String: new domain, for example `cookieDomainRewrite: \"new.domain\"`. To remove the domain, use `cookieDomainRewrite: \"\"`.\n  - Object: mapping of domains to new domains, use `\"*\"` to match all domains.  \n    For example keep one domain unchanged, rewrite one domain and remove other domains:\n    ```json\n    cookieDomainRewrite: {\n      \"unchanged.domain\": \"unchanged.domain\",\n      \"old.domain\": \"new.domain\",\n      \"*\": \"\"\n    }\n    ```\n- **option.cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values:\n  - `false` (default): disable cookie rewriting\n  - String: new path, for example `cookiePathRewrite: \"/newPath/\"`. To remove the path, use `cookiePathRewrite: \"\"`. To set path to root use `cookiePathRewrite: \"/\"`.\n  - Object: mapping of paths to new paths, use `\"*\"` to match all paths.\n    For example, to keep one path unchanged, rewrite one path and remove other paths:\n    ```json\n    cookiePathRewrite: {\n      \"/unchanged.path/\": \"/unchanged.path/\",\n      \"/old.path/\": \"/new.path/\",\n      \"*\": \"\"\n    }\n    ```\n- **option.headers**: object, adds [request headers](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields). (Example: `{host:'www.example.org'}`)\n- **option.proxyTimeout**: timeout (in millis) when proxy receives no response from target\n- **option.timeout**: timeout (in millis) for incoming requests\n- **option.followRedirects**: true/false, Default: false - specify whether you want to follow redirects\n- **option.selfHandleResponse** true/false, if set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the `proxyRes` event\n- **option.buffer**: stream of data to send as the request body. Maybe you have some middleware that consumes the request stream before proxying it on e.g. If you read the body of a request into a field called 'req.rawbody' you could restream this field in the buffer option:\n\n  ```javascript\n  'use strict';\n\n  const streamify = require('stream-array');\n  const HttpProxy = require('http-proxy');\n  const proxy = new HttpProxy();\n\n  module.exports = (req, res, next) => {\n    proxy.web(\n      req,\n      res,\n      {\n        target: 'http://localhost:4003/',\n        buffer: streamify(req.rawBody),\n      },\n      next\n    );\n  };\n  ```\n\n## Shorthand\n\nUse the shorthand syntax when verbose configuration is not needed. The `context` and `option.target` will be automatically configured when shorthand is used. Options can still be used if needed.\n\n```javascript\ncreateProxyMiddleware('http://www.example.org:8000/api');\n// createProxyMiddleware('/api', {target: 'http://www.example.org:8000'});\n\ncreateProxyMiddleware('http://www.example.org:8000/api/books/*/**.json');\n// createProxyMiddleware('/api/books/*/**.json', {target: 'http://www.example.org:8000'});\n\ncreateProxyMiddleware('http://www.example.org:8000/api', { changeOrigin: true });\n// createProxyMiddleware('/api', {target: 'http://www.example.org:8000', changeOrigin: true});\n```\n\n### app.use(path, proxy)\n\nIf you want to use the server's `app.use` `path` parameter to match requests;\nCreate and mount the proxy without the http-proxy-middleware `context` parameter:\n\n```javascript\napp.use('/api', createProxyMiddleware({ target: 'http://www.example.org', changeOrigin: true }));\n```\n\n`app.use` documentation:\n\n- express: http://expressjs.com/en/4x/api.html#app.use\n- connect: https://github.com/senchalabs/connect#mount-middleware\n- polka: https://github.com/lukeed/polka#usebase-fn\n\n## WebSocket\n\n```javascript\n// verbose api\ncreateProxyMiddleware('/', { target: 'http://echo.websocket.org', ws: true });\n\n// shorthand\ncreateProxyMiddleware('http://echo.websocket.org', { ws: true });\n\n// shorter shorthand\ncreateProxyMiddleware('ws://echo.websocket.org');\n```\n\n### External WebSocket upgrade\n\nIn the previous WebSocket examples, http-proxy-middleware relies on a initial http request in order to listen to the http `upgrade` event. If you need to proxy WebSockets without the initial http request, you can subscribe to the server's http `upgrade` event manually.\n\n```javascript\nconst wsProxy = createProxyMiddleware('ws://echo.websocket.org', { changeOrigin: true });\n\nconst app = express();\napp.use(wsProxy);\n\nconst server = app.listen(3000);\nserver.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade'\n```\n\n## Intercept and manipulate requests\n\nIntercept requests from downstream by defining `onProxyReq` in `createProxyMiddleware`.\n\nCurrently the only pre-provided request interceptor is `fixRequestBody`, which is used to fix proxied POST requests when `bodyParser` is applied before this middleware.\n\nExample:\n\n```javascript\nconst { createProxyMiddleware, fixRequestBody } = require('http-proxy-middleware');\n\nconst proxy = createProxyMiddleware({\n  /**\n   * Fix bodyParser\n   **/\n  onProxyReq: fixRequestBody,\n});\n```\n\n## Intercept and manipulate responses\n\nIntercept responses from upstream with `responseInterceptor`. (Make sure to set `selfHandleResponse: true`)\n\nResponses which are compressed with `brotli`, `gzip` and `deflate` will be decompressed automatically. The response will be returned as `buffer` ([docs](https://nodejs.org/api/buffer.html)) which you can manipulate.\n\nWith `buffer`, response manipulation is not limited to text responses (html/css/js, etc...); image manipulation will be possible too. ([example](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/response-interceptor.md#manipulate-image-response))\n\nNOTE: `responseInterceptor` disables streaming of target's response.\n\nExample:\n\n```javascript\nconst { createProxyMiddleware, responseInterceptor } = require('http-proxy-middleware');\n\nconst proxy = createProxyMiddleware({\n  /**\n   * IMPORTANT: avoid res.end being called automatically\n   **/\n  selfHandleResponse: true, // res.end() will be called internally by responseInterceptor()\n\n  /**\n   * Intercept response and replace 'Hello' with 'Goodbye'\n   **/\n  onProxyRes: responseInterceptor(async (responseBuffer, proxyRes, req, res) => {\n    const response = responseBuffer.toString('utf8'); // convert buffer to string\n    return response.replace('Hello', 'Goodbye'); // manipulate response and return the result\n  }),\n});\n```\n\nCheck out [interception recipes](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/response-interceptor.md#readme) for more examples.\n\n## Working examples\n\nView and play around with [working examples](https://github.com/chimurai/http-proxy-middleware/tree/master/examples).\n\n- Browser-Sync ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/browser-sync/index.js))\n- express ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/express/index.js))\n- connect ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/connect/index.js))\n- WebSocket ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/websocket/index.js))\n- Response Manipulation ([example source](https://github.com/chimurai/http-proxy-middleware/blob/master/examples/response-interceptor/index.js))\n\n## Recipes\n\nView the [recipes](https://github.com/chimurai/http-proxy-middleware/tree/master/recipes) for common use cases.\n\n## Compatible servers\n\n`http-proxy-middleware` is compatible with the following servers:\n\n- [connect](https://www.npmjs.com/package/connect)\n- [express](https://www.npmjs.com/package/express)\n- [fastify](https://www.npmjs.com/package/fastify)\n- [browser-sync](https://www.npmjs.com/package/browser-sync)\n- [lite-server](https://www.npmjs.com/package/lite-server)\n- [polka](https://github.com/lukeed/polka)\n- [grunt-contrib-connect](https://www.npmjs.com/package/grunt-contrib-connect)\n- [grunt-browser-sync](https://www.npmjs.com/package/grunt-browser-sync)\n- [gulp-connect](https://www.npmjs.com/package/gulp-connect)\n- [gulp-webserver](https://www.npmjs.com/package/gulp-webserver)\n\nSample implementations can be found in the [server recipes](https://github.com/chimurai/http-proxy-middleware/tree/master/recipes/servers.md).\n\n## Tests\n\nRun the test suite:\n\n```bash\n# install dependencies\n$ yarn\n\n# linting\n$ yarn lint\n$ yarn lint:fix\n\n# building (compile typescript to js)\n$ yarn build\n\n# unit tests\n$ yarn test\n\n# code coverage\n$ yarn cover\n```\n\n## Changelog\n\n- [View changelog](https://github.com/chimurai/http-proxy-middleware/blob/master/CHANGELOG.md)\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015-2021 Steven Chim\n","engines":{"node":">=12.0.0"},"gitHead":"454969fea7df0ad0fee85bec23675dbd76e2e2d1","scripts":{"lint":"yarn prettier && yarn eslint","test":"jest","build":"tsc","clean":"rm -rf dist && rm -rf coverage","eslint":"eslint '{src,test}/**/*.ts'","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo","pretest":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","lint:fix":"yarn prettier:fix && yarn eslint:fix","prebuild":"yarn clean","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","eslint:fix":"yarn eslint --fix","precoverage":"yarn build","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\""},"_npmUser":{"name":"yulodl","email":"yulodl@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"_npmVersion":"7.21.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","directories":{},"_nodeVersion":"16.8.0","dependencies":{"is-glob":"^4.0.1","http-proxy":"^1.18.1","micromatch":"^4.0.2","body-parser":"^1.19.0","is-plain-obj":"^3.0.0","@types/http-proxy":"^1.17.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ws":"^8.1.0","jest":"^27.0.6","open":"^8.2.1","husky":"^7.0.1","eslint":"^7.32.0","connect":"^3.7.0","express":"^4.17.1","mockttp":"^2.2.2","ts-jest":"^27.0.4","get-port":"^5.1.1","prettier":"^2.3.2","@types/ws":"^7.4.7","supertest":"^6.1.5","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","lint-staged":"^11.1.2","browser-sync":"^2.27.5","@types/express":"^4.17.13","@types/is-glob":"^4.0.2","@commitlint/cli":"^13.1.0","@types/supertest":"^2.0.11","@types/micromatch":"^4.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.29.1","@commitlint/config-conventional":"^13.1.0","@typescript-eslint/eslint-plugin":"^4.29.1"},"_npmOperationalInternal":{"tmp":"tmp/http-proxy-middleware_2.1.0-alpha.1_1630999293227_0.5866227288496837","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"@yqg/http-proxy-middleware","version":"2.1.0","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","_id":"@yqg/http-proxy-middleware@2.1.0","maintainers":[{"name":"jxlnljt","email":"jxlnljt@163.com"},{"name":"yqg-owner","email":"developer@yangqianguan.com"},{"name":"yulodl","email":"yulodl@gmail.com"},{"name":"center620","email":"463867101@qq.com"},{"name":"zhchy","email":"zhchy666@gmail.com"},{"name":"guxiaodai","email":"1839815933@qq.com"},{"name":"northseacoder","email":"646388689@qq.com"},{"name":"wenxiujiang","email":"wenxiu_jiang@163.com"},{"name":"zzj5470816","email":"zhangzhijie547@163.com"},{"name":"lixiaoxue","email":"523786175@qq.com"},{"name":"yyh_","email":"2938025925@qq.com"},{"name":"szll","email":"1004274212@qq.com"},{"name":"zhayoyang","email":"2251396833@qq.com"}],"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"dist":{"shasum":"fe7984fa92d70ed796eb802aa02ced8f2b8776e3","tarball":"https://registry.npmjs.org/@yqg/http-proxy-middleware/-/http-proxy-middleware-2.1.0.tgz","fileCount":34,"integrity":"sha512-ZeIr17qCEZszL/RnF+GJ7BhY1wV6D2KbUflefxCA6NIEB84ThHSUrPQEUNZIi1hf3BhTJXZt2lAQKOcjw3agNQ==","signatures":[{"sig":"MEUCIQDprzdXJdLESjzwccUDiGkvQ6YOzoIa5YX36JP77ynI9AIgPtCH4N0HmXw8kFQ1pIwinNfWsC3OxMp1jzYLo2Y3IQc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhN4WoCRA9TVsSAnZWagAAxWAQAILclWD6/cfPjOLv0zvs\nzkuidtw+loSiI3gTFHrhyvyhxPp78MojIbZpWYMKfTU4FElB8kSSs+RGC96+\nx1tL0NJZe4O3igWMIe7iKruryL9a/fDZ8fvJNQJIbZ248GmwcEDm7Z9tmcZ9\nGYLl9QxUKO4jeTQW8WBEdKS6bWiXbWwGgoITq8eSAdgpufo73otj3v4Zz1Y1\nGNA7fZ+k93Pf06mGx017seLTqwWuwmXEv5ULCtVOOC0ocFX2fBiyUg+Rk9En\nwJd73nWRgkLriE2wZPdOpoqbD1RTZBP+ZnNXntJD7nlQBFeJdiIzp15FmLv3\nV6wcZ4z4tLfJO0H4R4BLWyAIn0pP+n083WXq/S2pO4uyPLe6/VZL3AZCqgtZ\n2JFwcT+qEyAmAfzHRYmPQfiI0rD4cU3p2+0Rt5gRrZ0yh8RNOc+UQMPJxXk1\nuN2itq73yZzK8gPGgEe6tjY4XQpRrEFkgksU4XmXZRLBIErw8UKol6oXqSaL\n4hoh4vq70l0FpWKacM+FN8eDcCBGfGKYNX0rUBfUIZ/0kJ88qGE4wypTuGYw\nrZFtYQOT4nORvrABYXVl8wV3uzukS0JchS5kRr4n9wOGWlabjx87vhsyd2lv\n0dTHOW0CSPoBY7GWclfoYde/dIpKySQvBlouaebuD4bERlznf4WE2r/JFfAR\nDHKu\r\n=Sy2J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.0.0"},"gitHead":"4b2d196c635ca68fb30582a635be137bcb29457a","scripts":{"lint":"yarn prettier && yarn eslint","test":"jest","build":"tsc","clean":"rm -rf dist && rm -rf coverage","eslint":"eslint '{src,test}/**/*.ts'","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo","pretest":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","lint:fix":"yarn prettier:fix && yarn eslint:fix","prebuild":"yarn clean","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","eslint:fix":"yarn eslint --fix","precoverage":"yarn build","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\""},"_npmUser":{"name":"yulodl","email":"yulodl@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"_npmVersion":"6.14.11","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","directories":{},"_nodeVersion":"14.15.0","dependencies":{"is-glob":"^4.0.1","type-is":"^1.6.18","http-proxy":"^1.18.1","micromatch":"^4.0.2","is-plain-obj":"^3.0.0","@types/http-proxy":"^1.17.5"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.1.0","jest":"^27.0.6","open":"^8.2.1","husky":"^7.0.1","eslint":"^7.32.0","connect":"^3.7.0","express":"^4.17.1","mockttp":"^2.2.2","ts-jest":"^27.0.4","get-port":"^5.1.1","prettier":"^2.3.2","@types/ws":"^7.4.7","supertest":"^6.1.5","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","body-parser":"^1.19.0","lint-staged":"^11.1.2","browser-sync":"^2.27.5","@types/express":"^4.17.13","@types/is-glob":"^4.0.2","@types/type-is":"^1.6.3","@commitlint/cli":"^13.1.0","@types/supertest":"^2.0.11","@types/micromatch":"^4.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.29.1","@commitlint/config-conventional":"^13.1.0","@typescript-eslint/eslint-plugin":"^4.29.1"},"_npmOperationalInternal":{"tmp":"tmp/http-proxy-middleware_2.1.0_1631028648281_0.0600783678410759","host":"s3://npm-registry-packages"}},"2.1.1":{"name":"@yqg/http-proxy-middleware","version":"2.1.1","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","_id":"@yqg/http-proxy-middleware@2.1.1","maintainers":[{"name":"jxlnljt","email":"jxlnljt@163.com"},{"name":"yqg-owner","email":"developer@yangqianguan.com"},{"name":"yulodl","email":"yulodl@gmail.com"},{"name":"center620","email":"463867101@qq.com"},{"name":"zhchy","email":"zhchy666@gmail.com"},{"name":"guxiaodai","email":"1839815933@qq.com"},{"name":"northseacoder","email":"646388689@qq.com"},{"name":"wenxiujiang","email":"wenxiu_jiang@163.com"},{"name":"zzj5470816","email":"zhangzhijie547@163.com"},{"name":"lixiaoxue","email":"523786175@qq.com"},{"name":"yyh_","email":"2938025925@qq.com"},{"name":"szll","email":"1004274212@qq.com"},{"name":"zhayoyang","email":"2251396833@qq.com"}],"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"dist":{"shasum":"eb9793f6ffcd76f0f0b5f3202b9b9fe404da23ed","tarball":"https://registry.npmjs.org/@yqg/http-proxy-middleware/-/http-proxy-middleware-2.1.1.tgz","fileCount":34,"integrity":"sha512-XV+S00MeZb97yua/LQ5Np+9h6Pufu/s3Q/jN+brF+lDSsoSKhKmaQwvMZzO79gFKrcwNfr48/GVPzLJAId12Qw==","signatures":[{"sig":"MEUCIQCPVMoz0MTxLabn6OKPAQk7L56a6z4bHQtj3Nl2e1Rv/wIgGFgbhYx/qMQT1sNsA3v5P8X+yaKLe7LZ62ZPX8oHBts=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79656,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhN4zdCRA9TVsSAnZWagAAIdIP/2uoyK2Qpen2SJvE9BwF\nGIIJ676+fjLS24q+b7G5+C4KgA40A7tTgB8JkWUJAT9+YO6kacZTle+gKl4U\nnym7vs8zedua0FCH6jbS7MQrhISI747TMEpyuK7VUtq0OKi0ugZF5e8HM7mt\n4bjQZY0mhNO7ZnLWHTWnTChf7XOS6tUpiKltcB0qQeZ9Hm61NyUyS8vNhu14\nAU3jTp2MkSq1UORewIM1fI8bnRvpiWr4BYfH38Gyzz6gEdV7QH5iLYdS6vuK\naCmLYtC1CuBNPjoCPFRsSScwn74FoacCOZvv/+u28qal6SXWT8JMSl0VH28f\nfOPpXi/WrufcPUNa5zq1UjU7sYr06hfGQYGMvtqFBqjp0yM2mwnsRNOVTCUL\nENFP8yh5Uq6NQPuYCfR9PcobxX8IBD0NnGmaU1EijazMN3cBq7DB+77E5yM6\na+1sYDb4f06betX/exAMRodfKn6ZwLdQpQbk9B/kTvLbXM+3840z88XNVRgH\nFxLBA6P/ef/dHonQ6EAwtzaW/cloULKvfFKvTk2oXcB9RmNuHNKOycU0+ZLJ\nfhblXhNpD8e1q4XxeLxBUgEFqk8CExbN58ojg24iDsXHXXjkRuU0O/KvXzrV\no38f3om/5Nv7j+uRlYaTxsIRFWH31fXE8z0/nMiZBZ6hvLgJGYfo+Arrf0P9\nIpdm\r\n=gNZO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=12.0.0"},"gitHead":"128dd7bfe90c4caa7841ee5d8014c74e40dac6fe","scripts":{"lint":"yarn prettier && yarn eslint","test":"jest","build":"tsc","clean":"rm -rf dist && rm -rf coverage","eslint":"eslint '{src,test}/**/*.ts'","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo","pretest":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","lint:fix":"yarn prettier:fix && yarn eslint:fix","prebuild":"yarn clean","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","eslint:fix":"yarn eslint --fix","precoverage":"yarn build","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\""},"_npmUser":{"name":"yulodl","email":"yulodl@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"_npmVersion":"6.14.11","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","directories":{},"_nodeVersion":"14.15.0","dependencies":{"is-glob":"^4.0.1","type-is":"^1.6.18","http-proxy":"^1.18.1","micromatch":"^4.0.2","is-plain-obj":"^3.0.0","@types/http-proxy":"^1.17.5"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.1.0","jest":"^27.0.6","open":"^8.2.1","husky":"^7.0.1","eslint":"^7.32.0","connect":"^3.7.0","express":"^4.17.1","mockttp":"^2.2.2","ts-jest":"^27.0.4","get-port":"^5.1.1","prettier":"^2.3.2","@types/ws":"^7.4.7","supertest":"^6.1.5","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","body-parser":"^1.19.0","lint-staged":"^11.1.2","browser-sync":"^2.27.5","@types/express":"^4.17.13","@types/is-glob":"^4.0.2","@types/type-is":"^1.6.3","@commitlint/cli":"^13.1.0","@types/supertest":"^2.0.11","@types/micromatch":"^4.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.29.1","@commitlint/config-conventional":"^13.1.0","@typescript-eslint/eslint-plugin":"^4.29.1"},"_npmOperationalInternal":{"tmp":"tmp/http-proxy-middleware_2.1.1_1631030492931_0.7006635292020182","host":"s3://npm-registry-packages"}},"2.1.2":{"name":"@yqg/http-proxy-middleware","version":"2.1.2","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","_id":"@yqg/http-proxy-middleware@2.1.2","maintainers":[{"name":"jxlnljt","email":"jxlnljt@163.com"},{"name":"yqg-owner","email":"developer@yangqianguan.com"},{"name":"yulodl","email":"yulodl@gmail.com"},{"name":"center620","email":"463867101@qq.com"},{"name":"zhchy","email":"zhchy666@gmail.com"},{"name":"guxiaodai","email":"1839815933@qq.com"},{"name":"northseacoder","email":"646388689@qq.com"},{"name":"wenxiujiang","email":"wenxiu_jiang@163.com"},{"name":"zzj5470816","email":"zhangzhijie547@163.com"},{"name":"lixiaoxue","email":"523786175@qq.com"},{"name":"yyh_","email":"2938025925@qq.com"},{"name":"szll","email":"1004274212@qq.com"},{"name":"zhayoyang","email":"2251396833@qq.com"}],"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"dist":{"shasum":"a297ee12daf8f5b770db7439381a9a01897f4a08","tarball":"https://registry.npmjs.org/@yqg/http-proxy-middleware/-/http-proxy-middleware-2.1.2.tgz","fileCount":33,"integrity":"sha512-dCoamtw3uC4lhN07hgD/gYnn8HHMeeAlXfTdfIyOAH8JJs5FP28jwOYca7/u6ugZoakSImWe7qh28Iwl5NCNxA==","signatures":[{"sig":"MEQCIELo1bF4TeLkctG9qHPHelzh90H2aeHt6t9szrtVuEAdAiAJ5cF2RVBHgFNkDu73UbZk2C+xi/aA89Hk5cCRlpxh+A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":67008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOIuhCRA9TVsSAnZWagAAzdMP/19eDCxFRqdvSVPLDOZU\nWe27eLUQ9lalJxFUi2LJhpKAXNE8mTFS7LZ7c0jSnQm8LATC47/j19KSjHxu\nzHQKmnB9CmRP4XayVi49r4F38yeKrlHFOgXzAL4WXnU49tsMgfUbcuhdAqxS\n+N84S8jqaNFquO/VX5TVKKxCU7hxEVJWkUudCNknvk0zGYWXhWg9wFr6/Pir\n7qrsUSzWZL2x70zswrV/kQrYvHSyTg7gzzL0qS5pBucpTNNtwbLB1Fii/V0I\nLkGZZhDYjnzhi45jAwtyiokkaXapY/RIzR+SARO4Xc7ZIkD1GQQcHd6uh3xa\nmt9dHHniShGbFMBf8RKpMWT/JHRfEkbXF1BR08vjYDxl2NI0LJxFFA3ATOzD\nriZX2dNuetJh/NClaq53MFB/JK8f6z3ssIWrwdM6gkxm//uEUifit3HoWwY5\nBfAZG4uSsR4YJBDts8aWJ+beONLHQ9ZxmruBS87qm/yeHn0MXQ8TB/3pvtS0\nblPeVpOw2Z4HeLqFvr056sRpSmleVqq+QPFRkMoXr0BO8phFl5eET2JJAYRW\nTMOKHaHFVfcfvSbdXXqA2pAJ4fhEFzgE4PHp0HpaariXc9c9TdFaUAm3IqPH\nnbWht925Yk/sO5dRiTk2ZQEKQ4tW3x290WLnWQGhrg8A0EoPWuVlPWX0NfWr\nGcPq\r\n=oZEI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=10.0.0"},"gitHead":"1649ac279e1607975a68587095bfc2da9b46c331","scripts":{"lint":"yarn prettier && yarn eslint","test":"jest","build":"tsc","clean":"rm -rf dist && rm -rf coverage","eslint":"eslint '{src,test}/**/*.ts'","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo","pretest":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","lint:fix":"yarn prettier:fix && yarn eslint:fix","prebuild":"yarn clean","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","eslint:fix":"yarn eslint --fix","precoverage":"yarn build","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\""},"_npmUser":{"name":"yulodl","email":"yulodl@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"_npmVersion":"7.21.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","directories":{},"_nodeVersion":"16.8.0","dependencies":{"is-glob":"^4.0.1","type-is":"^1.6.18","http-proxy":"^1.18.1","micromatch":"^4.0.2","is-plain-obj":"^3.0.0","@types/http-proxy":"^1.17.5"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.1.0","jest":"^27.0.6","open":"^8.2.1","husky":"^7.0.1","eslint":"^7.32.0","connect":"^3.7.0","express":"^4.17.1","mockttp":"^2.2.2","ts-jest":"^27.0.4","get-port":"^5.1.1","prettier":"^2.3.2","@types/ws":"^7.4.7","supertest":"^6.1.5","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","body-parser":"^1.19.0","lint-staged":"^11.1.2","browser-sync":"^2.27.5","@types/express":"^4.17.13","@types/is-glob":"^4.0.2","@types/type-is":"^1.6.3","@commitlint/cli":"^13.1.0","@types/supertest":"^2.0.11","@types/micromatch":"^4.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.29.1","@commitlint/config-conventional":"^13.1.0","@typescript-eslint/eslint-plugin":"^4.29.1"},"_npmOperationalInternal":{"tmp":"tmp/http-proxy-middleware_2.1.2_1631095713024_0.8977128895044704","host":"s3://npm-registry-packages"}},"2.1.3":{"name":"@yqg/http-proxy-middleware","version":"2.1.3","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","_id":"@yqg/http-proxy-middleware@2.1.3","maintainers":[{"name":"yqg-owner","email":"developer@yangqianguan.com"},{"name":"jxlnljt","email":"jxlnljt@163.com"},{"name":"yulodl","email":"yulodl@gmail.com"},{"name":"center620","email":"463867101@qq.com"},{"name":"zhchy","email":"zhchy666@gmail.com"},{"name":"guxiaodai","email":"1839815933@qq.com"},{"name":"northseacoder","email":"646388689@qq.com"},{"name":"wenxiujiang","email":"wenxiu_jiang@163.com"},{"name":"zzj5470816","email":"zhangzhijie547@163.com"},{"name":"lixiaoxue","email":"523786175@qq.com"},{"name":"yyh_","email":"2938025925@qq.com"},{"name":"szll","email":"1004274212@qq.com"},{"name":"zhayoyang","email":"2251396833@qq.com"}],"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"dist":{"shasum":"ae38becff1ddab32ca1453751ed99e5bf9c8046a","tarball":"https://registry.npmjs.org/@yqg/http-proxy-middleware/-/http-proxy-middleware-2.1.3.tgz","fileCount":34,"integrity":"sha512-qreIT9ZZUL3JOzUFKVyL3JQ6zJQVmuK4AGOMJr1bGS79P6KbHEHTh0u9h3CS0JInyEz0f1+FINBGzdMnUSjYXQ==","signatures":[{"sig":"MEUCIDitfqvhnVlT6jQtTAzkZ+k/s3m7HQEx7z8GMcsDlLvRAiEA/DggntGY6O8+c/NgdTSv6rcOJlDncwTqN4Hsc5yjk3c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79443},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=10.0.0"},"gitHead":"8c87d5156f724ce12e527ca50d09c4eda9129c59","scripts":{"lint":"yarn prettier && yarn eslint","test":"jest","build":"tsc","clean":"rm -rf dist && rm -rf coverage","eslint":"eslint '{src,test}/**/*.ts'","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo","pretest":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","lint:fix":"yarn prettier:fix && yarn eslint:fix","prebuild":"yarn clean","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","eslint:fix":"yarn eslint --fix","precoverage":"yarn build","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\""},"_npmUser":{"name":"yulodl","email":"yulodl@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"_npmVersion":"6.14.8","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","directories":{},"_nodeVersion":"14.15.0","dependencies":{"is-glob":"^4.0.1","type-is":"^1.6.18","http-proxy":"^1.18.1","micromatch":"^4.0.2","is-plain-obj":"^3.0.0","@types/http-proxy":"^1.17.5"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.1.0","jest":"^27.0.6","open":"^8.2.1","husky":"^7.0.1","eslint":"^7.32.0","connect":"^3.7.0","express":"^4.17.1","mockttp":"^2.2.2","ts-jest":"^27.0.4","get-port":"^5.1.1","prettier":"^2.3.2","@types/ws":"^7.4.7","supertest":"^6.1.5","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","body-parser":"^1.19.0","lint-staged":"^11.1.2","browser-sync":"^2.27.5","@types/express":"^4.17.13","@types/is-glob":"^4.0.2","@types/type-is":"^1.6.3","@commitlint/cli":"^13.1.0","@types/supertest":"^2.0.11","@types/micromatch":"^4.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.29.1","@commitlint/config-conventional":"^13.1.0","@typescript-eslint/eslint-plugin":"^4.29.1"},"_npmOperationalInternal":{"tmp":"tmp/http-proxy-middleware_2.1.3_1632800762599_0.13844959469256346","host":"s3://npm-registry-packages"}},"2.1.4":{"name":"@yqg/http-proxy-middleware","version":"2.1.4","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","_id":"@yqg/http-proxy-middleware@2.1.4","maintainers":[{"name":"yqg-owner","email":"developer@yangqianguan.com"},{"name":"jxlnljt","email":"jxlnljt@163.com"},{"name":"yulodl","email":"yulodl@gmail.com"},{"name":"center620","email":"463867101@qq.com"},{"name":"zhchy","email":"zhchy666@gmail.com"},{"name":"guxiaodai","email":"1839815933@qq.com"},{"name":"northseacoder","email":"646388689@qq.com"},{"name":"wenxiujiang","email":"wenxiu_jiang@163.com"},{"name":"zzj5470816","email":"zhangzhijie547@163.com"},{"name":"lixiaoxue","email":"523786175@qq.com"},{"name":"yyh_","email":"2938025925@qq.com"},{"name":"szll","email":"1004274212@qq.com"},{"name":"zhayoyang","email":"2251396833@qq.com"}],"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"dist":{"shasum":"eb0b57d89b5234342382e6dff326ff14d88254f9","tarball":"https://registry.npmjs.org/@yqg/http-proxy-middleware/-/http-proxy-middleware-2.1.4.tgz","fileCount":34,"integrity":"sha512-o1Aparb5SN+KCy5x2tsfqjGIG+WHK9SuGuhIK2FCl1ccM9EH6oDehKTGKGcbpFWJswRgzV3XNAz9SURD+6WByg==","signatures":[{"sig":"MEYCIQD+uHjtzjc3ONRIzyyST98wJSh9mtWV+rgtFI00AFdw9wIhAL1yGFP/StZ6hrNirLCJ8yItcydJ+xNuTBvMKGTjFzN6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79597},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=10.0.0"},"gitHead":"97e87795672aa6bb637262779f2bce883cd09e11","scripts":{"lint":"yarn prettier && yarn eslint","test":"jest","build":"tsc","clean":"rm -rf dist && rm -rf coverage","eslint":"eslint '{src,test}/**/*.ts'","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo","pretest":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","lint:fix":"yarn prettier:fix && yarn eslint:fix","prebuild":"yarn clean","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","eslint:fix":"yarn eslint --fix","precoverage":"yarn build","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\""},"_npmUser":{"name":"yulodl","email":"yulodl@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"_npmVersion":"6.14.8","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","directories":{},"_nodeVersion":"14.15.0","dependencies":{"is-glob":"^4.0.1","type-is":"^1.6.18","http-proxy":"^1.18.1","micromatch":"^4.0.2","is-plain-obj":"^3.0.0","@types/http-proxy":"^1.17.5"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.1.0","jest":"^27.0.6","open":"^8.2.1","husky":"^7.0.1","eslint":"^7.32.0","connect":"^3.7.0","express":"^4.17.1","mockttp":"^2.2.2","ts-jest":"^27.0.4","get-port":"^5.1.1","prettier":"^2.3.2","@types/ws":"^7.4.7","supertest":"^6.1.5","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","body-parser":"^1.19.0","lint-staged":"^11.1.2","browser-sync":"^2.27.5","@types/express":"^4.17.13","@types/is-glob":"^4.0.2","@types/type-is":"^1.6.3","@commitlint/cli":"^13.1.0","@types/supertest":"^2.0.11","@types/micromatch":"^4.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.29.1","@commitlint/config-conventional":"^13.1.0","@typescript-eslint/eslint-plugin":"^4.29.1"},"_npmOperationalInternal":{"tmp":"tmp/http-proxy-middleware_2.1.4_1632818376293_0.24140376557555498","host":"s3://npm-registry-packages"}},"2.1.5":{"name":"@yqg/http-proxy-middleware","version":"2.1.5","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","_id":"@yqg/http-proxy-middleware@2.1.5","maintainers":[{"name":"iuwoo","email":"iuwoowoo@163.com"},{"name":"ykboluo","email":"swpu.leo@gmail.com"},{"name":"yqg-owner","email":"developer@yangqianguan.com"},{"name":"jxlnljt","email":"jxlnljt@163.com"},{"name":"yulodl","email":"yulodl@gmail.com"},{"name":"center620","email":"463867101@qq.com"},{"name":"zhchy","email":"zhchy666@gmail.com"},{"name":"guxiaodai","email":"1839815933@qq.com"},{"name":"northseacoder","email":"646388689@qq.com"},{"name":"wenxiujiang","email":"wenxiu_jiang@163.com"},{"name":"zzj5470816","email":"zhangzhijie547@163.com"},{"name":"lixiaoxue","email":"523786175@qq.com"},{"name":"yyh_","email":"2938025925@qq.com"},{"name":"szll","email":"1004274212@qq.com"},{"name":"zhayoyang","email":"2251396833@qq.com"}],"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"dist":{"shasum":"fdd41a06d53d4c4298735333a4f62231d19deda7","tarball":"https://registry.npmjs.org/@yqg/http-proxy-middleware/-/http-proxy-middleware-2.1.5.tgz","fileCount":34,"integrity":"sha512-T7OqcOlwFhIgHPO62FkoqQWrnBomsXAbgO3CfRX+8da1JuxUA6blxClvLhgBE3Dr9zaeBciN3pwL7w7Iq7Mw9g==","signatures":[{"sig":"MEUCIQCwvmpN4fXvG2ir3wFFOCJVu2gu+RqB/PuOMAyAXkUjpwIgERjkqqjp5qRNcQG4OOKLAhc2yuMkkjbp/t9tSyHvDQ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhl072CRA9TVsSAnZWagAAN/AP/25tCKlBc4hDRPmWv9Ke\nLs+vnUMTwn6hGdswmvLyHS/Vp6LIMREi7iq0mXMxVwM/vMixg2CEvISCioI4\neh6pwJhprSvqTlnr2Vx+HQ70n5D6QUP3lB7s53pJpGwladtZ/GM57bmB1tFN\ncWPF7lIXx5+gtyP2K5jzbK8EzWX/TyJ/aj9eOfQ6xcHl5B+x933wwaOncwox\n3RkrEm+svzTlQjMVO6BPYrcj/hWWevAIDTasWeS6OFdYsROn7oa78enJ3C8t\nDpJcmhYFcNUPrUBrZVhy5eE7m8VwsrdKIgMrlMJ/sos2j1qRK8Ot5z502xMv\nWhYrQBWxSQEEenj64ZKbcLp0Ur2fybf1MDgLXAUYTTJxjXKrX/oFtg+nEW5H\nBB7N/sOvrDHGFzQf0JdQWzOrAdWRSeatt98DBEnXgf2vSTPby2p8lLPqMKAN\ncsAzMjSuglGzhJY6CQ5d4sSX6fQ1YKkfK+mDJuw17T2wmZ6FsHYL6TD6crSi\nF1NL1qMuAHqEiGc6AISFSl4tpfJ9VSFxcATRe3f6PrlVxlbHdXRQqmJ6oOXI\nsRyF9uHB83bEwbIG0vQYEeiIl92u3mdSxWyw05FhLxcQ/+v8LqexWHhjITeH\nBJrerXy9f9/US4h1pABHz84JeVh31DKeDo3aMf3ewoT+TvzCEAhdh6rn3Gzm\n7Icq\r\n=p/98\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=10.0.0"},"gitHead":"d7029763433964cc0be92c98baac775f4fc82785","scripts":{"lint":"yarn prettier && yarn eslint","test":"jest","build":"tsc","clean":"rm -rf dist && rm -rf coverage","eslint":"eslint '{src,test}/**/*.ts'","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo","pretest":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","lint:fix":"yarn prettier:fix && yarn eslint:fix","prebuild":"yarn clean","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","eslint:fix":"yarn eslint --fix","precoverage":"yarn build","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\""},"_npmUser":{"name":"yulodl","email":"yulodl@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"_npmVersion":"6.14.12","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","directories":{},"_nodeVersion":"14.16.1","dependencies":{"is-glob":"^4.0.1","type-is":"^1.6.18","http-proxy":"^1.18.1","micromatch":"^4.0.2","is-plain-obj":"^3.0.0","@types/http-proxy":"^1.17.5"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.1.0","jest":"^27.0.6","open":"^8.2.1","husky":"^7.0.1","eslint":"^7.32.0","connect":"^3.7.0","express":"^4.17.1","mockttp":"^2.2.2","ts-jest":"^27.0.4","get-port":"^5.1.1","prettier":"^2.3.2","@types/ws":"^7.4.7","supertest":"^6.1.5","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","body-parser":"^1.19.0","lint-staged":"^11.1.2","browser-sync":"^2.27.5","@types/express":"^4.17.13","@types/is-glob":"^4.0.2","@types/type-is":"^1.6.3","@commitlint/cli":"^13.1.0","@types/supertest":"^2.0.11","@types/micromatch":"^4.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.29.1","@commitlint/config-conventional":"^13.1.0","@typescript-eslint/eslint-plugin":"^4.29.1"},"_npmOperationalInternal":{"tmp":"tmp/http-proxy-middleware_2.1.5_1637306101596_0.13235197813348631","host":"s3://npm-registry-packages"}},"2.1.6":{"name":"@yqg/http-proxy-middleware","version":"2.1.6","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","_id":"@yqg/http-proxy-middleware@2.1.6","maintainers":[{"name":"iuwoo","email":"iuwoowoo@163.com"},{"name":"ykboluo","email":"swpu.leo@gmail.com"},{"name":"yqg-owner","email":"developer@yangqianguan.com"},{"name":"jxlnljt","email":"jxlnljt@163.com"},{"name":"yulodl","email":"yulodl@gmail.com"},{"name":"center620","email":"463867101@qq.com"},{"name":"zhchy","email":"zhchy666@gmail.com"},{"name":"guxiaodai","email":"1839815933@qq.com"},{"name":"northseacoder","email":"646388689@qq.com"},{"name":"wenxiujiang","email":"wenxiu_jiang@163.com"},{"name":"zzj5470816","email":"zhangzhijie547@163.com"},{"name":"lixiaoxue","email":"523786175@qq.com"},{"name":"yyh_","email":"2938025925@qq.com"},{"name":"szll","email":"1004274212@qq.com"},{"name":"zhayoyang","email":"2251396833@qq.com"}],"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"dist":{"shasum":"bef613d3250aa9282063b6cfdbce10228893f2e4","tarball":"https://registry.npmjs.org/@yqg/http-proxy-middleware/-/http-proxy-middleware-2.1.6.tgz","fileCount":34,"integrity":"sha512-4ExI/fVW0c+kPncN783MNQQXZYf/9qPg61yReJAPHakzulVXmgqfjHdhn/TmqzaLOZ4SgJdWmRz0XLchokYAYA==","signatures":[{"sig":"MEUCIQCVuGRdv+1PEQtgi8+1gmyXCFq31j5gBVDOmKgHot2JxwIgEs6THVwcUPIyk5LTV72xfo1TsMOL4v9uKmIPGEz8RA8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":79889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhm0k6CRA9TVsSAnZWagAATXoP/Ap1f4UnIyHNmUh/YeV2\ngMNVJaR4Og1xRN3e9+RUTNjSqvlfIezPIJPXUMiQBJtLp182GbD7rPoSK8no\nUoQzT6S82ikmI+toUcr3XhTKW9IGNpvtrHy6fkkWA8t6Ltnclz4ZnBuNzQDe\nduPmViL9/X9p+kNTJo9EObbiCuaI4uuCFrBd8+H+5zsTpUnuDeeGevyCVeB8\nruew3QnNMiDFQpYItMbXm4+HMGLFI43rv9Pkg0VUZ8zwUSd9lNMQXJzg0sLx\nWF/zVxXKS+r9ecPIULYBEMnmEuc0w2JzzkdjNR0lRpXf4nLnOh5t4x82umqr\nAOg9uO3ievQnpMixLjAT2CUFEyeYv0OU9ddmse0xFo7PXQSY4AiJF4Wlv3tm\n+vOhvI78l15ptJ2vP0trBISR7YgvkFpVjIRwTZgiP6oSv1prC7W8qf8chplz\nz0gDjvUlRRwLrPl6/XWj+8dIpRj8K7lbNIooq1t9FquPk2iQpNlBU3xkceKz\nv9sI4CTqkYSK5PIOTx1uTcTUuitVnTp2hM1Ik/1FtZADLKnM9jU6AA3/FvBH\nxl3FutYB84PXromGySSRUPTdPpedKGd+snim9o7AMOltD0ZrtaxOKo5rLHmi\nfmlmRMBgreatig4OmTtcaYcG4B+SY7ybqMpjGlt8MCGoDEECFWnR9RQDVvF+\n33cn\r\n=2B4+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=10.0.0"},"gitHead":"66f72cf5de7d431129f3df10c767e3333b568d81","scripts":{"lint":"yarn prettier && yarn eslint","test":"jest","build":"tsc","clean":"rm -rf dist && rm -rf coverage","eslint":"eslint '{src,test}/**/*.ts'","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo","pretest":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","lint:fix":"yarn prettier:fix && yarn eslint:fix","prebuild":"yarn clean","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","eslint:fix":"yarn eslint --fix","precoverage":"yarn build","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\""},"_npmUser":{"name":"yulodl","email":"yulodl@gmail.com"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"_npmVersion":"6.14.15","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","directories":{},"_nodeVersion":"14.17.6","dependencies":{"is-glob":"^4.0.1","type-is":"^1.6.18","http-proxy":"^1.18.1","micromatch":"^4.0.2","is-plain-obj":"^3.0.0","@types/http-proxy":"^1.17.5"},"_hasShrinkwrap":false,"devDependencies":{"ws":"^8.1.0","jest":"^27.0.6","open":"^8.2.1","husky":"^7.0.1","eslint":"^7.32.0","connect":"^3.7.0","express":"^4.17.1","mockttp":"^2.2.2","ts-jest":"^27.0.4","get-port":"^5.1.1","prettier":"^2.3.2","@types/ws":"^7.4.7","supertest":"^6.1.5","typescript":"^4.3.5","@types/jest":"^27.0.1","@types/node":"^16.6.1","body-parser":"^1.19.0","lint-staged":"^11.1.2","browser-sync":"^2.27.5","@types/express":"^4.17.13","@types/is-glob":"^4.0.2","@types/type-is":"^1.6.3","@commitlint/cli":"^13.1.0","@types/supertest":"^2.0.11","@types/micromatch":"^4.0.2","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","@typescript-eslint/parser":"^4.29.1","@commitlint/config-conventional":"^13.1.0","@typescript-eslint/eslint-plugin":"^4.29.1"},"_npmOperationalInternal":{"tmp":"tmp/http-proxy-middleware_2.1.6_1637566778336_0.5488498285348691","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-09-06T04:13:12.258Z","modified":"2026-02-02T11:15:57.492Z","2.1.0-alpha":"2021-09-06T04:13:12.482Z","2.1.0-alpha.1":"2021-09-07T07:21:33.370Z","2.1.0":"2021-09-07T15:30:48.450Z","2.1.1":"2021-09-07T16:01:33.140Z","2.1.2":"2021-09-08T10:08:33.263Z","2.1.3":"2021-09-28T03:46:02.797Z","2.1.4":"2021-09-28T08:39:36.452Z","2.1.5":"2021-11-19T07:15:02.042Z","2.1.6":"2021-11-22T07:39:38.469Z"},"bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"author":{"name":"Steven Chim"},"license":"MIT","homepage":"https://github.com/chimurai/http-proxy-middleware#readme","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"repository":{"url":"git+https://github.com/chimurai/http-proxy-middleware.git","type":"git"},"description":"The one-liner node.js proxy middleware for connect, express and browser-sync","maintainers":[{"email":"developer@yangqianguan.com","name":"yqg-owner"},{"email":"1839815933@qq.com","name":"guxiaodai"},{"email":"646388689@qq.com","name":"northseacoder"},{"email":"zhangzhijie547@163.com","name":"zzj5470816"},{"email":"2938025925@qq.com","name":"yyh_"},{"email":"1004274212@qq.com","name":"szll"},{"email":"2251396833@qq.com","name":"zhayoyang"},{"email":"979956624@qq.com","name":"hongweihu"},{"email":"iuwoowoo@163.com","name":"iuwoo"},{"email":"runcode@foxmail.com","name":"runrunr"},{"email":"wangkairemmurd@gmail.com","name":"remmurd1"},{"email":"lwwshare@163.com","name":"lwwshare"},{"email":"15610691608@163.com","name":"hanyefeng"},{"email":"xuliang_most@163.com","name":"xuliangmost"},{"email":"17319320427@163.com","name":"zhenkunliu2"},{"email":"yufengmeng@fintopia.tech","name":"yufengmeng"},{"email":"shaotanliang@fintopia.tech","name":"shaotanliang"},{"email":"xuehaowang@fintopia.tech","name":"wangxuehao_yqg"},{"email":"chongchen@fintopia.tech","name":"mozhichen"},{"email":"taowang@fintopia.tech","name":"ly-wangtao"},{"email":"1599858439@qq.com","name":"lilyto"},{"email":"1134323178@qq.com","name":"lyyyyyyy"},{"email":"2311710322@qq.com","name":"ziye_lf"},{"email":"yunjuanli@fintopia.tech","name":"happylyj"},{"email":"xingpan@fintopia.tech","name":"xingxingpan"},{"email":"jiahangli@fintopia.tech","name":"lijiahanger"},{"email":"rongzhang@fintopia.tech","name":"ly-zhangrong"},{"email":"wangchenying2021@163.com","name":"wangchenying"},{"email":"elgara@163.com","name":"elgar_adah"},{"email":"zxcenter86@gmail.com","name":"center620"},{"email":"bhremail@163.com","name":"baihuiru"}],"readme":"# http-proxy-middleware\n\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/chimurai/http-proxy-middleware/CI/master?style=flat-square)](https://github.com/chimurai/http-proxy-middleware/actions?query=branch%3Amaster)\n[![Coveralls](https://img.shields.io/coveralls/chimurai/http-proxy-middleware.svg?style=flat-square)](https://coveralls.io/r/chimurai/http-proxy-middleware)\n[![dependency Status](https://img.shields.io/david/chimurai/http-proxy-middleware.svg?style=flat-square)](https://david-dm.org/chimurai/http-proxy-middleware#info=dependencies)\n[![dependency Status](https://snyk.io/test/npm/http-proxy-middleware/badge.svg?style=flat-square)](https://snyk.io/test/npm/http-proxy-middleware)\n[![npm](https://img.shields.io/npm/v/http-proxy-middleware?color=%23CC3534&style=flat-square)](https://www.npmjs.com/package/http-proxy-middleware)\n\nNode.js proxying made simple. Configure proxy middleware with ease for [connect](https://github.com/senchalabs/connect), [express](https://github.com/strongloop/express), [browser-sync](https://github.com/BrowserSync/browser-sync) and [many more](#compatible-servers).\n\nPowered by the popular Nodejitsu [`http-proxy`](https://github.com/nodejitsu/node-http-proxy). [![GitHub stars](https://img.shields.io/github/stars/nodejitsu/node-http-proxy.svg?style=social&label=Star)](https://github.com/nodejitsu/node-http-proxy)\n\n## ⚠️ Note\n\nThis page is showing documentation for version v1.x.x ([release notes](https://github.com/chimurai/http-proxy-middleware/releases))\n\nIf you're looking for v0.x documentation. Go to:\nhttps://github.com/chimurai/http-proxy-middleware/tree/v0.21.0#readme\n\n## TL;DR\n\nProxy `/api` requests to `http://www.example.org`\n\n```javascript\n// javascript\n\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst app = express();\n\napp.use('/api', createProxyMiddleware({ target: 'http://www.example.org', changeOrigin: true }));\napp.listen(3000);\n\n// http://localhost:3000/api/foo/bar -> http://www.example.org/api/foo/bar\n```\n\n```typescript\n// typescript\n\nimport * as express from 'express';\nimport { createProxyMiddleware, Filter, Options, RequestHandler } from 'http-proxy-middleware';\n\nconst app = express();\n\napp.use('/api', createProxyMiddleware({ target: 'http://www.example.org', changeOrigin: true }));\napp.listen(3000);\n\n// http://localhost:3000/api/foo/bar -> http://www.example.org/api/foo/bar\n```\n\n_All_ `http-proxy` [options](https://github.com/nodejitsu/node-http-proxy#options) can be used, along with some extra `http-proxy-middleware` [options](#options).\n\n:bulb: **Tip:** Set the option `changeOrigin` to `true` for [name-based virtual hosted sites](http://en.wikipedia.org/wiki/Virtual_hosting#Name-based).\n\n## Table of Contents\n\n<!-- MarkdownTOC autolink=true bracket=round depth=2 -->\n\n- [Install](#install)\n- [Core concept](#core-concept)\n- [Example](#example)\n- [Context matching](#context-matching)\n- [Options](#options)\n  - [http-proxy-middleware options](#http-proxy-middleware-options)\n  - [http-proxy events](#http-proxy-events)\n  - [http-proxy options](#http-proxy-options)\n- [Shorthand](#shorthand)\n  - [app.use\\(path, proxy\\)](#appusepath-proxy)\n- [WebSocket](#websocket)\n  - [External WebSocket upgrade](#external-websocket-upgrade)\n- [Intercept and manipulate requests](#intercept-and-manipulate-requests)\n- [Intercept and manipulate responses](#intercept-and-manipulate-responses)\n- [Working examples](#working-examples)\n- [Recipes](#recipes)\n- [Compatible servers](#compatible-servers)\n- [Tests](#tests)\n- [Changelog](#changelog)\n- [License](#license)\n\n<!-- /MarkdownTOC -->\n\n## Install\n\n```bash\n$ npm install --save-dev http-proxy-middleware\n```\n\n## Core concept\n\nProxy middleware configuration.\n\n#### createProxyMiddleware([context,] config)\n\n```javascript\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst apiProxy = createProxyMiddleware('/api', { target: 'http://www.example.org' });\n//                                    \\____/   \\_____________________________/\n//                                      |                    |\n//                                    context             options\n\n// 'apiProxy' is now ready to be used as middleware in a server.\n```\n\n- **context**: Determine which requests should be proxied to the target host.\n  (more on [context matching](#context-matching))\n- **options.target**: target host to proxy to. _(protocol + host)_\n\n(full list of [`http-proxy-middleware` configuration options](#options))\n\n#### createProxyMiddleware(uri [, config])\n\n```javascript\n// shorthand syntax for the example above:\nconst apiProxy = createProxyMiddleware('http://www.example.org/api');\n```\n\nMore about the [shorthand configuration](#shorthand).\n\n## Example\n\nAn example with `express` server.\n\n```javascript\n// include dependencies\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\n// proxy middleware options\nconst options = {\n  target: 'http://www.example.org', // target host\n  changeOrigin: true, // needed for virtual hosted sites\n  ws: true, // proxy websockets\n  pathRewrite: {\n    '^/api/old-path': '/api/new-path', // rewrite path\n    '^/api/remove/path': '/path', // remove base path\n  },\n  router: {\n    // when request.headers.host == 'dev.localhost:3000',\n    // override target 'http://www.example.org' to 'http://localhost:8000'\n    'dev.localhost:3000': 'http://localhost:8000',\n  },\n};\n\n// create the proxy (without context)\nconst exampleProxy = createProxyMiddleware(options);\n\n// mount `exampleProxy` in web server\nconst app = express();\napp.use('/api', exampleProxy);\napp.listen(3000);\n```\n\n## Context matching\n\nProviding an alternative way to decide which requests should be proxied; In case you are not able to use the server's [`path` parameter](http://expressjs.com/en/4x/api.html#app.use) to mount the proxy or when you need more flexibility.\n\n[RFC 3986 `path`](https://tools.ietf.org/html/rfc3986#section-3.3) is used for context matching.\n\n```ascii\n         foo://example.com:8042/over/there?name=ferret#nose\n         \\_/   \\______________/\\_________/ \\_________/ \\__/\n          |           |            |            |        |\n       scheme     authority       path        query   fragment\n```\n\n- **path matching**\n\n  - `createProxyMiddleware({...})` - matches any path, all requests will be proxied.\n  - `createProxyMiddleware('/', {...})` - matches any path, all requests will be proxied.\n  - `createProxyMiddleware('/api', {...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `createProxyMiddleware(['/api', '/ajax', '/someotherpath'], {...})`\n\n- **wildcard path matching**\n\n  For fine-grained control you can use wildcard matching. Glob pattern matching is done by _micromatch_. Visit [micromatch](https://www.npmjs.com/package/micromatch) or [glob](https://www.npmjs.com/package/glob) for more globbing examples.\n\n  - `createProxyMiddleware('**', {...})` matches any path, all requests will be proxied.\n  - `createProxyMiddleware('**/*.html', {...})` matches any path which ends with `.html`\n  - `createProxyMiddleware('/*.html', {...})` matches paths directly under path-absolute\n  - `createProxyMiddleware('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api`\n  - `createProxyMiddleware(['/api/**', '/ajax/**'], {...})` combine multiple patterns\n  - `createProxyMiddleware(['/api/**', '!**/bad.json'], {...})` exclusion\n\n  **Note**: In multiple path matching, you cannot use string paths and wildcard paths together.\n\n- **custom matching**\n\n  For full control you can provide a custom function to determine which requests should be proxied or not.\n\n  ```javascript\n  /**\n   * @return {Boolean}\n   */\n  const filter = function (pathname, req) {\n    return pathname.match('^/api') && req.method === 'GET';\n  };\n\n  const apiProxy = createProxyMiddleware(filter, {\n    target: 'http://www.example.org',\n  });\n  ```\n\n## Options\n\n### http-proxy-middleware options\n\n- **option.pathRewrite**: object/function, rewrite target's url path. Object-keys will be used as _RegExp_ to match paths.\n\n  ```javascript\n  // rewrite path\n  pathRewrite: {'^/old/api' : '/new/api'}\n\n  // remove path\n  pathRewrite: {'^/remove/api' : ''}\n\n  // add base path\n  pathRewrite: {'^/' : '/basepath/'}\n\n  // custom rewriting\n  pathRewrite: function (path, req) { return path.replace('/api', '/base/api') }\n\n  // custom rewriting, returning Promise\n  pathRewrite: async function (path, req) {\n    const should_add_something = await httpRequestToDecideSomething(path);\n    if (should_add_something) path += \"something\";\n    return path;\n  }\n  ```\n\n- **option.router**: object/function, re-target `option.target` for specific requests.\n\n  ```javascript\n  // Use `host` and/or `path` to match requests. First match will be used.\n  // The order of the configuration matters.\n  router: {\n      'integration.localhost:3000' : 'http://localhost:8001',  // host only\n      'staging.localhost:3000'     : 'http://localhost:8002',  // host only\n      'localhost:3000/api'         : 'http://localhost:8003',  // host + path\n      '/rest'                      : 'http://localhost:8004'   // path only\n  }\n\n  // Custom router function (string target)\n  router: function(req) {\n      return 'http://localhost:8004';\n  }\n\n  // Custom router function (target object)\n  router: function(req) {\n      return {\n          protocol: 'https:', // The : is required\n          host: 'localhost',\n          port: 8004\n      };\n  }\n\n  // Asynchronous router function which returns promise\n  router: async function(req) {\n      const url = await doSomeIO();\n      return url;\n  }\n  ```\n\n- **option.logLevel**: string, ['debug', 'info', 'warn', 'error', 'silent']. Default: `'info'`\n\n- **option.logProvider**: function, modify or replace log provider. Default: `console`.\n\n  ```javascript\n  // simple replace\n  function logProvider(provider) {\n    // replace the default console log provider.\n    return require('winston');\n  }\n  ```\n\n  ```javascript\n  // verbose replacement\n  function logProvider(provider) {\n    const logger = new (require('winston').Logger)();\n\n    const myCustomProvider = {\n      log: logger.log,\n      debug: logger.debug,\n      info: logger.info,\n      warn: logger.warn,\n      error: logger.error,\n    };\n    return myCustomProvider;\n  }\n  ```\n\n### http-proxy events\n\nSubscribe to [http-proxy events](https://github.com/nodejitsu/node-http-proxy#listening-for-proxy-events):\n\n- **option.onError**: function, subscribe to http-proxy's `error` event for custom error handling.\n\n  ```javascript\n  function onError(err, req, res, target) {\n    res.writeHead(500, {\n      'Content-Type': 'text/plain',\n    });\n    res.end('Something went wrong. And we are reporting a custom error message.');\n  }\n  ```\n\n- **option.onProxyRes**: function, subscribe to http-proxy's `proxyRes` event.\n\n  ```javascript\n  function onProxyRes(proxyRes, req, res) {\n    proxyRes.headers['x-added'] = 'foobar'; // add new header to response\n    delete proxyRes.headers['x-removed']; // remove header from response\n  }\n  ```\n\n- **option.onProxyReq**: function, subscribe to http-proxy's `proxyReq` event.\n\n  ```javascript\n  function onProxyReq(proxyReq, req, res) {\n    // add custom header to request\n    proxyReq.setHeader('x-added', 'foobar');\n    // or log the req\n  }\n  ```\n\n- **option.onProxyReqWs**: function, subscribe to http-proxy's `proxyReqWs` event.\n\n  ```javascript\n  function onProxyReqWs(proxyReq, req, socket, options, head) {\n    // add custom header\n    proxyReq.setHeader('X-Special-Proxy-Header', 'foobar');\n  }\n  ```\n\n- **option.onOpen**: function, subscribe to http-proxy's `open` event.\n\n  ```javascript\n  function onOpen(proxySocket) {\n    // listen for messages coming FROM the target here\n    proxySocket.on('data', hybiParseAndLogMessage);\n  }\n  ```\n\n- **option.onClose**: function, subscribe to http-proxy's `close` event.\n\n  ```javascript\n  function onClose(res, socket, head) {\n    // view disconnected websocket connections\n    console.log('Client disconnected');\n  }\n  ```\n\n### http-proxy options\n\nThe following options are provided by the underlying [http-proxy](https://github.com/nodejitsu/node-http-proxy#options) library.\n\n- **option.target**: url string to be parsed with the url module\n- **option.forward**: url string to be parsed with the url module\n- **option.agent**: object to be passed to http(s).request (see Node's [https agent](http://nodejs.org/api/https.html#https_class_https_agent) and [http agent](http://nodejs.org/api/http.html#http_class_http_agent) objects)\n- **option.ssl**: object to be passed to https.createServer()\n- **option.ws**: true/false: if you want to proxy websockets\n- **option.xfwd**: true/false, adds x-forward headers\n- **option.secure**: true/false, if you want to verify the SSL Certs\n- **option.toProxy**: true/false, passes the absolute URL as the `path` (useful for proxying to proxies)\n- **option.prependPath**: true/false, Default: true - specify whether you want to prepend the target's path to the proxy path\n- **option.ignorePath**: true/false, Default: false - specify whether you want to ignore the proxy path of the incoming request (note: you will have to append / manually if required).\n- **option.localAddress** : Local interface string to bind for outgoing connections\n- **option.changeOrigin**: true/false, Default: false - changes the origin of the host header to the target URL\n- **option.preserveHeaderKeyCase**: true/false, Default: false - specify whether you want to keep letter case of response header key\n- **option.auth** : Basic authentication i.e. 'user:password' to compute an Authorization header.\n- **option.hostRewrite**: rewrites the location hostname on (301/302/307/308) redirects.\n- **option.autoRewrite**: rewrites the location host/port on (301/302/307/308) redirects based on requested host/port. Default: false.\n- **option.protocolRewrite**: rewrites the location protocol on (301/302/307/308) redirects to 'http' or 'https'. Default: null.\n- **option.cookieDomainRewrite**: rewrites domain of `set-cookie` headers. Possible values:\n  - `false` (default): disable cookie rewriting\n  - String: new domain, for example `cookieDomainRewrite: \"new.domain\"`. To remove the domain, use `cookieDomainRewrite: \"\"`.\n  - Object: mapping of domains to new domains, use `\"*\"` to match all domains.  \n    For example keep one domain unchanged, rewrite one domain and remove other domains:\n    ```json\n    cookieDomainRewrite: {\n      \"unchanged.domain\": \"unchanged.domain\",\n      \"old.domain\": \"new.domain\",\n      \"*\": \"\"\n    }\n    ```\n- **option.cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values:\n  - `false` (default): disable cookie rewriting\n  - String: new path, for example `cookiePathRewrite: \"/newPath/\"`. To remove the path, use `cookiePathRewrite: \"\"`. To set path to root use `cookiePathRewrite: \"/\"`.\n  - Object: mapping of paths to new paths, use `\"*\"` to match all paths.\n    For example, to keep one path unchanged, rewrite one path and remove other paths:\n    ```json\n    cookiePathRewrite: {\n      \"/unchanged.path/\": \"/unchanged.path/\",\n      \"/old.path/\": \"/new.path/\",\n      \"*\": \"\"\n    }\n    ```\n- **option.headers**: object, adds [request headers](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields). (Example: `{host:'www.example.org'}`)\n- **option.proxyTimeout**: timeout (in millis) when proxy receives no response from target\n- **option.timeout**: timeout (in millis) for incoming requests\n- **option.followRedirects**: true/false, Default: false - specify whether you want to follow redirects\n- **option.selfHandleResponse** true/false, if set to true, none of the webOutgoing passes are called and it's your responsibility to appropriately return the response by listening and acting on the `proxyRes` event\n- **option.buffer**: stream of data to send as the request body. Maybe you have some middleware that consumes the request stream before proxying it on e.g. If you read the body of a request into a field called 'req.rawbody' you could restream this field in the buffer option:\n\n  ```javascript\n  'use strict';\n\n  const streamify = require('stream-array');\n  const HttpProxy = require('http-proxy');\n  const proxy = new HttpProxy();\n\n  module.exports = (req, res, next) => {\n    proxy.web(\n      req,\n      res,\n      {\n        target: 'http://localhost:4003/',\n        buffer: streamify(req.rawBody),\n      },\n      next\n    );\n  };\n  ```\n\n## Shorthand\n\nUse the shorthand syntax when verbose configuration is not needed. The `context` and `option.target` will be automatically configured when shorthand is used. Options can still be used if needed.\n\n```javascript\ncreateProxyMiddleware('http://www.example.org:8000/api');\n// createProxyMiddleware('/api', {target: 'http://www.example.org:8000'});\n\ncreateProxyMiddleware('http://www.example.org:8000/api/books/*/**.json');\n// createProxyMiddleware('/api/books/*/**.json', {target: 'http://www.example.org:8000'});\n\ncreateProxyMiddleware('http://www.example.org:8000/api', { changeOrigin: true });\n// createProxyMiddleware('/api', {target: 'http://www.example.org:8000', changeOrigin: true});\n```\n\n### app.use(path, proxy)\n\nIf you want to use the server's `app.use` `path` parameter to match requests;\nCreate and mount the proxy without the http-proxy-middleware `context` parameter:\n\n```javascript\napp.use('/api', createProxyMiddleware({ target: 'http://www.example.org', changeOrigin: true }));\n```\n\n`app.use` documentation:\n\n- express: http://expressjs.com/en/4x/api.html#app.use\n- connect: https://github.com/senchalabs/connect#mount-middleware\n- polka: https://github.com/lukeed/polka#usebase-fn\n\n## WebSocket\n\n```javascript\n// verbose api\ncreateProxyMiddleware('/', { target: 'http://echo.websocket.org', ws: true });\n\n// shorthand\ncreateProxyMiddleware('http://echo.websocket.org', { ws: true });\n\n// shorter shorthand\ncreateProxyMiddleware('ws://echo.websocket.org');\n```\n\n### External WebSocket upgrade\n\nIn the previous WebSocket examples, http-proxy-middleware relies on a initial http request in order to listen to the http `upgrade` event. If you need to proxy WebSockets without the initial http request, you can subscribe to the server's http `upgrade` event manually.\n\n```javascript\nconst wsProxy = createProxyMiddleware('ws://echo.websocket.org', { changeOrigin: true });\n\nconst app = express();\napp.use(wsProxy);\n\nconst server = app.listen(3000);\nserver.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade'\n```\n\n## Intercept and manipulate requests\n\nIntercept requests from downstream by defining `onProxyReq` in `createProxyMiddleware`.\n\nCurrently the only pre-provided request interceptor is `fixRequestBody`, which is used to fix proxied POST requests when `bodyParser` is applied before this middleware.\n\nExample:\n\n```javascript\nconst { createProxyMiddleware, fixRequestBody } = require('http-proxy-middleware');\n\nconst proxy = createProxyMiddleware({\n  /**\n   * Fix bodyParser\n   **/\n  onProxyReq: fixRequestBody,\n});\n```\n\n## Intercept and manipulate responses\n\nIntercept responses from upstream with `responseInterceptor`. (Make sure to set `selfHandleResponse: true`)\n\nResponses which are compressed with `brotli`, `gzip` and `deflate` will be decompressed automatically. The response will be returned as `buffer` ([docs](https://nodejs.org/api/buffer.html)) which you can manipulate.\n\nWith `buffer`, response manipulation is not limited to text responses (html/css/js, etc...); image manipulation will be possible too. ([example](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/response-interceptor.md#manipulate-image-response))\n\nNOTE: `responseInterceptor` disables streaming of target's response.\n\nExample:\n\n```javascript\nconst { createProxyMiddleware, responseInterceptor } = require('http-proxy-middleware');\n\nconst proxy = createProxyMiddleware({\n  /**\n   * IMPORTANT: avoid res.end being called automatically\n   **/\n  selfHandleResponse: true, // res.end() will be called internally by responseInterceptor()\n\n  /**\n   * Intercept response and replace 'Hello' with 'Goodbye'\n   **/\n  onProxyRes: responseInterceptor(async (responseBuffer, proxyRes, req, res) => {\n    const response = responseBuffer.toString('utf8'); // convert buffer to string\n    return response.replace('Hello', 'Goodbye'); // manipulate response and return the result\n  }),\n});\n```\n\nCheck out [interception recipes](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/response-interceptor.md#readme) for more examples.\n\n## Working examples\n\nView and play around with [working examples](https://github.com/chimurai/http-proxy-middleware/tree/master/examples).\n\n- Browser-Sync ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/browser-sync/index.js))\n- express ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/express/index.js))\n- connect ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/connect/index.js))\n- WebSocket ([example source](https://github.com/chimurai/http-proxy-middleware/tree/master/examples/websocket/index.js))\n- Response Manipulation ([example source](https://github.com/chimurai/http-proxy-middleware/blob/master/examples/response-interceptor/index.js))\n\n## Recipes\n\nView the [recipes](https://github.com/chimurai/http-proxy-middleware/tree/master/recipes) for common use cases.\n\n## Compatible servers\n\n`http-proxy-middleware` is compatible with the following servers:\n\n- [connect](https://www.npmjs.com/package/connect)\n- [express](https://www.npmjs.com/package/express)\n- [fastify](https://www.npmjs.com/package/fastify)\n- [browser-sync](https://www.npmjs.com/package/browser-sync)\n- [lite-server](https://www.npmjs.com/package/lite-server)\n- [polka](https://github.com/lukeed/polka)\n- [grunt-contrib-connect](https://www.npmjs.com/package/grunt-contrib-connect)\n- [grunt-browser-sync](https://www.npmjs.com/package/grunt-browser-sync)\n- [gulp-connect](https://www.npmjs.com/package/gulp-connect)\n- [gulp-webserver](https://www.npmjs.com/package/gulp-webserver)\n\nSample implementations can be found in the [server recipes](https://github.com/chimurai/http-proxy-middleware/tree/master/recipes/servers.md).\n\n## Tests\n\nRun the test suite:\n\n```bash\n# install dependencies\n$ yarn\n\n# linting\n$ yarn lint\n$ yarn lint:fix\n\n# building (compile typescript to js)\n$ yarn build\n\n# unit tests\n$ yarn test\n\n# code coverage\n$ yarn cover\n```\n\n## Changelog\n\n- [View changelog](https://github.com/chimurai/http-proxy-middleware/blob/master/CHANGELOG.md)\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2015-2021 Steven Chim\n","readmeFilename":"README.md"}