{"_id":"http-proxy-middleware","_rev":"191-5b32270e38317e89ae6ecf245bad7f0d","name":"http-proxy-middleware","description":"The one-liner node.js proxy middleware for connect, express, next.js and more","dist-tags":{"latest":"3.0.0","beta":"3.0.0-beta.1"},"versions":{"0.0.1":{"name":"http-proxy-middleware","version":"0.0.1","description":"http-proxy middleware for connect","main":"index.js","scripts":{"test":"mocha --reporter spec"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","browser-sync","gulp-connect"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"http-proxy":"^1.9.0","mocha":"^2.2.1","should":"^5.2.0","url":"^0.10.3"},"gitHead":"9003d4cc622be6fc8cd0bbba3fab18af9db0361e","_id":"http-proxy-middleware@0.0.1","_shasum":"2b9feaec5fb582db09cf3693f5a5a09a5c1beee6","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"2b9feaec5fb582db09cf3693f5a5a09a5c1beee6","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.0.1.tgz","integrity":"sha512-pyXeHv4zQ8+VaFZl/XvkPHJJK4oaKT8kccEMe/WTXHqnIFHBulA44ZcYQ0IThEtY/DPRfuZWrzdIQYtUdmW9wg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRkU1IWqjqd62xBiPPrJ8xhZktcZYo41drwhM4KWhodgIhAJnQiAwCOdd0iPAF4xvPnzcgAUt1jkXCCBWaWI0V7Gzs"}]},"directories":{}},"0.0.2":{"name":"http-proxy-middleware","version":"0.0.2","description":"http-proxy middleware for connect","main":"index.js","scripts":{"test":"mocha --reporter spec"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","browser-sync","gulp-connect"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"mocha":"^2.2.1","should":"^5.2.0","url":"^0.10.3"},"dependencies":{"http-proxy":"^1.9.0"},"gitHead":"83ace6648fadc0f0b2e2151a7c6f65a91898c3b8","_id":"http-proxy-middleware@0.0.2","_shasum":"6e9fde5ec41fb46fd0e3e3885cd4aa7c2e4b2d6f","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"6e9fde5ec41fb46fd0e3e3885cd4aa7c2e4b2d6f","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.0.2.tgz","integrity":"sha512-fG8Fb2s8n/1vR4IXdjTuxLK+CX/ThShKE8WoLA65ZC9UwQZo02lomzkyoM4fijFD0ymVdBApT/+hhkFc0iUJ7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKL4aA5gbG0ibAtYjqeOpAr+WnHk9hTowWcV2T1U0hKQIhAM1ZvWapGuECYtfu3kWP8fbS2RwFMqK8/61ITl242xyc"}]},"directories":{}},"0.0.3":{"name":"http-proxy-middleware","version":"0.0.3","description":"http-proxy middleware for connect","main":"index.js","scripts":{"test":"mocha --reporter spec"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","browser-sync","gulp-connect"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"mocha":"^2.2.1","should":"^5.2.0"},"dependencies":{"http-proxy":"^1.9.0","url":"^0.10.3"},"gitHead":"c4963a92594d7d25f0a22ba4e27e6f220ea669a8","_id":"http-proxy-middleware@0.0.3","_shasum":"fb97acc26f49a1449eb8112b4711b1bd0723e62c","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"fb97acc26f49a1449eb8112b4711b1bd0723e62c","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.0.3.tgz","integrity":"sha512-Y3SZNl2xHhs5kXvdFI4XC7Poh0RNSYuV3uicHZCB8MF4ww0p+rR5zF3Az1YndX5QhB7ROtN/Y4NvQMHzFhBjUA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCYRinMddhiNNnLM5zWZqSNmhsYANmF4kbP9OV5/SPaKAIgYw5Y0+d/H5KiBvw4gGc0Ynx8rA/t5q0QBvR72s7p0q8="}]},"directories":{}},"0.0.4":{"name":"http-proxy-middleware","version":"0.0.4","description":"http-proxy middleware for connect","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && rm -rf coverage","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","browser-sync","gulp-connect"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"chai":"^2.1.1","coveralls":"^2.11.2","mocha":"^2.2.1","mocha-lcov-reporter":"0.0.2"},"dependencies":{"http-proxy":"^1.9.0","url":"^0.10.3"},"gitHead":"537aed2198d02c988d11466970c5d96ff876d417","_id":"http-proxy-middleware@0.0.4","_shasum":"1cc89b5e4ecc1a1c023594306cf79ae3d4321ea9","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"1cc89b5e4ecc1a1c023594306cf79ae3d4321ea9","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.0.4.tgz","integrity":"sha512-teO5p/nu18vP+/ez47VRjKxZXn0CQsommHjSCkv2EA4dl8rhrKpF+Q1s+gWTgbwz4xfbu8WQFvIx55Uyr59UAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDV8BaaS9s4qNajfFvgbg96dDGdgGudJFG8AmKgRCfyZAIhAJWJcP9Ugz9dD3d0Sy5c/1k5iR1w/umrsK+1dmcl63UZ"}]},"directories":{}},"0.0.5":{"name":"http-proxy-middleware","version":"0.0.5","description":"http-proxy middleware for connect","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && rm -rf coverage","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","browser-sync","gulp-connect"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"chai":"^2.1.1","coveralls":"^2.11.2","mocha":"^2.2.1","mocha-lcov-reporter":"0.0.2"},"dependencies":{"http-proxy":"^1.9.0","url":"^0.10.3"},"gitHead":"9a16ea7ed310db2a2c40a4a8f4bdc136c02f502d","_id":"http-proxy-middleware@0.0.5","_shasum":"6ae35180fdaabc5e69c6112e7d4d1919656a6bfa","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"6ae35180fdaabc5e69c6112e7d4d1919656a6bfa","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.0.5.tgz","integrity":"sha512-R0ke2Gau/lw35MWZBnvJK+zYzEPuwkVhfQrPASLV5rLnFOhGsAU0JrEiW0cDTUWjmV4/OK7EVeosEjY0ekWz1g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFxuDE12Gra8HIxGZZ81jc89W7LlSYO5i2fDUbKHEe0KAiBTCLsb9VgmBZt4B4YBMZxzNZFEqcC9TwxLnzMKF7vaKg=="}]},"directories":{}},"0.1.0":{"name":"http-proxy-middleware","version":"0.1.0","description":"The one-liner http-proxy middleware","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.7.13","chai":"^3.0.0","connect":"^3.4.0","coveralls":"^2.11.2","express":"^4.13.1","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.2"},"dependencies":{"http-proxy":"^1.11.1","url":"^0.10.3"},"gitHead":"abcf4a81366dde1d8fa0057c519d79765c54ef46","_id":"http-proxy-middleware@0.1.0","_shasum":"7f189e2a56c026eb41cdf1837e58ac6a0155e0b1","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"7f189e2a56c026eb41cdf1837e58ac6a0155e0b1","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.1.0.tgz","integrity":"sha512-g+4+2eQka7bO36o0sKm0WuDHaOcNrR1kku4DMBDOyKUwDMRWpsICGZi8BbUycPJYUUjwLTqEM06Oy0Qy+i9gKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGN6u3Hh78dS8/nR72gk2bUovu5PtryYmWuQrlzZPhkwIgIuDq8J5F5GBs0WbhMpdBGnj8ksSD8Da6a7Sp1IAJ+3g="}]},"directories":{}},"0.2.0":{"name":"http-proxy-middleware","version":"0.2.0","description":"The one-liner proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.7.13","chai":"^3.0.0","connect":"^3.4.0","coveralls":"^2.11.2","express":"^4.13.1","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.2"},"dependencies":{"http-proxy":"^1.11.1","url":"^0.10.3"},"gitHead":"afd3536ba67185b3f082c7a4bdb7cfa7534b7403","_id":"http-proxy-middleware@0.2.0","_shasum":"b17921ebef893b9d8e85a7809c979bc626f16320","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"dist":{"shasum":"b17921ebef893b9d8e85a7809c979bc626f16320","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.2.0.tgz","integrity":"sha512-weOYu2iJgH9Q52EsreV/usMNKLwIuM4k59Oza6ygVdGX9pKV/Dq3armek/6tOLwUk5zyqni13fM4WtT1MyRitQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEPRFwCjPVNjW7ZfLgZstqiY2OxKvJ1UICVyH+VTHaveAiAIqcv40n47Qx53n8gyKO8tc2xiYHO81nvmhv8dpu3jcw=="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"directories":{}},"0.3.0":{"name":"http-proxy-middleware","version":"0.3.0","description":"The one-liner proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.7.13","chai":"^3.0.0","connect":"^3.4.0","coveralls":"^2.11.2","express":"^4.13.1","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.2"},"dependencies":{"http-proxy":"^1.11.1","is-glob":"^2.0.0","micromatch":"^2.1.6","url":"^0.10.3"},"gitHead":"b596677e0fe4b6c4d974a21949c5e1361b4cbb33","_id":"http-proxy-middleware@0.3.0","_shasum":"6122fb3e1ac0e63c1f063f34f1344a5eecafcb55","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"6122fb3e1ac0e63c1f063f34f1344a5eecafcb55","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.3.0.tgz","integrity":"sha512-6JBWSiASeGF0GHZNoeWYhkWYKKpSsofoO29D2Loag5l8tKxqyP1gE/FHLoqNHgfi6/1kD9KWkMuID+NMETiiSA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE92YW343SJuoexyVmbBiWOEkce7AXfghv0f5Uu4I4LsAiB5lsjpFuKxc+2wSISZ4n7dQfeJOdtPgpVoHRCiOUdCTQ=="}]},"directories":{}},"0.3.1":{"name":"http-proxy-middleware","version":"0.3.1","description":"The one-liner proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.7.13","chai":"^3.0.0","connect":"^3.4.0","coveralls":"^2.11.2","express":"^4.13.1","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.2"},"dependencies":{"http-proxy":"^1.11.1","is-glob":"^2.0.0","micromatch":"~2.1.6","url":"^0.10.3"},"gitHead":"bcb949b051fa46810fcce7defb8d0f927214db62","_id":"http-proxy-middleware@0.3.1","_shasum":"578855ae2b602dc0dc1ce9e6e16f72d60eae5cd0","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"dist":{"shasum":"578855ae2b602dc0dc1ce9e6e16f72d60eae5cd0","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.3.1.tgz","integrity":"sha512-0ov/7aIfe88BVYU/r8z79b3Ltl+wMTUlB00jXW2Xe1UGtWkZxdJsAGqE+xAWNfTBnFkqkj587eVsYq+s8pUgig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA2FvyqU6FEnlQ/VLM+FzanS36MTnBAnuREWxnve0CUJAiA1jOo2i0V1lE8hRGrSE/t1AX41iNZv/fd9rwvEn46oCw=="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"directories":{}},"0.3.2":{"name":"http-proxy-middleware","version":"0.3.2","description":"The one-liner proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.7.13","chai":"^3.0.0","connect":"^3.4.0","coveralls":"^2.11.2","express":"^4.13.1","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.2"},"dependencies":{"http-proxy":"^1.11.1","is-glob":"^2.0.0","micromatch":"^2.2.0","url":"^0.10.3"},"gitHead":"e6ef751eb707e2898bed65e23e88fa570123e87c","_id":"http-proxy-middleware@0.3.2","_shasum":"159cf6e50f712b50a25582f43b2672869bcd5a4d","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"159cf6e50f712b50a25582f43b2672869bcd5a4d","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.3.2.tgz","integrity":"sha512-mB4ATVl+WborixcnHt11O5X1pHMBBQCo00jeFfS6Q0+ZAB0kXbAqAzwO6iwcobo6Ai7i09wY1tF52buTmCJWoQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDi4aJj704Bs4wSu1dnFSMhLnGGf8Q8L1F8SXZ9dHz/AQIgcNoIxD26ZxDhNssQeKtDJCkC20I2VBznVAZMUPDI49Q="}]},"directories":{}},"0.4.0":{"name":"http-proxy-middleware","version":"0.4.0","description":"The one-liner proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp","websocket"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.7.13","chai":"^3.0.0","connect":"^3.4.0","coveralls":"^2.11.2","express":"^4.13.1","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.2","ws":"^0.7.2"},"dependencies":{"http-proxy":"^1.11.1","is-glob":"^2.0.0","micromatch":"^2.2.0","url":"^0.10.3"},"gitHead":"b10d7301fcde3be94b8fe4708ec1e0ad17b0bf4a","_id":"http-proxy-middleware@0.4.0","_shasum":"82fc0fa2602ad8cd5adb35e0e4e15f9a612e26d6","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"82fc0fa2602ad8cd5adb35e0e4e15f9a612e26d6","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.4.0.tgz","integrity":"sha512-EojgusI1iD1D7tGN2Y12NwSO6pYMT4OSlysNgjEIfHjyLtKjIxT32XzqgGk4lmjQ5NdAfXDRK4ZlThe5YQbkAw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGFWACSwl2wMVpX80WDWGOPyKSV/jlDk+eGT0eyEQhlAIhAO+fKIgDhlDzoLvqikOFwoAZhRM8Hup9H46xEGKDv5j4"}]},"directories":{}},"0.5.0":{"name":"http-proxy-middleware","version":"0.5.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp","websocket"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.7.13","chai":"^3.0.0","connect":"^3.4.0","coveralls":"^2.11.2","express":"^4.13.1","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.2","ws":"^0.7.2"},"dependencies":{"http-proxy":"^1.11.1","is-glob":"^2.0.0","micromatch":"^2.2.0","url":"^0.10.3"},"gitHead":"a025f336746df150c58f2851595b8073b3f96e42","_id":"http-proxy-middleware@0.5.0","_shasum":"404e8e8104f2bd000fa6946c9624214a8ba19e3a","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"404e8e8104f2bd000fa6946c9624214a8ba19e3a","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.5.0.tgz","integrity":"sha512-Z9Rxz8QZT0f8HctDXA07pG6gEGKIFCSjsFumHfwTUJmJ6AFi0yT83ZCkm2t+lWRdvPGQXUKpieE10FUIQ2ptxA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDviHOn5vSwNIkBl5sMSe3aCDTcnTeRrC0RF+V593skQIhAIge38k1A05b/Hct02wBfxIcpaUriedX/uLfclOXv8rf"}]},"directories":{}},"0.6.0":{"name":"http-proxy-middleware","version":"0.6.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp","websocket"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.7.13","chai":"^3.0.0","connect":"^3.4.0","coveralls":"^2.11.2","express":"^4.13.1","istanbul":"^0.3.17","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.2","ws":"^0.7.2"},"dependencies":{"http-proxy":"^1.11.1","is-glob":"^2.0.0","lodash":"^3.10.1","micromatch":"^2.2.0","url":"^0.10.3"},"gitHead":"bb473ad7c20de225fdaed6a7e74e29f3f948fce6","_id":"http-proxy-middleware@0.6.0","_shasum":"d5ac345ddb60fb9902c0c82c4754ec243e52018c","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"dist":{"shasum":"d5ac345ddb60fb9902c0c82c4754ec243e52018c","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.6.0.tgz","integrity":"sha512-6/s0SWl5PoIn0HeBeVRgTNAKt0QgdmT9rnFdb1J80jg7B36UY3Eg3PB3eXraj0c2AaSaIaF30xUebmlGNUkhhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFXt+KgTMYgi+bcsl0AJwb+fAUmG4YJ7ufMVVIH/D6pAiEAtKBWuh7MNZQqW6TZdPriaQiYGJggFlNwL6LR6GTlzJI="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"directories":{}},"0.7.0":{"name":"http-proxy-middleware","version":"0.7.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp","websocket"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.8.2","chai":"^3.2.0","connect":"^3.4.0","coveralls":"^2.11.4","express":"^4.13.3","istanbul":"^0.3.18","istanbul-coveralls":"^1.0.3","mocha":"^2.2.5","mocha-lcov-reporter":"0.0.2","ws":"^0.8.0"},"dependencies":{"http-proxy":"^1.11.1","is-glob":"^2.0.0","lodash":"^3.10.1","micromatch":"^2.2.0","url":"^0.10.3"},"gitHead":"75a062515001910ce803b1147ee8310a102c82b8","_id":"http-proxy-middleware@0.7.0","_shasum":"350d6c2c849dd322535e1b042a01fde386d1f308","_from":".","_npmVersion":"2.11.2","_nodeVersion":"0.12.5","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"350d6c2c849dd322535e1b042a01fde386d1f308","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.7.0.tgz","integrity":"sha512-Gin228bfAG0xRysNF/iSo22qhQE4Or+vURyTxdFE0pB2aQYugzT4pwaH3HZ5oDstcRVMnoiw/3JDC2y0kj7nTQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDREsqCz5aBV9ozqZUbI/VuSKoyRAUT0kqv+YV8I+2wwIgAlo6fxRzzPG9cvJqQosaK84DgSD1VHAnkG0oKQzusrA="}]},"directories":{}},"0.8.0":{"name":"http-proxy-middleware","version":"0.8.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp","websocket"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.8.2","chai":"^3.2.0","connect":"^3.4.0","coveralls":"^2.11.4","express":"^4.13.3","istanbul":"^0.3.19","istanbul-coveralls":"^1.0.3","mocha":"^2.3.0","mocha-lcov-reporter":"0.0.2","ws":"^0.8.0"},"dependencies":{"http-proxy":"^1.11.2","is-glob":"^2.0.0","lodash":"^3.10.1","micromatch":"^2.2.0"},"gitHead":"f1559c909f0ed3239a970c73f15755d65de86a53","_id":"http-proxy-middleware@0.8.0","_shasum":"47698ccccee8fd6ff35013ff3dbe70150dae628c","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"dist":{"shasum":"47698ccccee8fd6ff35013ff3dbe70150dae628c","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.8.0.tgz","integrity":"sha512-iffdU39dMD2PBC8kJewqhcdRhxmXu2HGl/IFLfyu53dx4kYzFRILCKpE68SboIdqf6c2AHjm1GCs7QL4Fl7N9w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4AWQd96K09fimEdGg3ql1zL88J6eB1OhqDaViTHmDPwIgUJILzBsoRZocAfYxrTmkI4VFvUvbNlcWHfGFcWxarbg="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"directories":{}},"0.8.1":{"name":"http-proxy-middleware","version":"0.8.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp","websocket"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.8.2","chai":"^3.2.0","connect":"^3.4.0","coveralls":"^2.11.4","express":"^4.13.3","istanbul":"^0.3.19","istanbul-coveralls":"^1.0.3","mocha":"^2.3.0","mocha-lcov-reporter":"0.0.2","ws":"^0.8.0"},"dependencies":{"http-proxy":"^1.11.2","is-glob":"^2.0.0","lodash":"^3.10.1","micromatch":"^2.2.0"},"gitHead":"13f949160afd7ef754d5a27af9514d76099817f7","_id":"http-proxy-middleware@0.8.1","_shasum":"081b8251f40997ea94f3d7909ffa853cdfc86455","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"dist":{"shasum":"081b8251f40997ea94f3d7909ffa853cdfc86455","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.8.1.tgz","integrity":"sha512-NiX6XaptbgRYz11RIFYTd20neoUinQF6yyBftiKYnpKNqSdcBO6MoXyXocVzLhPLF0dzDC7b8B/aYKGdANjkew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFDLJQQOVNU+heWBgH1QzOcce5N7+qktlY+44XClgc4bAiEAnK2014kdyy6NEbv43ZJAY0Utfd31FVLtkjLv/uPgOKU="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"directories":{}},"0.8.2":{"name":"http-proxy-middleware","version":"0.8.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp","websocket"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.8.2","chai":"^3.2.0","connect":"^3.4.0","coveralls":"^2.11.4","express":"^4.13.3","istanbul":"^0.3.19","istanbul-coveralls":"^1.0.3","mocha":"^2.3.0","mocha-lcov-reporter":"0.0.2","ws":"^0.8.0"},"dependencies":{"http-proxy":"^1.11.2","is-glob":"^2.0.0","lodash":"^3.10.1","micromatch":"^2.2.0"},"gitHead":"5f343b95eac318156e4475d80ec9b9c56437c273","_id":"http-proxy-middleware@0.8.2","_shasum":"8ea108c0e2c5b06a889fdec11328782a420e87c6","_from":".","_npmVersion":"2.14.3","_nodeVersion":"4.1.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"8ea108c0e2c5b06a889fdec11328782a420e87c6","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.8.2.tgz","integrity":"sha512-qdWJBLVl2qsNlLeGDyHtJf8+AVAdbIcJuw7+8SHi3dgrPFSkZHSpAFxUc8b07w2QzWFVDoOXnS0T8XkQlAVB/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOGEiscDLZ8w53jN+DA1TiO4vqWuqlXvGKQmTdvxFstQIhAJrg7JtoBac6ZBJJsAL1OwExdGLOOxED4c6l5R9GhL4p"}]},"directories":{}},"0.9.0":{"name":"http-proxy-middleware","version":"0.9.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["proxy","middleware","http","https","connect","express","browser-sync","gulp","websocket"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.8.2","chai":"^3.2.0","connect":"^3.4.0","coveralls":"^2.11.4","express":"^4.13.3","istanbul":"^0.3.19","istanbul-coveralls":"^1.0.3","mocha":"^2.3.0","mocha-lcov-reporter":"0.0.2","ws":"^0.8.0"},"dependencies":{"http-proxy":"^1.11.2","is-glob":"^2.0.0","lodash":"^3.10.1","micromatch":"^2.2.0"},"gitHead":"57094e506e92bd7a3f5e6cf94dbbad7632cdfcad","_id":"http-proxy-middleware@0.9.0","_shasum":"017be05797de74548653e02453b42ba42b7b0326","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"017be05797de74548653e02453b42ba42b7b0326","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.9.0.tgz","integrity":"sha512-qyaqUlH92BR7vdw5/dl9V/XmNPbuxgCE0jMU7otHkVhyqXNsMH9Eun/GhI6hMs3JdLODmTs+jSeaQYmHkznDIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBA5fhxBa/XKkqYd/83Il6cor+ywLE7rwPRcmhM3oyrAiEA0IwW0rulGboVwi7QU/wVKmDFPcMwH3HvJk+pqqc1/D8="}]},"directories":{}},"0.9.1":{"name":"http-proxy-middleware","version":"0.9.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.11.0","chai":"^3.4.1","connect":"^3.4.0","coveralls":"^2.11.6","express":"^4.13.3","istanbul":"^0.4.1","istanbul-coveralls":"^1.0.3","mocha":"^2.3.4","mocha-lcov-reporter":"1.0.0","ws":"^1.0.1"},"dependencies":{"http-proxy":"^1.12.0","is-glob":"^2.0.1","lodash":"^3.10.1","micromatch":"^2.3.7"},"gitHead":"fe24b979cf7a55b757092203a5c7832233ff67ea","_id":"http-proxy-middleware@0.9.1","_shasum":"f068d8f4b6faf96cf57712f16a5e6eb50731549a","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.3.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"f068d8f4b6faf96cf57712f16a5e6eb50731549a","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.9.1.tgz","integrity":"sha512-Wr5vljXtuzlNUzWBXei068dfk0h0p+LrP8xDq62PJjJYqvIDVH2JAKzCvWNqS07jhSSc26pIlLSPt7ZBZSZ0NA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCPBmaS3niP9W6pIKfqPxH+ygUnQ3h/kxwTj0PrWP/NwIgcxkUuTuAeZjtHppgLH41Lf7JzwLOMirhq02zT+V4iZo="}]},"directories":{}},"0.10.0-beta":{"name":"http-proxy-middleware","version":"0.10.0-beta","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.11.0","chai":"^3.4.1","connect":"^3.4.0","coveralls":"^2.11.6","express":"^4.13.3","istanbul":"^0.4.1","istanbul-coveralls":"^1.0.3","mocha":"^2.3.4","mocha-lcov-reporter":"1.0.0","ws":"^1.0.1"},"dependencies":{"http-proxy":"^1.12.0","is-glob":"^2.0.1","lodash":"^3.10.1","micromatch":"^2.3.7"},"gitHead":"8ce646fe7c7736e9d90bc5d02682bc3fcc649da1","_id":"http-proxy-middleware@0.10.0-beta","_shasum":"5573a0d75182da174488a44d56d3427081a1fc61","_from":".","_npmVersion":"3.3.12","_nodeVersion":"5.5.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"5573a0d75182da174488a44d56d3427081a1fc61","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.10.0-beta.tgz","integrity":"sha512-vMhwfPJBvzJt0kuyBfNZAgfkjmqg2Q0onA5pfV8hQPjRi/gc5CqomlDNWT3pBhVF8o7Bir/sESpSccNLqTyuJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAFzvov0Fje95KLyUJ2nDVDW/SYZsM64X/CdB5kPuihDAiEAiIHOtr9JiI4NzMI04Hni9So5oGjrH9jQkZpTRhbg/tY="}]},"directories":{}},"0.10.0":{"name":"http-proxy-middleware","version":"0.10.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.11.0","chai":"^3.4.1","connect":"^3.4.0","coveralls":"^2.11.6","express":"^4.13.3","istanbul":"^0.4.1","istanbul-coveralls":"^1.0.3","mocha":"^2.3.4","mocha-lcov-reporter":"1.0.0","ws":"^1.0.1"},"dependencies":{"http-proxy":"^1.12.0","is-glob":"^2.0.1","lodash":"^3.10.1","micromatch":"^2.3.7"},"gitHead":"5bed3c630c00c0d301fcdda4e4ea20ab31a95bfd","_id":"http-proxy-middleware@0.10.0","_shasum":"6060a8bf03c8443a5de7d5f279e95fa0ac0b1cfa","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"6060a8bf03c8443a5de7d5f279e95fa0ac0b1cfa","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.10.0.tgz","integrity":"sha512-IrxEUPtUrrKXCiJtld4ulrYnKhVcpscx+3K5yB9AbOOqaqcTQm/TVnwP9cWqHmJ+FoQuuIsjRImVrhRwL+h0VQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6NPR/FjtDYVzDaHJMtW1gf9OChh7KdMLgqig6JP27QAIhAKtjvvuaPXCoyncB3YCmjTHbjL8mZzv0M1oD8jTn18fg"}]},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.10.0.tgz_1454699998631_0.40408703149296343"},"directories":{}},"0.11.0":{"name":"http-proxy-middleware","version":"0.11.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.11.0","chai":"^3.4.1","connect":"^3.4.0","coveralls":"^2.11.6","express":"^4.13.3","istanbul":"^0.4.1","istanbul-coveralls":"^1.0.3","mocha":"^2.3.4","mocha-lcov-reporter":"1.0.0","ws":"^1.0.1"},"dependencies":{"http-proxy":"^1.12.0","is-glob":"^2.0.1","lodash":"^3.10.1","micromatch":"^2.3.7"},"gitHead":"1f21feda49e57806d82be94ba3f3e46a70e7f868","_id":"http-proxy-middleware@0.11.0","_shasum":"0d279b6791b1d1620dca09b657f186e63c84763e","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"0d279b6791b1d1620dca09b657f186e63c84763e","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.11.0.tgz","integrity":"sha512-qnW4f57XjfqZN30uyJ0fprCbCrPrXfVT5u2DKlosFuiUlgbqpnWW7Ir5d8jvLWTYQPpuHO1i6cyEFLWrIBjJZA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIfleJPONtOwbpiIHlrAiKh176LVtI65/WWZt0/V/yVQIgHKNa3wAW76tHVPDBbREqdzRpJeA+mEKwPm6Im67a4yQ="}]},"_npmOperationalInternal":{"host":"packages-9-west.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.11.0.tgz_1456344044565_0.8594308719038963"},"directories":{}},"0.12.0":{"name":"http-proxy-middleware","version":"0.12.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.11.0","chai":"^3.4.1","connect":"^3.4.0","coveralls":"^2.11.6","express":"^4.13.3","istanbul":"^0.4.1","istanbul-coveralls":"^1.0.3","mocha":"^2.3.4","mocha-lcov-reporter":"1.0.0","ws":"^1.0.1"},"dependencies":{"http-proxy":"^1.12.0","is-glob":"^2.0.1","lodash":"^3.10.1","micromatch":"^2.3.7"},"gitHead":"951d9bf3fe81d83935bdcb8dfb51643a2775f251","_id":"http-proxy-middleware@0.12.0","_shasum":"014849335422dcd28e6eeddb5af1d9d2917fcb36","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"014849335422dcd28e6eeddb5af1d9d2917fcb36","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.12.0.tgz","integrity":"sha512-mL4jL7mca1ywqRQXBLJ+HK9LOxi8fkozkc1pB+3sG4DRy/d+3WZiWrJyTEMJHNVnRDnNvyhZarKjfc8NqHO7Aw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICslgNmjh3cNhDNafVzyFidL4Wpm8fSKkhwCoLip+C8PAiEA3WXVtObMvpn3uszu+UOL84VKs1daKqGDNwLiEjoMhhs="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.12.0.tgz_1457891496060_0.7292140051722527"},"directories":{}},"0.13.0":{"name":"http-proxy-middleware","version":"0.13.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.11.0","chai":"^3.4.1","connect":"^3.4.0","coveralls":"^2.11.6","express":"^4.13.3","istanbul":"^0.4.1","istanbul-coveralls":"^1.0.3","mocha":"^2.3.4","mocha-lcov-reporter":"1.2.0","ws":"^1.0.1"},"dependencies":{"http-proxy":"^1.12.0","is-glob":"^2.0.1","lodash":"^4.6.1","micromatch":"^2.3.7"},"gitHead":"6606489c35a06ded05694d33a15cf02917ca1173","_id":"http-proxy-middleware@0.13.0","_shasum":"9c765abb4027b3a95b9e8da8e4f4fa65b1ecca39","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"9c765abb4027b3a95b9e8da8e4f4fa65b1ecca39","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.13.0.tgz","integrity":"sha512-ZOO3zSnpaKU4haf9TgGa1G5iSIiC9e459yW8pLXa2i84Iv5oKlVDoZVfEzwJgjdduIHA3DJWPoYGbQNukTTc8w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnuU89f46Oxbtn3xivgv8WQYynmUIi8gcKWW/KvgqBEQIgOtnHnnbyGOTpMUotVF4Hctk3fFImn1AxjuscuQxawiE="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.13.0.tgz_1458764570225_0.37139365426264703"},"directories":{}},"0.14.0":{"name":"http-proxy-middleware","version":"0.14.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.11.0","chai":"^3.4.1","connect":"^3.4.0","coveralls":"^2.11.6","express":"^4.13.3","istanbul":"^0.4.1","istanbul-coveralls":"^1.0.3","mocha":"^2.3.4","mocha-lcov-reporter":"1.2.0","open":"0.0.5","ws":"^1.0.1"},"dependencies":{"http-proxy":"^1.12.0","is-glob":"^2.0.1","lodash":"^4.6.1","micromatch":"^2.3.7"},"gitHead":"28f17062174987e80bdb3ff60478d746a17cb43f","_id":"http-proxy-middleware@0.14.0","_shasum":"4bf97e2794201c5cd0ba07ca401c267f9d014444","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"4bf97e2794201c5cd0ba07ca401c267f9d014444","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.14.0.tgz","integrity":"sha512-PNruFhYrKYil3DRlcFQfFgVtrAk78bD8F24x4DzObWkuKdiX79L/ym1FvOR/y7IoVHsnRWRKBkLCf+BR1qSIbA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCt/zPTW+VVqIInFpuP8+h4sNxug1DR6U3tVIqZiWrJ6wIgB7BlbBbERBsofqOP1YJsNsjEtf2YMLqyum4n/47/qW8="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.14.0.tgz_1461011862294_0.11940710246562958"},"directories":{}},"0.15.0":{"name":"http-proxy-middleware","version":"0.15.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.12.5","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.9","express":"^4.13.4","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","mocha":"^2.4.5","mocha-lcov-reporter":"1.2.0","opn":"^4.0.1","ws":"^1.1.0"},"dependencies":{"http-proxy":"^1.13.2","is-glob":"^2.0.1","lodash":"^4.11.2","micromatch":"^2.3.8"},"gitHead":"b33b96978506ce00b7833f94514523a696e6cb13","_id":"http-proxy-middleware@0.15.0","_shasum":"59b8c391b2b838763388b0fad48b5bd36b3c0152","_from":".","_npmVersion":"3.6.0","_nodeVersion":"5.5.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"59b8c391b2b838763388b0fad48b5bd36b3c0152","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.15.0.tgz","integrity":"sha512-apH91g111VDGC9ZAB8nyPohymlVVQQI2LffgIu/q4Q6nJ8naz9dZpjkkjhLT4hlqzNsA7D1iKgBgeqCZIhXJiA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGucT68EBtZKZeZraRgYOTiVBRtnrZ2Mic8f4abX1XkQAiEA2Z0JvySb4tefIJ/2hnreX5XSoKu+AjGeEZ+ZBFguSOE="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.15.0.tgz_1462309355357_0.6974488440901041"},"directories":{}},"0.15.1-beta":{"name":"http-proxy-middleware","version":"0.15.1-beta","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --recursive --colors --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.12.5","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.9","express":"^4.13.4","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","mocha":"^2.4.5","mocha-lcov-reporter":"1.2.0","opn":"^4.0.1","ws":"^1.1.0"},"dependencies":{"http-proxy":"^1.13.2","is-glob":"^2.0.1","lodash":"^4.11.2","micromatch":"^2.3.8"},"gitHead":"9bf680f5b6ccef0440b86672c8bd1088b760ee64","_id":"http-proxy-middleware@0.15.1-beta","_shasum":"ff501cb51a82d6ec3209c1f8c4345806a4fdaad8","_from":".","_npmVersion":"2.7.5","_nodeVersion":"6.0.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"ff501cb51a82d6ec3209c1f8c4345806a4fdaad8","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.15.1-beta.tgz","integrity":"sha512-0BtW9cEmVeCSD8PFfhys+g9SFrGgnrG/m/qpoivfRA21fOxzGKyUBaoRkgjLqDcGiJLAy6r3WtUntiwzQMR16A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHN8dAX/wKkfC5/SDPMaEavHCl2L4hD7PHK4eD38851MAiEAg3MgRlfTSE2kxwD3OnC2iE/NGhAAsrvspbClj9rJTgk="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.15.1-beta.tgz_1463590456172_0.49187433044426143"},"directories":{}},"0.15.1":{"name":"http-proxy-middleware","version":"0.15.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --recursive --colors --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.12.5","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.9","express":"^4.13.4","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","mocha":"^2.4.5","mocha-lcov-reporter":"1.2.0","opn":"^4.0.1","ws":"^1.1.0"},"dependencies":{"http-proxy":"^1.13.2","is-glob":"^2.0.1","lodash":"^4.11.2","micromatch":"^2.3.8"},"gitHead":"9e542faa39fd9e8caa9785088fb99511b24f41f3","_id":"http-proxy-middleware@0.15.1","_shasum":"bf455c567f6f411e66dce082d90c9049bfc391d2","_from":".","_npmVersion":"2.7.5","_nodeVersion":"6.0.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"bf455c567f6f411e66dce082d90c9049bfc391d2","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.15.1.tgz","integrity":"sha512-uKNovjz3KwEMxWKE+45oW3Wb12vhknGEmr+5Y5cYs4HIZvaduHRYXZlEMIf4ybxpSMGQQkhqohQQH/ROEuagzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+gHctZHct1PIjn+d8Kqnuv6hVqUExsrxZ+jyqSvD4rQIhAIE2alWksTqKjsmP5vznWYCfXRHaFWiCIIhtgCFlLlM/"}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.15.1.tgz_1464300122470_0.43105378933250904"},"directories":{}},"0.15.2":{"name":"http-proxy-middleware","version":"0.15.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"test":"mocha --recursive --colors --reporter spec","cover":"rm -rf coverage && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && rm -rf coverage"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.12.5","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.9","express":"^4.13.4","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","mocha":"^2.4.5","mocha-lcov-reporter":"1.2.0","opn":"^4.0.1","ws":"^1.1.0"},"dependencies":{"http-proxy":"^1.13.2","is-glob":"^2.0.1","lodash":"^4.11.2","micromatch":"^2.3.8"},"gitHead":"679526ef1f3a61e4b68c26d9f644195e93727b72","_id":"http-proxy-middleware@0.15.2","_shasum":"e1c69b8948fb04e2846ee22f38b650e4f09c027f","_from":".","_npmVersion":"2.7.5","_nodeVersion":"6.0.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"e1c69b8948fb04e2846ee22f38b650e4f09c027f","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.15.2.tgz","integrity":"sha512-XXqY+AQA5yxhQtc83IwCkupZNKMs112HQWvRxb1/fivgk0tjN/xX3yg4U/DG/4EWXy2suDWy5ORZAWc2C4CITw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXcS3VjQX0fUCrBQV+XIWpQzxbKfU10DYiigFgTqDqmQIgIJYJXo8arU48LTidHhYHl5TGy/bYL6AKHjNnwTBTNEw="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.15.2.tgz_1464526274174_0.0279650641605258"},"directories":{}},"0.16.0":{"name":"http-proxy-middleware","version":"0.16.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"clean":"rm -rf coverage","test":"mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.13.0","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.9","express":"^4.13.4","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","mocha":"^2.5.3","mocha-lcov-reporter":"1.2.0","opn":"^4.0.2","ws":"^1.1.0"},"dependencies":{"http-proxy":"^1.13.3","is-glob":"^2.0.1","lodash":"^4.13.1","micromatch":"^2.3.8"},"gitHead":"09926cdd29573e2966993a743d8b68e415f9c6b5","_id":"http-proxy-middleware@0.16.0","_shasum":"6879b8f1151a3289dd301372b81d8dd026e3162b","_from":".","_npmVersion":"2.7.5","_nodeVersion":"6.2.1","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"6879b8f1151a3289dd301372b81d8dd026e3162b","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.16.0.tgz","integrity":"sha512-fmW6k5kh6srHrhUA1dWWCirkBvOP11fL68okRA0nKL//arDyVJw4zQ172trK807zsXVZGw9YZzMUhx+pF0fvNA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtCFR1e5IWrioaV31lESdYdLPdfAcrXYVx+5Zltwz/RgIhAL5r3YRRgUt/QEGlyCX6mADx+8EUIh+QNXAQAzVtmQAu"}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.16.0.tgz_1465843953253_0.4956787379924208"},"directories":{}},"0.17.0-beta":{"name":"http-proxy-middleware","version":"0.17.0-beta","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"clean":"rm -rf coverage","test":"mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.13.0","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.9","express":"^4.13.4","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","mocha":"^2.5.3","mocha-lcov-reporter":"1.2.0","opn":"^4.0.2","ws":"^1.1.0"},"dependencies":{"http-proxy":"^1.13.3","is-glob":"^2.0.1","lodash":"^4.13.1","micromatch":"^2.3.8"},"gitHead":"0ec0e6f906c8c41f1a73ecaa1ccc699d20fa7144","_id":"http-proxy-middleware@0.17.0-beta","_shasum":"847e594412dccab5f20c1330bd1234de6612eda1","_from":".","_npmVersion":"2.7.5","_nodeVersion":"6.2.1","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"847e594412dccab5f20c1330bd1234de6612eda1","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.0-beta.tgz","integrity":"sha512-nHRVf5AfWSgYqBjU8zppGXGdGe6k0a4JRwrVO9X4NAJgYSa8eKEOBHb+w+/TW7EW5BZNWdcfyt5po6JXIZ0DDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8wxq6IDuQSQttllRCZ0TYQiMlKpsxQla26wcrViGRFAIhAJKjZrjcp7oFGhSf2WXgIKTHutsAgD0VkvfKMMlgS/dt"}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.17.0-beta.tgz_1466090685347_0.03170943818986416"},"directories":{}},"0.17.0":{"name":"http-proxy-middleware","version":"0.17.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"clean":"rm -rf coverage","test":"mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.13.0","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.9","express":"^4.13.4","istanbul":"^0.4.3","istanbul-coveralls":"^1.0.3","mocha":"^2.5.3","mocha-lcov-reporter":"1.2.0","opn":"^4.0.2","ws":"^1.1.0"},"dependencies":{"http-proxy":"^1.13.3","is-glob":"^2.0.1","lodash":"^4.13.1","micromatch":"^2.3.8"},"gitHead":"306fdd4162af41a5ced5ba17be80cbb861204f5f","_id":"http-proxy-middleware@0.17.0","_shasum":"65770b0bb5d2b17792984e595afb082599bf81e7","_from":".","_npmVersion":"2.7.5","_nodeVersion":"6.2.1","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"65770b0bb5d2b17792984e595afb082599bf81e7","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.0.tgz","integrity":"sha512-6O+5Mfkk/hMGzQrAe6mvRuJjdmnBsJrfbEs4LI0unqKp7TRBBBdFotGQcZY6XPKr9WtPVKiUqjEKeCa+kxiP5g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB1+VdxgoonEfM5RL67GuS2nJEsL8NYWQMlixSnVcu7fAiEA98z3Mu3m8MCLSfmBrTBq5YlOtbaZhcnfli+21iVsNHM="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.17.0.tgz_1467560119815_0.34178488166071475"},"directories":{}},"0.17.1":{"name":"http-proxy-middleware","version":"0.17.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"clean":"rm -rf coverage","test":"mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.14.0","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.12","express":"^4.14.0","istanbul":"^0.4.4","istanbul-coveralls":"^1.0.3","mocha":"^3.0.2","mocha-lcov-reporter":"1.2.0","opn":"^4.0.2","ws":"^1.1.1"},"dependencies":{"http-proxy":"^1.14.0","is-glob":"^2.0.1","lodash":"^4.14.2","micromatch":"^2.3.11"},"gitHead":"8a0ff1f0da2496b517ba02ccb30b1a9a17926dc7","_id":"http-proxy-middleware@0.17.1","_shasum":"e2b847aa9962d8ce312cc82a3f443d5039cf197a","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.2.1","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"e2b847aa9962d8ce312cc82a3f443d5039cf197a","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.1.tgz","integrity":"sha512-qKK59hPa6B85qL4Lk2RCd/qgfZLMEx2BN3fdsskabAr2z+oLGDGoUhi75r9lnHFRa/8BGG9VGOVX08KogEePCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAaJO6GKG28vdtZmEEMyFtDiyX/eYXruGN22lM90tii6AiEA8yYnxmzCjF3OKpYUZzldQ5NDJSMI5pxmaQ695/gIq/I="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.17.1.tgz_1470951029603_0.6751409117132425"},"directories":{}},"0.17.2-beta":{"name":"http-proxy-middleware","version":"0.17.2-beta","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","files":["index.js","lib"],"scripts":{"clean":"rm -rf coverage","test":"mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.14.0","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.12","express":"^4.14.0","istanbul":"^0.4.4","istanbul-coveralls":"^1.0.3","mocha":"^3.0.2","mocha-lcov-reporter":"1.2.0","opn":"^4.0.2","ws":"^1.1.1"},"dependencies":{"http-proxy":"^1.14.0","is-glob":"^2.0.1","lodash":"^4.14.2","micromatch":"^2.3.11"},"gitHead":"7d1865c84f4339ced230b0292db42c4d45376f1a","_id":"http-proxy-middleware@0.17.2-beta","_shasum":"a232f70909dd9848ab2b2da7d59068b83a9ff9a8","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.2.1","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"a232f70909dd9848ab2b2da7d59068b83a9ff9a8","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.2-beta.tgz","integrity":"sha512-MQZCx/0eqYmKWnRDKpUfwWGTsMPcW1qKPGcACBbR8yn5AOepC1jRIiSOXb18N6VnuenXiibveApyw4UCf45gjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF9hykx728aR5xARKg2Ghy605g9tGSFhtcYf5dBiS3MHAiBhy3zx9OJDH0zDMU4HNDCssGlRutA751A9Ne4aMQ3Jjw=="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.17.2-beta.tgz_1473513288951_0.5517864497378469"},"directories":{}},"0.17.2":{"name":"http-proxy-middleware","version":"0.17.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","files":["index.js","lib"],"scripts":{"clean":"rm -rf coverage","test":"mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.14.0","chai":"^3.5.0","connect":"^3.4.1","coveralls":"^2.11.12","express":"^4.14.0","istanbul":"^0.4.4","istanbul-coveralls":"^1.0.3","mocha":"^3.0.2","mocha-lcov-reporter":"1.2.0","opn":"^4.0.2","ws":"^1.1.1"},"dependencies":{"http-proxy":"^1.15.1","is-glob":"^3.0.0","lodash":"^4.16.2","micromatch":"^2.3.11"},"gitHead":"f03aecf755a0a645a83646131548754638b2e994","_id":"http-proxy-middleware@0.17.2","_shasum":"572d517a6d2fb1063a469de294eed96066352007","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.2.1","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"572d517a6d2fb1063a469de294eed96066352007","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.2.tgz","integrity":"sha512-KNsZ7m/kRjAK3XbKiS5NfXLjHsqnRLfGNjVZ1g3JD36Wl0wstSKoyi4pYngZ859f8ts9YDYIV1WUGcmc8lOBTg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICEA14q/s/N6BEOfhvJqC8zw5KLU18ST4Ovgb1Mh8ptUAiEAq90hCzwJ6z6Ha/xRhIn3hZkCjmOdVP+zL+/oPYN+BYc="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.17.2.tgz_1475101693149_0.3973892144858837"},"directories":{}},"0.17.3":{"name":"http-proxy-middleware","version":"0.17.3","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","files":["index.js","lib"],"scripts":{"clean":"rm -rf coverage","test":"mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.18.2","chai":"^3.5.0","connect":"^3.5.0","coveralls":"^2.11.15","express":"^4.14.0","istanbul":"^0.4.5","istanbul-coveralls":"^1.0.3","mocha":"^3.2.0","mocha-lcov-reporter":"1.2.0","opn":"^4.0.2","ws":"^1.1.1"},"dependencies":{"http-proxy":"^1.16.2","is-glob":"^3.1.0","lodash":"^4.17.2","micromatch":"^2.3.11"},"gitHead":"8689cb429577a7722b9334e702535cb752191c43","_id":"http-proxy-middleware@0.17.3","_shasum":"940382147149b856084f5534752d5b5a8168cd1d","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.2.1","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"940382147149b856084f5534752d5b5a8168cd1d","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.3.tgz","integrity":"sha512-HKx1Oa7U9YdcZyqquh86ZQ8ZEcLCfcNQctD2S+0JFSmNV+dMUMXI4Zxbh2Yn/ivUM7CIkBOLjQm0Xizg/7eQEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0dt+JPgYp7/kmnX9o7IQs11aUfmgjt+nCjJoM6zRPqwIhAI+EwtaARzvFbcvOttLvbS8/JV1KPdfMuqiyUuevw4SR"}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.17.3.tgz_1481145720041_0.3982126035261899"},"directories":{}},"0.17.4":{"name":"http-proxy-middleware","version":"0.17.4","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","files":["index.js","lib"],"scripts":{"clean":"rm -rf coverage","test":"mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"browser-sync":"^2.18.2","chai":"^3.5.0","connect":"^3.5.0","coveralls":"^2.11.15","express":"^4.14.0","istanbul":"^0.4.5","istanbul-coveralls":"^1.0.3","mocha":"^3.2.0","mocha-lcov-reporter":"1.2.0","opn":"^4.0.2","ws":"^1.1.1"},"dependencies":{"http-proxy":"^1.16.2","is-glob":"^3.1.0","lodash":"^4.17.2","micromatch":"^2.3.11"},"gitHead":"cb5e084e71bc3202fe4f711f2f5edf4e29355d99","_id":"http-proxy-middleware@0.17.4","_shasum":"642e8848851d66f09d4f124912846dbaeb41b833","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.1","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"dist":{"shasum":"642e8848851d66f09d4f124912846dbaeb41b833","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz","integrity":"sha512-JtH3UZju4oXDdca28/kknbm/CFmt35vy0YV0PNOMWWWpn3rT9WV95IXN451xwBGSjy9L0Cah1O9TCMytboLdfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUBb0FbbBVECIYLMP2PQUrqaGMALz9rrBAh6SaKEMAgAiEArr847hoVPs0f6Iwp+F6htxw4wWUSwmVORdi1YfJgY2c="}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/http-proxy-middleware-0.17.4.tgz_1488496050141_0.13289726292714477"},"directories":{}},"0.18.0":{"name":"http-proxy-middleware","version":"0.18.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","files":["index.js","lib"],"scripts":{"clean":"rm -rf coverage","lint":"standard --verbose | snazzy --colors","test":"npm run lint && mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean","commitmsg":"commitlint -e $GIT_PARAMS"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^6.1.3","@commitlint/config-conventional":"^6.1.3","browser-sync":"^2.23.6","chai":"^4.1.2","connect":"^3.6.6","coveralls":"^3.0.0","express":"^4.16.3","husky":"^0.14.3","istanbul":"^0.4.5","istanbul-coveralls":"^1.0.3","mocha":"^5.0.4","mocha-lcov-reporter":"1.3.0","opn":"^5.2.0","snazzy":"^7.1.1","standard":"^11.0.0","ws":"^5.0.0"},"dependencies":{"http-proxy":"^1.16.2","is-glob":"^4.0.0","lodash":"^4.17.5","micromatch":"^3.1.9"},"engines":{"node":">=4.0.0"},"standard":{"env":["mocha"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"_id":"http-proxy-middleware@0.18.0","_npmVersion":"5.7.1","_nodeVersion":"9.8.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"dist":{"integrity":"sha512-Fs25KVMPAIIcgjMZkVHJoKg9VcXcC1C8yb9JUgeDvVXY0S/zgVIhMb+qVswDIgtJe2DfckMSY2d6TuTEutlk6Q==","shasum":"0987e6bb5a5606e5a69168d8f967a87f15dd8aab","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz","fileCount":13,"unpackedSize":45653,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBpa6VskW9mnw1IrbQYm74VTslIgIE7KA3ENIFNQx3RpAiBbmvAH+vsHuFg8RWPyqfZQnLUj9ynwUjQ0ARpe4Tffhw=="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.18.0_1520894840221_0.4597555666447708"},"_hasShrinkwrap":false},"0.19.0":{"name":"http-proxy-middleware","version":"0.19.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"clean":"rm -rf coverage","lint":"standard --verbose | snazzy --colors","lint:fix":"standard --fix","test":"npm run lint && mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean","commitmsg":"commitlint -e $GIT_PARAMS"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^7.1.1","@commitlint/config-conventional":"^7.1.1","browser-sync":"^2.24.7","chai":"^4.1.2","connect":"^3.6.6","coveralls":"^3.0.2","express":"^4.16.3","husky":"^0.14.3","istanbul":"^0.4.5","istanbul-coveralls":"^1.0.3","mocha":"^5.2.0","mocha-lcov-reporter":"1.3.0","opn":"^5.3.0","snazzy":"^8.0.0","standard":"^12.0.0","ws":"^6.0.0"},"dependencies":{"http-proxy":"^1.17.0","is-glob":"^4.0.0","lodash":"^4.17.10","micromatch":"^3.1.10"},"engines":{"node":">=4.0.0"},"standard":{"env":["mocha"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"bb59c666dbb65cc0ef422bbf5332b67cbd6fb0e3","_id":"http-proxy-middleware@0.19.0","_npmVersion":"6.4.1","_nodeVersion":"10.1.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"dist":{"integrity":"sha512-Ab/zKDy2B0404mz83bgki0HHv/xqpYKAyFXhopAiJaVAUSJfLYrpBYynTl4ZSUJ7TqrAgjarTsxdX5yBb4unRQ==","shasum":"40992b5901dc44bc7bc3795da81b0b248eca02d8","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.0.tgz","fileCount":13,"unpackedSize":47638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbhw0DCRA9TVsSAnZWagAAUPcP/1A2WhkhsxkmhjldBC0L\n2g7MExS6bgGFP9gMvsCGXxGG4b6VlxM2oaQovWICSLrgkSJM+KdtNEw+jGjV\nBVlYMtBy25g3QYnYn9UIdmSC2mhZPg/4Th9K3GM8RFapxnzXCaB6IW9aXrrO\nWxIm2kwcHtg30j6EXdZP2dN8QXIA1hiP3cZUvnayP6knfGZmigtN53oL0aya\njK43LJnvLmGrsn8caBrCYKn/iJg/OS5vQ+efwDV9O6IKXdKDqN4FS/wwZ73B\nvgcR2avQP1ltRKxOhxczDSKB2zkSOPUBwYvsICU0HUC8YnkV54JxBFKXd9vZ\nElFjbUZu1VBYmLu2GpY13ohs6Fp6f+0rD31YWf9927pFfu/4bHcAE2TyGMF+\na7oeE6CfsKkKwwcnQAIGEpP2dJqF1B+HQ6PSVxXZu7Aul/coMNVFDrDclN3O\nRGMPZY1zruZd/rxN8EtkRfw8/3/7/kJ4xZLX9iT14CJMjyhSyAuNUrVEKMwa\nBxf2fIXMMPm8ixJDaoV1YAaguDuI175emLeYJQEIO4QRt26qwiFfNzNtncAD\nGfMvcK1iIPmmmqehBqAnykmY7X8vBwKibiqAqzcDIFvYRVBI6XuitpUtzAcj\nTxSPqbK1LK418yU9kyZTQmvIspJM208WSQg8god9nhZEsH6zuVznuJsDxElj\ncYoN\r\n=tNgg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLs/uEWrt+CeyZKzn9DxP2KMCyY46LJmVTGr2pwkAGXAIgEOmcsJQEkYsmxcJeomBY6sGHsLXneu4E2RKpgjxyhek="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.19.0_1535577347082_0.9788730101740601"},"_hasShrinkwrap":false},"0.19.1":{"name":"http-proxy-middleware","version":"0.19.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"clean":"rm -rf coverage","lint":"prettier \"**/*.{js,md}\" --list-different","lint:fix":"prettier \"**/*.{js,md}\" --write","test":"npm run lint && mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^7.2.1","@commitlint/config-conventional":"^7.1.2","browser-sync":"^2.26.3","chai":"^4.2.0","connect":"^3.6.6","coveralls":"^3.0.2","express":"^4.16.4","husky":"^1.2.0","istanbul":"^0.4.5","istanbul-coveralls":"^1.0.3","mocha":"^5.2.0","mocha-lcov-reporter":"1.3.0","opn":"^5.4.0","precise-commits":"^1.0.2","prettier":"^1.15.2","ws":"^6.1.2"},"dependencies":{"http-proxy":"^1.17.0","is-glob":"^4.0.0","lodash":"^4.17.11","micromatch":"^3.1.10"},"engines":{"node":">=4.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"precise-commits"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"6422977cebde7ba6b2a506f47db97aa58ccbd44c","_id":"http-proxy-middleware@0.19.1","_npmVersion":"6.4.1","_nodeVersion":"10.1.0","_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"dist":{"integrity":"sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==","shasum":"183c7dc4aa1479150306498c210cdaf96080a43a","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz","fileCount":13,"unpackedSize":47749,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb+wOjCRA9TVsSAnZWagAAF4wP/iFtdy3Uih6MOUfLwFse\n8CQE+LjzM+VtuI9/7Kgzq22OoLSk9HG4f2X0yOwochMFtzyoXpJiQHbx2VQd\nMV5PMDLfoDAU/U9aLzH/HEJY4cS5/+Aq5tcZJQAEEj2BFh2/HazJ9mor7iF/\n5tnSqANMytw4Ns5s481DQ7kWslmfv6tz1sJfUhu3WZ1KRdum4UNkElwdMDo1\nP1KNOmL6fKewy5gaBvagu79Tn7nbW7JJY9LE5FNlWcb3/CamHI/goiYYfOGB\n+voQbrqRKFkoCEsWQM7jsLaAh9ThaZAOLF2qDqdZOy2TC8JQ/eenxhiLUSxy\n7bDH7KAuRr68UrHXNru/SWFXd0UtOk2RgY26/crlJOCyez/wGrVZ879gen8b\npcJRqFmUOZylMrRLCytnfD6q4WDxFXh7Y8SNPBr6YW6MNS11mgiN2Nf2SD23\nrtU4WgtdD7W/ZazW3Nr3OOhF4rXDnsOZkffZq15Kkx7Au9+VkfIu184WdjN0\nELca91oKH4NtOXSXL+2btOwoxQZK9Cil87brxlJWqBp3oEQZkkapeB6hT+xF\nJmSAnUQHthlLr6Nqh9d+s6Atha/m1dlNNhYE/DlDHIBAPSXamhwi1EB2fO4z\noNl+CkmaNXFRG4i2xazaMDnIiWzwbcpS/X+1yVR3apUTRuqc/uaxe0BjhPwe\n/2D0\r\n=nSVz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCbaD7F5vqWcGzmk9M8aWvU/+ZJ8FllELj7aMeDuxJ9AiB7mg1R5/XmpEezy1zkDKnnjYCdxTo+Okdkqw2z5KNPzQ=="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.19.1_1543177122633_0.17284658095161887"},"_hasShrinkwrap":false},"0.20.0-beta.0":{"name":"http-proxy-middleware","version":"0.20.0-beta.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","scripts":{"clean":"rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && npm run build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && npm run build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^7.2.1","@commitlint/config-conventional":"^7.1.2","@types/express":"^4.16.1","@types/http-proxy":"^1.17.0","@types/is-glob":"^4.0.0","@types/jest":"^24.0.11","@types/lodash":"^4.14.123","@types/micromatch":"^3.1.0","@types/node":"^12.0.4","browser-sync":"^2.26.3","connect":"^3.6.6","coveralls":"^3.0.3","express":"^4.16.4","husky":"^2.3.0","jest":"^24.5.0","open":"^6.3.0","prettier":"^1.15.2","ts-jest":"^24.0.0","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.4.1","ws":"^7.0.0"},"dependencies":{"http-proxy":"^1.17.0","is-glob":"^4.0.1","lodash":"^4.17.11","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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## TL;DR\n\nProxy `/api` requests to `http://www.example.org`\n\n```javascript\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\nvar app = express();\n\napp.use(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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- [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```javascript\n$ npm install --save-dev http-proxy-middleware\n```\n\n## Core concept\n\nProxy middleware configuration.\n\n#### proxy([context,] config)\n\n```javascript\nvar proxy = require('http-proxy-middleware');\n\nvar apiProxy = proxy('/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#### proxy(uri [, config])\n\n```javascript\n// shorthand syntax for the example above:\nvar apiProxy = proxy('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\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\n// proxy middleware options\nvar 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)\nvar exampleProxy = proxy(options);\n\n// mount `exampleProxy` in web server\nvar 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```\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  - `proxy({...})` - matches any path, all requests will be proxied.\n  - `proxy('/', {...})` - matches any path, all requests will be proxied.\n  - `proxy('/api', {...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `proxy(['/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  - `proxy('**', {...})` matches any path, all requests will be proxied.\n  - `proxy('**/*.html', {...})` matches any path which ends with `.html`\n  - `proxy('/*.html', {...})` matches paths directly under path-absolute\n  - `proxy('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api`\n  - `proxy(['/api/**', '/ajax/**'], {...})` combine multiple patterns\n  - `proxy(['/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  var filter = function(pathname, req) {\n    return pathname.match('^/api') && req.method === 'GET';\n  };\n\n  var apiProxy = proxy(filter, { target: 'http://www.example.org' });\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\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\n  router: function(req) {\n      return 'http://localhost:8004';\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    var logger = new (require('winston')).Logger();\n\n    var 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) {\n    res.writeHead(500, {\n      'Content-Type': 'text/plain'\n    });\n    res.end(\n      'Something went wrong. And we are reporting a custom error message.'\n    );\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  ```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    ```\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    ```\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  ```\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\n    proxy.web(req, res, {\n      target: 'http://localhost:4003/',\n      buffer: streamify(req.rawBody)\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\nproxy('http://www.example.org:8000/api');\n// proxy('/api', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api/books/*/**.json');\n// proxy('/api/books/*/**.json', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api', { changeOrigin: true });\n// proxy('/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(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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\n## WebSocket\n\n```javascript\n// verbose api\nproxy('/', { target: 'http://echo.websocket.org', ws: true });\n\n// shorthand\nproxy('http://echo.websocket.org', { ws: true });\n\n// shorter shorthand\nproxy('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\nvar wsProxy = proxy('ws://echo.websocket.org', { changeOrigin: true });\n\nvar app = express();\napp.use(wsProxy);\n\nvar server = app.listen(3000);\nserver.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade'\n```\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\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- [browser-sync](https://www.npmjs.com/package/browser-sync)\n- [lite-server](https://www.npmjs.com/package/lite-server)\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-2019 Steven Chim\n","readmeFilename":"README.md","gitHead":"021b03f0d805446d21e9e9b0700c75b8eb8f39f6","_id":"http-proxy-middleware@0.20.0-beta.0","_nodeVersion":"12.1.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-rXjfA9c4qCfRPBuEjn4lLinMYmXFSmylBPszJiUBg43tAJx7feHWbbx0VsLMTURe1APw8mSXCuRCMBDhByGT4Q==","shasum":"8d38afb8ea264b8ea41a7b7b8e69411ba2eed224","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.20.0-beta.0.tgz","fileCount":13,"unpackedSize":51162,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8ZZUCRA9TVsSAnZWagAARsoP/2VE+jurLfwtvCIDDVe4\nT+VKqcgNMPJEacyQ1eJBd2cs283zs75Bf/mzIHYAk8doK+X+LWwie1lW9QcP\nf+Rvr8L9bdITk4n+cGfU8es7evpVAuwB7A+h0vdEu5PPYgPhPGAZDVfT19q2\nGy2ByOUiamnNYqAlpIV1iGbPiL9nHqFXCZuEithRR/CYf/JvzW82UCQho5mk\naMhy/I05CFhRQNP30Se26L68NUofKIZnKQUGPoOUjwH5ez73xXWbV4A+gA8o\nNwvAznB9u3SwEwH3qfY880d2vCL0iZ6/wG/5G6BF4bJ/5JlpKEs8i7pxwCV9\nzlD3k0vxgms2g9g3XhuDDJE+rivLWFJa14dROKJGlfgCg8oQQuXMIl5oZJQh\n8uq10OJ2dVRmo/in0rm1BHKx0tugRGysygJ91Lml+AeavTVv719EX4VKgKpW\noXu6nu9cVktYaJN82iB/FKEjsUd2fq8QUsf0cPGj8wyDz6D1uhV76VmIH6Ml\n8HAKxtzlTR15JN9s3uCXqBYCGaAKDz4p6aA57kboWFbgqj3r1InBYhnDq53P\n+9j3xLkiawBnwb2Ckk9MendRklvbyl3Es9TERkEoIL+W/6V+MlImH0DH+uMB\noElTRggfmooAbh6GDjcS++AxlXo/mowisJpe581ndWcgXxE6j/czFt0KK3a4\nM5PT\r\n=HJp3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjkYuuedMDf5Li2nGso3NZgGpDxV1qlgTL2J3zNqecIQIgT8jtPiv6XVKuFYw7BbavDEGcfXCrAAa50DTYRR7iibI="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.20.0-beta.0_1559336531343_0.4642439713593851"},"_hasShrinkwrap":false},"0.20.0-beta.1":{"name":"http-proxy-middleware","version":"0.20.0-beta.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","scripts":{"clean":"rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && yarn build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepublish":"yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^7.2.1","@commitlint/config-conventional":"^7.1.2","@types/express":"^4.16.1","@types/http-proxy":"^1.17.0","@types/is-glob":"^4.0.0","@types/jest":"^24.0.11","@types/lodash":"^4.14.123","@types/micromatch":"^3.1.0","@types/node":"^12.0.4","browser-sync":"^2.26.3","connect":"^3.6.6","coveralls":"^3.0.3","express":"^4.16.4","husky":"^2.3.0","jest":"^24.5.0","open":"^6.3.0","prettier":"^1.15.2","ts-jest":"^24.0.0","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.4.1","ws":"^7.0.0"},"dependencies":{"http-proxy":"^1.17.0","is-glob":"^4.0.1","lodash":"^4.17.11","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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## TL;DR\n\nProxy `/api` requests to `http://www.example.org`\n\n```javascript\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\nvar app = express();\n\napp.use(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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- [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```javascript\n$ npm install --save-dev http-proxy-middleware\n```\n\n## Core concept\n\nProxy middleware configuration.\n\n#### proxy([context,] config)\n\n```javascript\nvar proxy = require('http-proxy-middleware');\n\nvar apiProxy = proxy('/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#### proxy(uri [, config])\n\n```javascript\n// shorthand syntax for the example above:\nvar apiProxy = proxy('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\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\n// proxy middleware options\nvar 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)\nvar exampleProxy = proxy(options);\n\n// mount `exampleProxy` in web server\nvar 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```\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  - `proxy({...})` - matches any path, all requests will be proxied.\n  - `proxy('/', {...})` - matches any path, all requests will be proxied.\n  - `proxy('/api', {...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `proxy(['/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  - `proxy('**', {...})` matches any path, all requests will be proxied.\n  - `proxy('**/*.html', {...})` matches any path which ends with `.html`\n  - `proxy('/*.html', {...})` matches paths directly under path-absolute\n  - `proxy('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api`\n  - `proxy(['/api/**', '/ajax/**'], {...})` combine multiple patterns\n  - `proxy(['/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  var filter = function(pathname, req) {\n    return pathname.match('^/api') && req.method === 'GET';\n  };\n\n  var apiProxy = proxy(filter, { target: 'http://www.example.org' });\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\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\n  router: function(req) {\n      return 'http://localhost:8004';\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    var logger = new (require('winston')).Logger();\n\n    var 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) {\n    res.writeHead(500, {\n      'Content-Type': 'text/plain'\n    });\n    res.end(\n      'Something went wrong. And we are reporting a custom error message.'\n    );\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  ```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    ```\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    ```\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  ```\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\n    proxy.web(req, res, {\n      target: 'http://localhost:4003/',\n      buffer: streamify(req.rawBody)\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\nproxy('http://www.example.org:8000/api');\n// proxy('/api', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api/books/*/**.json');\n// proxy('/api/books/*/**.json', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api', { changeOrigin: true });\n// proxy('/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(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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\n## WebSocket\n\n```javascript\n// verbose api\nproxy('/', { target: 'http://echo.websocket.org', ws: true });\n\n// shorthand\nproxy('http://echo.websocket.org', { ws: true });\n\n// shorter shorthand\nproxy('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\nvar wsProxy = proxy('ws://echo.websocket.org', { changeOrigin: true });\n\nvar app = express();\napp.use(wsProxy);\n\nvar server = app.listen(3000);\nserver.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade'\n```\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\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- [browser-sync](https://www.npmjs.com/package/browser-sync)\n- [lite-server](https://www.npmjs.com/package/lite-server)\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-2019 Steven Chim\n","readmeFilename":"README.md","gitHead":"a530c9e1c92b74445b4afb0af70c6b8a8136b238","_id":"http-proxy-middleware@0.20.0-beta.1","_nodeVersion":"12.1.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-vsJ6+FeSwW6epQMXEKowYHmBN+sLxJ58O03Qf8pTyjZM+8hPSpPPasKfALkD7zEgqKJTKMoDskZH6JCkKTeFjg==","shasum":"55e021c8240e44f9e7cf2d9ec3e18bba6ccc7553","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.20.0-beta.1.tgz","fileCount":13,"unpackedSize":50619,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc9B8CCRA9TVsSAnZWagAA55kP/R/PkcwvAL6okwH1wmMy\nE5nhU9ei3BGIy/Jvd8El8vF6y5qg2Xlx+J9wLdxST9Wb4qxkC/kJR6UjH+ni\nTU88pRl+mpiP2UQrakZ234FFsmFfwj8zyXyBq0aQr2V3FCvwMXG+rsGtEjUD\nGtTcfEPs44uFwDwvlFzQZWxlU8ot+ae2PEEg21fj52bLawnTeP4y6cI0g0Z/\n+lhm85lX/r4tqwj+elxQhCDt7GhHgrG0r0Mv7Gmrw96+GIH5Jino3xjjGoAi\nRwz8e8kX8Ugecy/jOp2GNI74AdREzCmEoYEZ7fqCQYi6TtGgLoOJjpA4jZWI\nYrywi6XLcKoiVcBJkvZ1M+A34NuXR3/SsGZj8J64NZ0U0XHG79BRhL1o0gKb\n5JHm5T2697L32jKwRiHipz6lSYcTSaS0PwBrkV1C3DJKIj1mj3QPCFvh6uwb\nVdV2QP34pgucp4tWBZrJXM2URfQ79+fv3CMDfui2mkhZ/hTw2U0mLeKzyCBC\n1b/jcJ3tLFmOEE4FHoWbxtRFngoyxJ4B36iNRFtQgqAmStZUa+0PLHOaXMve\nX3VoTwF2HPx0Y8uKL4KEHlg5oJLNd8pbgVVBSMeI5xJlhBapq0B9h5tjuCHs\nVQzG5tImxFX3fP+u8LLuLUcUrlIStiLqj8uMdh75Z9XzyCylf6wn0xgQOxdv\nTw/7\r\n=gP+D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIApy//Ecr0WnqKOv4xohMkCoxdbj2Ov9C0FkHZ6QeTmxAiEAqlTmL3LS+v4al6gPzUV6ozEj14NmZMX3MUzWA8s8/l0="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.20.0-beta.1_1559502592209_0.9266043472076857"},"_hasShrinkwrap":false},"0.20.0-beta.2":{"name":"http-proxy-middleware","version":"0.20.0-beta.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","scripts":{"clean":"rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && yarn build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepublish":"yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^7.2.1","@commitlint/config-conventional":"^7.1.2","@types/express":"^4.16.1","@types/http-proxy":"^1.17.0","@types/is-glob":"^4.0.0","@types/jest":"^24.0.11","@types/lodash":"^4.14.123","@types/micromatch":"^3.1.0","@types/node":"^12.0.4","browser-sync":"^2.26.3","connect":"^3.6.6","coveralls":"^3.0.3","express":"^4.16.4","husky":"^2.3.0","jest":"^24.5.0","open":"^6.3.0","prettier":"^1.15.2","ts-jest":"^24.0.0","tslint":"^5.14.0","tslint-config-prettier":"^1.18.0","typescript":"^3.4.1","ws":"^7.0.0"},"dependencies":{"http-proxy":"^1.17.0","is-glob":"^4.0.1","lodash":"^4.17.11","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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## TL;DR\n\nProxy `/api` requests to `http://www.example.org`\n\n```javascript\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\nvar app = express();\n\napp.use(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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- [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```javascript\n$ npm install --save-dev http-proxy-middleware\n```\n\n## Core concept\n\nProxy middleware configuration.\n\n#### proxy([context,] config)\n\n```javascript\nvar proxy = require('http-proxy-middleware');\n\nvar apiProxy = proxy('/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#### proxy(uri [, config])\n\n```javascript\n// shorthand syntax for the example above:\nvar apiProxy = proxy('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\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\n// proxy middleware options\nvar 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)\nvar exampleProxy = proxy(options);\n\n// mount `exampleProxy` in web server\nvar 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```\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  - `proxy({...})` - matches any path, all requests will be proxied.\n  - `proxy('/', {...})` - matches any path, all requests will be proxied.\n  - `proxy('/api', {...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `proxy(['/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  - `proxy('**', {...})` matches any path, all requests will be proxied.\n  - `proxy('**/*.html', {...})` matches any path which ends with `.html`\n  - `proxy('/*.html', {...})` matches paths directly under path-absolute\n  - `proxy('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api`\n  - `proxy(['/api/**', '/ajax/**'], {...})` combine multiple patterns\n  - `proxy(['/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  var filter = function(pathname, req) {\n    return pathname.match('^/api') && req.method === 'GET';\n  };\n\n  var apiProxy = proxy(filter, { target: 'http://www.example.org' });\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\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\n  router: function(req) {\n      return 'http://localhost:8004';\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    var logger = new (require('winston')).Logger();\n\n    var 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) {\n    res.writeHead(500, {\n      'Content-Type': 'text/plain'\n    });\n    res.end(\n      'Something went wrong. And we are reporting a custom error message.'\n    );\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  ```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    ```\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    ```\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  ```\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\n    proxy.web(req, res, {\n      target: 'http://localhost:4003/',\n      buffer: streamify(req.rawBody)\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\nproxy('http://www.example.org:8000/api');\n// proxy('/api', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api/books/*/**.json');\n// proxy('/api/books/*/**.json', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api', { changeOrigin: true });\n// proxy('/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(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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\n## WebSocket\n\n```javascript\n// verbose api\nproxy('/', { target: 'http://echo.websocket.org', ws: true });\n\n// shorthand\nproxy('http://echo.websocket.org', { ws: true });\n\n// shorter shorthand\nproxy('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\nvar wsProxy = proxy('ws://echo.websocket.org', { changeOrigin: true });\n\nvar app = express();\napp.use(wsProxy);\n\nvar server = app.listen(3000);\nserver.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade'\n```\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\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- [browser-sync](https://www.npmjs.com/package/browser-sync)\n- [lite-server](https://www.npmjs.com/package/lite-server)\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-2019 Steven Chim\n","readmeFilename":"README.md","gitHead":"bef1d49bfd14a95de3ed8f993cc62161700dc5ef","_id":"http-proxy-middleware@0.20.0-beta.2","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-OkO4poCBY2pt2Fn4iAte5Vy2vMsLjUzaHX69nxCPRZ8BMjvsv7LZcgyy0xI2fILBQL+D7B6WS+rUI9ugSJh9Ng==","shasum":"2e1f99591415ea388826f98c065a5fa173ee7d8a","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.20.0-beta.2.tgz","fileCount":13,"unpackedSize":50947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJO3uCRA9TVsSAnZWagAAUfUQAJVf9KYsosvC1oPpHoOu\nqdFXoijnD2S+LD3N5cvYeFG/NvCHOlh+jMuCC2+HPi7Jj2RKM/GmnH6Hvwib\n0wf4yZBU6tKmV/a1KVwZJ8UvahJjgAVjYnK2ri3Gk+4HjrlCtWPpJOm6tmmG\nwzsHQX2T8ZtRUk+bgLlwD84+73xdaYIBDH/eVmxjWFmBiUxOMb/otA5UFxYv\ngIo6+PwyztPMVVkrLsLGJxCH/SdJOEngwPEKwb63DVZmu2urq109v4Yz2U3g\nJmfJg3hbKnvRRejQBm9nOq6IxtVtusTfaIGRwU0p6HFbG9uxjpMWfUGH9yzO\nqXXR05X/bv5xkbI/zLqj5rPnl78BJm4473cWuqpEOW9TFpowuXvEGehLTieK\nnmpBY5qweummrJVLZ1K+N/f12T/MJQv/rmikDEwbiagA17b26r/8J+hINqYn\n9WJXnJn3aDkbY06hlWsw2/cNm22z44nTlD9W00mC7+syavyZFci5bUGzdoPQ\n6LzsFQqGCQHBZ9tZmaVAXbIDnzMQ0zg+9k0EI9fuyGiLRw/3xupP5Js3om4O\nObIVP8JVLajSADARg6HYEcvtiOvs4nFDNktIT9Zr4ex1DFWVcPoIXJJfSnYn\npIMqfC75Qq/FuCDkOAZwbhejlpiN2fWZTEZIsul0e/zZ1y0jPMNr13xpoOpY\n/bbz\r\n=Vg0O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlXci3MHn07uPnnyPolaLAzO13/aojG9fMR4y7oFfQfAIhAK9BeivTDTV1OnzaCwFkNfeX0Lm2PPaF6eRhKyTH5e36"}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.20.0-beta.2_1562701294180_0.5240101814223321"},"_hasShrinkwrap":false},"0.20.0":{"name":"http-proxy-middleware","version":"0.20.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && yarn build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^8.0.0","@commitlint/config-conventional":"^8.0.0","@types/express":"^4.17.0","@types/http-proxy":"^1.17.0","@types/is-glob":"^4.0.0","@types/jest":"^24.0.15","@types/lodash":"^4.14.136","@types/micromatch":"^3.1.0","@types/node":"^12.6.2","browser-sync":"^2.26.7","connect":"^3.6.6","coveralls":"^3.0.5","express":"^4.16.4","husky":"^3.0.0","jest":"^24.5.0","open":"^6.4.0","prettier":"^1.18.2","ts-jest":"^24.0.0","tslint":"^5.18.0","tslint-config-prettier":"^1.18.0","typescript":"^3.5.3","ws":"^7.1.0"},"dependencies":{"http-proxy":"^1.17.0","is-glob":"^4.0.1","lodash":"^4.17.14","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"3b9730826187c708fbd16cb0baa588f6aad73a00","_id":"http-proxy-middleware@0.20.0","_nodeVersion":"12.8.1","_npmVersion":"6.10.2","dist":{"integrity":"sha512-dNJAk71nEJhPiAczQH9hGvE/MT9kEs+zn2Dh+Hi94PGZe1GluQirC7mw5rdREUtWx6qGS1Gu0bZd4qEAg+REgw==","shasum":"5b128f7207985c4ea91b53fab8ad897a48c690d6","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.20.0.tgz","fileCount":13,"unpackedSize":51251,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdbsVrCRA9TVsSAnZWagAAouMP/j7gzAb7qpsFw9cwrsJF\nikrihxJpdZHwDmcWeZmo2GsFidAbGfDV6AtL6XDAhSO+XVMb6ALr/tXjWwns\n1I/yrNPWqFEsIJlmKXRZf/cauCPlIWQrPJoGfOVrCo7XunCAxyCT3EmQwjEV\nb40JoPyRUX8UpbmicU2mM0KoKogv2mKhDy85gdLmrpgOMLuk1L3PHSR9xAOB\n69FsAyNuUqNNMfIbKkyQfxLkkAe9AZEgd+1dTf6Qk/GbTIUuMvLBwhoC641q\nFz1VEcABAecS4PkdntwwY1g+Q7nbEFIu8qgJG/o9GQFzod0HORGZhLQy/vOV\nWZCottDnxfGv1p7Nr4IfHjTWn80MYeZbs5VijG0BC539d7DWbobE/qwzUvEA\n4Iu+7WnlqUKwNAh6LEQ/f7OzYuWHp+N2tZPbqr6uJA4Btd0HbpMstVXIGMaK\nzDIsk06Z1JRTva2ws8fMA1rbAZG9YgGN5d8HXTMxf67dmccMZFbnkoP5BlSi\nrmGUYGgwVH1x3v5kzzrbXPZ+6bLB+2s1TOfybcJg6b6hIYkAHq3zX5YzX89w\nmb5MTwUKCevKL/rOzQQRwjm2E6tFI16fXJvXv6OARA+Se/HG5f12ayKppZTD\nQ2okbuuCAasl/K6J0jE35XETiQmfzTGE/lSHS4ihw6lWjW4irXcniRqys0Gg\nXS65\r\n=sGAt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAH6abwDw+K7goXy9sVLMz7U1O6yzCDSzXkpCCtT76UvAiEApjtpmisWFdTER/unMPjNCa5FKW8euzWVELpmstb22s8="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.20.0_1567540586415_0.9096750997515071"},"_hasShrinkwrap":false},"0.21.0-beta.1":{"name":"http-proxy-middleware","version":"0.21.0-beta.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && yarn build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^8.0.0","@commitlint/config-conventional":"^8.0.0","@types/express":"^4.17.0","@types/http-proxy":"^1.17.0","@types/is-glob":"^4.0.0","@types/jest":"^24.0.15","@types/lodash":"^4.14.136","@types/micromatch":"^3.1.0","@types/node":"^12.6.2","browser-sync":"^2.26.7","connect":"^3.6.6","coveralls":"^3.0.5","express":"^4.16.4","husky":"^3.0.0","jest":"^24.5.0","open":"^6.4.0","prettier":"^1.18.2","ts-jest":"^24.0.0","tslint":"^5.18.0","tslint-config-prettier":"^1.18.0","typescript":"^3.5.3","ws":"^7.1.0"},"dependencies":{"http-proxy":"^1.17.0","is-glob":"^4.0.1","lodash":"^4.17.14","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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## TL;DR\n\nProxy `/api` requests to `http://www.example.org`\n\n```javascript\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\nvar app = express();\n\napp.use(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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- [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```javascript\n$ npm install --save-dev http-proxy-middleware\n```\n\n## Core concept\n\nProxy middleware configuration.\n\n#### proxy([context,] config)\n\n```javascript\nvar proxy = require('http-proxy-middleware');\n\nvar apiProxy = proxy('/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#### proxy(uri [, config])\n\n```javascript\n// shorthand syntax for the example above:\nvar apiProxy = proxy('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\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\n// proxy middleware options\nvar 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)\nvar exampleProxy = proxy(options);\n\n// mount `exampleProxy` in web server\nvar 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```\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  - `proxy({...})` - matches any path, all requests will be proxied.\n  - `proxy('/', {...})` - matches any path, all requests will be proxied.\n  - `proxy('/api', {...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `proxy(['/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  - `proxy('**', {...})` matches any path, all requests will be proxied.\n  - `proxy('**/*.html', {...})` matches any path which ends with `.html`\n  - `proxy('/*.html', {...})` matches paths directly under path-absolute\n  - `proxy('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api`\n  - `proxy(['/api/**', '/ajax/**'], {...})` combine multiple patterns\n  - `proxy(['/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  var filter = function(pathname, req) {\n    return pathname.match('^/api') && req.method === 'GET';\n  };\n\n  var apiProxy = proxy(filter, { target: 'http://www.example.org' });\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\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\n  router: function(req) {\n      return 'http://localhost:8004';\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    var logger = new (require('winston')).Logger();\n\n    var 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) {\n    res.writeHead(500, {\n      'Content-Type': 'text/plain'\n    });\n    res.end(\n      'Something went wrong. And we are reporting a custom error message.'\n    );\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  ```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    ```\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    ```\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  ```\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\n    proxy.web(req, res, {\n      target: 'http://localhost:4003/',\n      buffer: streamify(req.rawBody)\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\nproxy('http://www.example.org:8000/api');\n// proxy('/api', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api/books/*/**.json');\n// proxy('/api/books/*/**.json', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api', { changeOrigin: true });\n// proxy('/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(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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\n## WebSocket\n\n```javascript\n// verbose api\nproxy('/', { target: 'http://echo.websocket.org', ws: true });\n\n// shorthand\nproxy('http://echo.websocket.org', { ws: true });\n\n// shorter shorthand\nproxy('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\nvar wsProxy = proxy('ws://echo.websocket.org', { changeOrigin: true });\n\nvar app = express();\napp.use(wsProxy);\n\nvar server = app.listen(3000);\nserver.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade'\n```\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\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- [browser-sync](https://www.npmjs.com/package/browser-sync)\n- [lite-server](https://www.npmjs.com/package/lite-server)\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-2019 Steven Chim\n","readmeFilename":"README.md","gitHead":"7a738ea2251d1a156267959a202d19b49238f1a6","_id":"http-proxy-middleware@0.21.0-beta.1","_nodeVersion":"12.14.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-qiqFG3Ri+aTfQhpeAL1IHKSOdrHTBhiaQoJSKcD5FJwPdm5rxwq6qoVIITcGwHqz0iIZLe3YIkafwRO8FMwt6A==","shasum":"ddda0025b69f288475926dbe044b90f38278ce32","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.21.0-beta.1.tgz","fileCount":13,"unpackedSize":52422,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeA/TqCRA9TVsSAnZWagAACOwP/RVXofcPWn7LTE140UKq\ny4N5PWgXu27qd7twIRWYDF1irH776Qa05DY7RnjbWK6R4+uFZ/Jf+l5ZGdkx\nBOlJVGAEa033Ic3o/BZZh3l3AwO1caR1J47rKRaE9qBWUo+0HD3BNFMbyvSH\n1knyE2af6Q+9HVic3k8ILaSZTbuvFffuR6A9kWgpjTkB22aGaA6ZvfVJCWZP\n/trm8cjUl+oCbF51eQdD38PE4Cmv/UraFDJu7zgeCgjMomH5bbrSN1vpsdvy\n+CD6k2a7j0lLPoXpOG5ehB7u6t07eBOixT0/qfJTntKdV2IOycEGXaSH35j6\n6UKvVJ47FRiV4zxLBiM2/XRhBUyaRzzie61uVDFs2gLV5aKVoS1vjWqzJ1Xl\n/BM9gb9+mWYtbST3/sIZHjzDVyHW0JXG/6KX/ufXm0yKbmqUFEpSIhq1lg24\nOkiHyx+Zmr0Rftj0NpM+2vIDa729+y2g/6DTvAh40cOtxJLSu5KawC0Z7p4L\nV0x/npTRKG49zmrcJz8JdHgTtWOxu3dIhgfCXxV4dqGTDT3dBqLofFbot+71\nwbvE5+lgJWYqAtwk+47HV4HlYm0SjAaHszU5gbdGsQveziKHvOd1wEfcVJ4t\n/aNXDfrbfwXn8OkYi+VlVRDaDhBzL0ZYufKzvhwQF3evGfEr8LfeIRTOJuKP\nhWn0\r\n=MUL+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDtueumZ95oUsEQ9zx8FIAuFls+Ct7SmatgGwDS524EHgIhAJBSDS/cTFBpTB0xXf7ABQL3fOfkzh7dAbpkamZXArrO"}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.21.0-beta.1_1577317609788_0.42476028879033034"},"_hasShrinkwrap":false},"0.21.0-beta.2":{"name":"http-proxy-middleware","version":"0.21.0-beta.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && yarn build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^8.0.0","@commitlint/config-conventional":"^8.0.0","@types/express":"^4.17.0","@types/is-glob":"^4.0.0","@types/jest":"^24.0.15","@types/lodash":"^4.14.136","@types/micromatch":"^3.1.0","@types/node":"^12.6.2","browser-sync":"^2.26.7","connect":"^3.6.6","coveralls":"^3.0.5","express":"^4.16.4","husky":"^3.0.0","jest":"^24.5.0","open":"^6.4.0","prettier":"^1.18.2","ts-jest":"^24.0.0","tslint":"^5.18.0","tslint-config-prettier":"^1.18.0","typescript":"^3.5.3","ws":"^7.1.0"},"dependencies":{"@types/http-proxy":"^1.17.0","http-proxy":"^1.17.0","is-glob":"^4.0.1","lodash":"^4.17.14","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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## TL;DR\n\nProxy `/api` requests to `http://www.example.org`\n\n```javascript\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\nvar app = express();\n\napp.use(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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- [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```javascript\n$ npm install --save-dev http-proxy-middleware\n```\n\n## Core concept\n\nProxy middleware configuration.\n\n#### proxy([context,] config)\n\n```javascript\nvar proxy = require('http-proxy-middleware');\n\nvar apiProxy = proxy('/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#### proxy(uri [, config])\n\n```javascript\n// shorthand syntax for the example above:\nvar apiProxy = proxy('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\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\n// proxy middleware options\nvar 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)\nvar exampleProxy = proxy(options);\n\n// mount `exampleProxy` in web server\nvar 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```\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  - `proxy({...})` - matches any path, all requests will be proxied.\n  - `proxy('/', {...})` - matches any path, all requests will be proxied.\n  - `proxy('/api', {...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `proxy(['/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  - `proxy('**', {...})` matches any path, all requests will be proxied.\n  - `proxy('**/*.html', {...})` matches any path which ends with `.html`\n  - `proxy('/*.html', {...})` matches paths directly under path-absolute\n  - `proxy('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api`\n  - `proxy(['/api/**', '/ajax/**'], {...})` combine multiple patterns\n  - `proxy(['/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  var filter = function(pathname, req) {\n    return pathname.match('^/api') && req.method === 'GET';\n  };\n\n  var apiProxy = proxy(filter, { target: 'http://www.example.org' });\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\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\n  router: function(req) {\n      return 'http://localhost:8004';\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    var logger = new (require('winston')).Logger();\n\n    var 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) {\n    res.writeHead(500, {\n      'Content-Type': 'text/plain'\n    });\n    res.end(\n      'Something went wrong. And we are reporting a custom error message.'\n    );\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  ```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    ```\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    ```\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  ```\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\n    proxy.web(req, res, {\n      target: 'http://localhost:4003/',\n      buffer: streamify(req.rawBody)\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\nproxy('http://www.example.org:8000/api');\n// proxy('/api', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api/books/*/**.json');\n// proxy('/api/books/*/**.json', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api', { changeOrigin: true });\n// proxy('/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(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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\n## WebSocket\n\n```javascript\n// verbose api\nproxy('/', { target: 'http://echo.websocket.org', ws: true });\n\n// shorthand\nproxy('http://echo.websocket.org', { ws: true });\n\n// shorter shorthand\nproxy('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\nvar wsProxy = proxy('ws://echo.websocket.org', { changeOrigin: true });\n\nvar app = express();\napp.use(wsProxy);\n\nvar server = app.listen(3000);\nserver.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade'\n```\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\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- [browser-sync](https://www.npmjs.com/package/browser-sync)\n- [lite-server](https://www.npmjs.com/package/lite-server)\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-2019 Steven Chim\n","readmeFilename":"README.md","gitHead":"b2f5f69b8fd835b79bd514004b807444185107fc","_id":"http-proxy-middleware@0.21.0-beta.2","_nodeVersion":"12.14.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-Cvemlr1M237MEgXpL+Tti9w6aUV5emMBkAXW3JaECIBeW+voER6A5Zjs5OzgAHcoeT7rz7aiVmCC3gFpo/r3Ag==","shasum":"ff38e92a3b666c5cd019bb5019884aaf350200fe","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.21.0-beta.2.tgz","fileCount":24,"unpackedSize":59320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeEhc/CRA9TVsSAnZWagAAy1kP/31RqHzQY2vZacutkcqf\nWndTw3VOvCouEwws4/a9ONBAdcbQ1Sp4UvGwtsiuYbaXU+FnryZWpkQg26Hh\nrUNrwd7aY3s1kiEVD7l6DlexQonm+JbiuOdjksy3okej770MOuWW31xhBFpq\ngyyE4aLZXdzZ0OO5NeUErMfK4Ghm6FQK78oaQoBM9Ef6lst8qs3fVhsbq+MP\nswArYa19g5Exsw97wkZMx043tlrAxkrMWhTa1WAzQIlUEk4CgfNS4ScRjcCq\ns66HbkC5oDBGFhKDPaHx7gdZjNQeGHV1pU2EKurWWvvmeL2J6+eGI14fLwNO\n54Wtn9lcy9WlUSggT4U305LNkrQgBiEVSld2viuelIWHuMPHUtQA5WMNLozO\npyIUJ7pfEF9n5Q8Jq1erps0Sm6yGeCfInFQ5ULDwpAWVn7TGPvrG2h0nAiMM\nFdeRr7KS5YflJhWIgeszpEvTHVgo1xCcWDiVP6jrrnGI4HL/WQHiBmkCHeMo\nCbZPr33dCC3Z10AX8YLtA4n04eQbqW07EEdOwEGMyKM6BIx4onb7qQpA5Q4Z\nB5FgRd78iy6h1ZPPxIsmp6zYaX0u6cwkrCR4vvKVob3u7zKuZMnS32tt97YY\nC4lRGb/SU9oLnzyU6DIRxCXBAgaPftOUAHG7EWZotYtTGlC+9GfCf2u3ySbO\ndOfR\r\n=eGx2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhKP5dp98MItA6og5vKPTsho+Yr+e1LWCqouH9Er5r/AIhAKja/Yt15nhpJSg2LvXdCc48ln3bCSLFG6jlDqUTvPMO"}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.21.0-beta.2_1578243903123_0.7557270896855537"},"_hasShrinkwrap":false},"0.21.0-beta.3":{"name":"http-proxy-middleware","version":"0.21.0-beta.3","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && yarn build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^8.0.0","@commitlint/config-conventional":"^8.0.0","@types/express":"^4.17.0","@types/is-glob":"^4.0.0","@types/jest":"^25.1.2","@types/lodash":"^4.14.149","@types/micromatch":"^4.0.1","@types/node":"^12.6.2","browser-sync":"^2.26.7","connect":"^3.6.6","coveralls":"^3.0.5","express":"^4.16.4","husky":"^3.0.0","jest":"^25.1.0","open":"^7.0.2","prettier":"^1.19.1","ts-jest":"^25.2.0","tslint":"^6.0.0","tslint-config-prettier":"^1.18.0","typescript":"^3.7.5","ws":"^7.1.0"},"dependencies":{"@types/http-proxy":"^1.17.3","http-proxy":"^1.18.0","is-glob":"^4.0.1","lodash":"^4.17.15","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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## TL;DR\n\nProxy `/api` requests to `http://www.example.org`\n\n```javascript\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\nvar app = express();\n\napp.use(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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- [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```javascript\n$ npm install --save-dev http-proxy-middleware\n```\n\n## Core concept\n\nProxy middleware configuration.\n\n#### proxy([context,] config)\n\n```javascript\nvar proxy = require('http-proxy-middleware');\n\nvar apiProxy = proxy('/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#### proxy(uri [, config])\n\n```javascript\n// shorthand syntax for the example above:\nvar apiProxy = proxy('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\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\n// proxy middleware options\nvar 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)\nvar exampleProxy = proxy(options);\n\n// mount `exampleProxy` in web server\nvar 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```\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  - `proxy({...})` - matches any path, all requests will be proxied.\n  - `proxy('/', {...})` - matches any path, all requests will be proxied.\n  - `proxy('/api', {...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `proxy(['/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  - `proxy('**', {...})` matches any path, all requests will be proxied.\n  - `proxy('**/*.html', {...})` matches any path which ends with `.html`\n  - `proxy('/*.html', {...})` matches paths directly under path-absolute\n  - `proxy('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api`\n  - `proxy(['/api/**', '/ajax/**'], {...})` combine multiple patterns\n  - `proxy(['/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  var filter = function(pathname, req) {\n    return pathname.match('^/api') && req.method === 'GET';\n  };\n\n  var apiProxy = proxy(filter, { target: 'http://www.example.org' });\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    var should_add_something = await httpRequestToDecideSomething(path);\n    if (should_add_something) path += \"something\";\n    return path;\n  }\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\n  router: function(req) {\n      return 'http://localhost:8004';\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    var logger = new (require('winston').Logger)();\n\n    var 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) {\n    res.writeHead(500, {\n      'Content-Type': 'text/plain'\n    });\n    res.end(\n      'Something went wrong. And we are reporting a custom error message.'\n    );\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  ```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    ```\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    ```\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  ```\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\n    proxy.web(req, res, {\n      target: 'http://localhost:4003/',\n      buffer: streamify(req.rawBody)\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\nproxy('http://www.example.org:8000/api');\n// proxy('/api', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api/books/*/**.json');\n// proxy('/api/books/*/**.json', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api', { changeOrigin: true });\n// proxy('/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(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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\n## WebSocket\n\n```javascript\n// verbose api\nproxy('/', { target: 'http://echo.websocket.org', ws: true });\n\n// shorthand\nproxy('http://echo.websocket.org', { ws: true });\n\n// shorter shorthand\nproxy('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\nvar wsProxy = proxy('ws://echo.websocket.org', { changeOrigin: true });\n\nvar app = express();\napp.use(wsProxy);\n\nvar server = app.listen(3000);\nserver.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade'\n```\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\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- [browser-sync](https://www.npmjs.com/package/browser-sync)\n- [lite-server](https://www.npmjs.com/package/lite-server)\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-2020 Steven Chim\n","readmeFilename":"README.md","gitHead":"b3cfae63a1b36a9184c2b314f8de64902d968206","_id":"http-proxy-middleware@0.21.0-beta.3","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-uI1yiC+bS3NcY8KBbZ9QpIdgLOoTUsJBb1HJYWlB1K6aTArwyFR1Tf1T73kyP3miEXoFI2tebsfTGbddm1e9XQ==","shasum":"ff5cbd11863aaf7e0012d2ad7520625e2e840255","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.21.0-beta.3.tgz","fileCount":24,"unpackedSize":59849,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeRvx4CRA9TVsSAnZWagAA6U8P/j56q2SkaGQ4Q7P/KU/2\nzEdomyN+Zx1V9oysfRETL4IaZsIgkdM7lCQidhpSz1jn6ODHO3Hfj226ZvUz\nzefR3+QHT0TY+Ekk+uVA8Y5IygJR8TsXhwPpkXSQ2owPtu1hyD3LMSRu51LN\nJAV5ItkB3lgcL8dF2yKqqjju9Hi6tmzjnLdN1ax8/pPxecruhOXkepu30mqH\nk4OheovQ9t9Rgkeilng7N8hZ5V1IbRWfp/z924G7xA2+eSdJL2SM+B420fLK\nYV7DNGkTys8FznijyrYLafoR1Ss0AeAo8Ce1Xv6uJeyM8UvuLUP8sXkZSBWt\netIY8S/vwJwAzHBMvriyaFMBDrz2YaO5v/ZAyRd0FY8BpGEltvJElQpoJtI8\nFDNzimr1jIXQuZuVGQl89QDh2l2SYZvirX9Pg1jwQvzkOfiQRk7TImryensW\nwUZ4OaRIi/VJ94EZl11CIEZ1iWfYRRDXGgB8FNFQe5aqHyTj/OunDZ0p9aUT\ntDw3lPaNb240LPtPBAlnMVpPjbA5uTUo7s99FV5ByrjagXanPIkhe8GFO4Jd\nrCDFztheQnetD5Q5qy9lk59QVZG3Mgp+tmJWeitil0cA5/VvpK3aCVPUEnBR\nqh/uTV6Mdho++6F/D3HbbPtuHfTGzATMfRmb/bG3ULcH8bvQ/digWvhhyLoK\nLehD\r\n=lPlZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHlVIWlg2p9b+/0eEYydumhFrKmQEYAWMV8kh9fUPzobAiAKxycsZUHWKLF9JZY7nzNzXzwOzziS8D49CH9/vmJyOw=="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.21.0-beta.3_1581710456295_0.6966047978814855"},"_hasShrinkwrap":false},"0.21.0":{"name":"http-proxy-middleware","version":"0.21.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && yarn build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^8.0.0","@commitlint/config-conventional":"^8.0.0","@types/express":"^4.17.0","@types/is-glob":"^4.0.0","@types/jest":"^25.1.2","@types/lodash":"^4.14.149","@types/micromatch":"^4.0.1","@types/node":"^12.6.2","browser-sync":"^2.26.7","connect":"^3.6.6","coveralls":"^3.0.5","express":"^4.16.4","husky":"^3.0.0","jest":"^25.1.0","open":"^7.0.2","prettier":"^1.19.1","ts-jest":"^25.2.0","tslint":"^6.0.0","tslint-config-prettier":"^1.18.0","typescript":"^3.7.5","ws":"^7.1.0"},"dependencies":{"@types/http-proxy":"^1.17.3","http-proxy":"^1.18.0","is-glob":"^4.0.1","lodash":"^4.17.15","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"b8f33210770878685202ceb7494e53399ed838a0","_id":"http-proxy-middleware@0.21.0","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-4Arcl5QQ6pRMRJmtM1WVHKHkFAQn5uvw83XuNeqnMTOikDiCoTxv5/vdudhKQsF+1mtaAawrK2SEB1v2tYecdQ==","shasum":"c6b1ca05174b5fbc57bee9485ffa0fa2f0dabeb0","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.21.0.tgz","fileCount":24,"unpackedSize":59919,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSYqmCRA9TVsSAnZWagAAZjEP/iJtDP2vl9xSaH2Ii8gC\nliwQiqsHwmscx2cWyp+77nuts/R1szQCiCISv4gkLuYIUBRpgnyQ4FcKk/vf\nUqcXxNzQNHbndlNxhbBdGU4tHOVdAIhhaN/r+8F3PFOyHqzwo8wTiO31T8U5\nDCkQ5SuZj8jCJaAzTkO2kS5Xtl1nCaQU/SBHGmIunE5pnBY294UyWLljwDfC\nlS2y2r3WDswqlSw9lguLwocv6iyeujG3GlFkLnM+IyY3O1LM8lT/iOkc4ETV\nRWZjHYv+98Djky9S7K7YsFle5cWnHdc41XyOfm2YDqSAQhc94XxMxGvXniyH\nQO15Y91hlWK/eZDWaaXXT8HzhOTiRzKXeHSo5Bv8ZaxROnGwYcSxFcMZmVRC\n50Bp1Iecy+HwbLs3DNBU06DNLRdcAedo15a8J+3I3J4blL9DJue5MSj4A2aR\nF5yzn0g976E8lTwOJEOZ802H4aTL7ifZWasioANPEQ8hPUr8ce/UVHqq2t8O\nz+k310fc+6Muu48ZMNItzFUABEWY3g49Oky/d54EIHRxcr4SESvC5vDyQ2wy\npc4wTbKyM0cOOL80SMV6jZZ/NRee9DH46FoOp+Jnidg+n0UQxJqhZRyLycSY\nCVBP3ohtFzMk35hUquIqg62Ebsh8yYHDWigAwviOCaB0GERAWj6k423sNdUF\naAQU\r\n=yWY4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXQWObRcWzTRLDU7kRUPbabReHirPHcv8JJ1hU2852sAiBpFaq7K5USkIUKQm1E008jAHtuCU1p/wjN6zvF2XZAiQ=="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.21.0_1581877926342_0.799923503941687"},"_hasShrinkwrap":false},"0.22.0-alpha":{"name":"http-proxy-middleware","version":"0.22.0-alpha","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && yarn build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^8.0.0","@commitlint/config-conventional":"^8.0.0","@types/express":"^4.17.0","@types/is-glob":"^4.0.0","@types/jest":"^25.1.2","@types/lodash":"^4.14.149","@types/micromatch":"^4.0.1","@types/node":"^12.6.2","browser-sync":"^2.26.7","connect":"^3.6.6","coveralls":"^3.0.5","express":"^4.16.4","husky":"^3.0.0","jest":"^25.1.0","open":"^7.0.2","prettier":"^1.19.1","ts-jest":"^25.2.0","tslint":"^6.0.0","tslint-config-prettier":"^1.18.0","typescript":"^3.7.5","ws":"^7.1.0"},"dependencies":{"@types/http-proxy":"^1.17.3","http-proxy":"^1.18.0","is-glob":"^4.0.1","lodash":"^4.17.15","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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## TL;DR\n\nProxy `/api` requests to `http://www.example.org`\n\n```javascript\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\nvar app = express();\n\napp.use(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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- [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#### proxy([context,] config)\n\n```javascript\nvar proxy = require('http-proxy-middleware');\n\nvar apiProxy = proxy('/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#### proxy(uri [, config])\n\n```javascript\n// shorthand syntax for the example above:\nvar apiProxy = proxy('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\nvar express = require('express');\nvar proxy = require('http-proxy-middleware');\n\n// proxy middleware options\nvar 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)\nvar exampleProxy = proxy(options);\n\n// mount `exampleProxy` in web server\nvar 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  - `proxy({...})` - matches any path, all requests will be proxied.\n  - `proxy('/', {...})` - matches any path, all requests will be proxied.\n  - `proxy('/api', {...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `proxy(['/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  - `proxy('**', {...})` matches any path, all requests will be proxied.\n  - `proxy('**/*.html', {...})` matches any path which ends with `.html`\n  - `proxy('/*.html', {...})` matches paths directly under path-absolute\n  - `proxy('/api/**/*.html', {...})` matches requests ending with `.html` in the path of `/api`\n  - `proxy(['/api/**', '/ajax/**'], {...})` combine multiple patterns\n  - `proxy(['/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  var filter = function(pathname, req) {\n    return pathname.match('^/api') && req.method === 'GET';\n  };\n\n  var apiProxy = proxy(filter, { target: 'http://www.example.org' });\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    var should_add_something = await httpRequestToDecideSomething(path);\n    if (should_add_something) path += \"something\";\n    return path;\n  }\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\n  router: function(req) {\n      return 'http://localhost:8004';\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    var logger = new (require('winston').Logger)();\n\n    var 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) {\n    res.writeHead(500, {\n      'Content-Type': 'text/plain'\n    });\n    res.end(\n      'Something went wrong. And we are reporting a custom error message.'\n    );\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\nproxy('http://www.example.org:8000/api');\n// proxy('/api', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api/books/*/**.json');\n// proxy('/api/books/*/**.json', {target: 'http://www.example.org:8000'});\n\nproxy('http://www.example.org:8000/api', { changeOrigin: true });\n// proxy('/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(\n  '/api',\n  proxy({ target: 'http://www.example.org', changeOrigin: true })\n);\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\nproxy('/', { target: 'http://echo.websocket.org', ws: true });\n\n// shorthand\nproxy('http://echo.websocket.org', { ws: true });\n\n// shorter shorthand\nproxy('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\nvar wsProxy = proxy('ws://echo.websocket.org', { changeOrigin: true });\n\nvar app = express();\napp.use(wsProxy);\n\nvar server = app.listen(3000);\nserver.on('upgrade', wsProxy.upgrade); // <-- subscribe to http 'upgrade'\n```\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\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- [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-2020 Steven Chim\n","readmeFilename":"README.md","gitHead":"d2740d77c1232935733490f17a3ea36246d30a43","_id":"http-proxy-middleware@0.22.0-alpha","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-8Pv0BDLHxYR28wxIkFzV8bO6B1N1YvdWSRrs49iHWLTYwzKPhXp8TyFaK036+eoqAgm03BkmO1HV+11oADhX2A==","shasum":"b08602cf1b9392d8a989159af10cf7f7e5dfea60","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.22.0-alpha.tgz","fileCount":24,"unpackedSize":58109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeSwDoCRA9TVsSAnZWagAAAUMP/A17Tl8IIL5KeSQ+qqEQ\nMxJ/YRjJH7FOiyVlT9sINW+ytfD+3lJtOTD5MNY6ddg3EgBvPSmfHu3dqexA\n3735KbZ/eCkhIFg2vhlbrjaJrFZzZfUDiXd4rlPOptmrjRRhfPIDyKydXpdK\niBos2k6ahHICratlCnNNbiZFWO3Gv0HzAWDPEDLoy3423LnqsZrJPHLgnujb\nxoKwWrc3YyMlrkQ/+9bBVB1xchqyCBKtG6khRGQGm7f6VMSr940jqqh6WVfs\nHefWsNxmqpVK4ZFUD0hdBlw3ypnFfGFa8kfbfFi8AqoQL6+T7WtuQunNO1fG\nultSQVaB/jd3kzNzdtBba37ZU80sCgv2F3smu8Er9YqaRVNjtMzT/ThHqeHP\ntPys31QSJic9LD6Af4ml2n7O+7utuV6/Q1TLQAsNR+iAjde1RcltCTLgIyGR\n4XUrFm+VKmKMtzU3Rov1jqn58ZbJJyYhbm+bhGCXBapmZxpossJHA8HHW0Qd\nn6m6JHBFMJY5Y2uv2m1rCyjdgVv6etjPFzEvHSBarL1RHj2xaLPBXSPXZM1P\nqf5qy0qb5Pv+zbiLYD3j1GmzzYYuJkdjQihgN4wyM7wSZS8O8PtTVLuhsXUM\n9Gy8jW+dKUA88JSQ1v3Qaw17Xldj2oeg9NjhyBJaj4d6+rEOsgZRw2M+JkC/\n4K8/\r\n=LYOP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCkIQZAiRD1NI4fi/88GRivAIgZiGdxJYXBURC0dXZngwIhANk52RY4cfX/2NnwYHMRFnRVmCtH0fu2ECucHzDHf9zf"}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.22.0-alpha_1581973735722_0.1378931847480287"},"_hasShrinkwrap":false},"1.0.0":{"name":"http-proxy-middleware","version":"1.0.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest --runInBand","precover":"yarn clean && yarn build","cover":"jest --runInBand --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --runInBand --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^8.0.0","@commitlint/config-conventional":"^8.0.0","@types/express":"^4.17.0","@types/is-glob":"^4.0.0","@types/jest":"^25.1.2","@types/lodash":"^4.14.149","@types/micromatch":"^4.0.1","@types/node":"^12.6.2","browser-sync":"^2.26.7","connect":"^3.6.6","coveralls":"^3.0.5","express":"^4.16.4","husky":"^3.0.0","jest":"^25.1.0","open":"^7.0.2","prettier":"^1.19.1","ts-jest":"^25.2.0","tslint":"^6.0.0","tslint-config-prettier":"^1.18.0","typescript":"^3.7.5","ws":"^7.1.0"},"dependencies":{"@types/http-proxy":"^1.17.3","http-proxy":"^1.18.0","is-glob":"^4.0.1","lodash":"^4.17.15","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"aefdbe8688f3e1491a9e94c08e17fb6b3a0d6a8f","_id":"http-proxy-middleware@1.0.0","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-1yM4gD7R/U9R5AwA6STkoj8JfjnMeZIUrd8e23Yc14A7xVVLUWlAikgvidklwq1UOroJ07sc6NWNULeOJMYOeQ==","shasum":"984bbbb38cda7ce4495889388afe8b0f39ccd5c8","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.0.tgz","fileCount":24,"unpackedSize":59829,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeTGV+CRA9TVsSAnZWagAAM7YP/0TU7JcGzVw5x2sI7pw0\npHU7A0Ut3ZBPSm7QittvCrb7XEdOGLMj7bwIUm4f83MJzxT97zogJWYQ+Tki\nOfRH86TIVuoo4JTMz5yv6DxjdWTXfMN11cZ33xFNZj15U/uRPg6IiFxImK7A\nwPq3LbcKfpDZQIfyrT2ntEesWZ/KLacF7ICaVgDgmld12Ia3fyj1yH5ZC4bE\n27PniIvlOIASPWCfu4VzMTfxv3sf3lWGRv6sNzuLdq5hI1/Z5iE4SNgSiWN3\nnVJ1BfeaYqEphBYVBy7ZCeneOum3m/5ibBXK/Za1tz392cEiTcXXekbguhE/\nleT8tgRReug3vdWPIhKeXMp2PWEdcNHH5T/Juuv9d+dvgStitJdLzr4p06L1\nDca+NeUEDBD7wA+ohAzy6Nw6EgKfrQo8sNOZ5pYJu19D6b8RMLoCY8vO80gQ\nFAumAzl/dtAFw1WQ8wPBewS2/iNXNpKTpz+7odfuiI7IZahD9piPoNFSqrIL\nNUyJwshUGwYyR4fypIh+XSR3zDIZ7c04jIiRx7B7IU8wMdX5owCKvs1UtC0j\nixEWjO8xqZxLyBJNuvK4TEc0bntol4CEZZW5dyvVELhhU/QiBnkRLF6eKeI4\nmtIGQj2YRUoaEkDsYc1gr2H3ENkCtDxHpeBjibKpvxofQYR5QkUz8wLajwOj\nivD6\r\n=Pbr3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICnECkje+8X1kF+FmbVVug26m9rF7em4edZBv1fmGF+dAiEA1QWpRQ8LlS+nM524MIihQrqbamtw5E7G8tgAKvt1skc="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.0.0_1582065022028_0.619826721419185"},"_hasShrinkwrap":false},"1.0.1":{"name":"http-proxy-middleware","version":"1.0.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest","precover":"yarn clean && yarn build","cover":"jest --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@types/express":"^4.17.2","@types/is-glob":"^4.0.1","@types/jest":"^25.1.3","@types/lodash":"^4.14.149","@types/micromatch":"^4.0.1","@types/node":"^13.7.4","@types/supertest":"^2.0.8","browser-sync":"^2.26.7","connect":"^3.7.0","coveralls":"^3.0.5","express":"^4.17.1","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.7","mockttp":"^0.19.3","open":"^7.0.2","prettier":"^1.19.1","supertest":"^4.0.2","ts-jest":"^25.2.0","tslint":"^6.0.0","tslint-config-prettier":"^1.18.0","typescript":"^3.8.2","ws":"^7.2.1"},"dependencies":{"@types/http-proxy":"^1.17.3","http-proxy":"^1.18.0","is-glob":"^4.0.1","lodash":"^4.17.15","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"23522c7a88098e2e18d4a836e41c3dde9d55c4a6","_id":"http-proxy-middleware@1.0.1","_nodeVersion":"12.15.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-tVLWnJMEUANithPrWeYgReU+mi6/BJOlyvWKQGS4k8L+j2ZjituJdXhejd31X5J8Ux0SSIH7Iw+RItH9bwkGcw==","shasum":"a87ee6564991faca4844ae4ab1cf4221279c28f0","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.1.tgz","fileCount":25,"unpackedSize":208005,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeWlukCRA9TVsSAnZWagAA8aQQAIZe1PCCvYVOjxk/LoCc\nRi8rEWdjcQXxJDTbsQqjPtYlEgRb2ypw1liL6iauPyXQ1e/WVEJasIpKB7RC\nyn7SLWEvVXROrMibhzJbs0XYBzBqyp101YOcgNXbOVAbQo32/me0+bK0iddb\nkvzh8OYet+qy2bX0jEFWVnCiL6bnqj7nV8508bmov+u9lzeb1O4wef0hAfMM\noU1pomt0cJEWegP5bdCqEx2AOChxtuZYTZftsrCs0TJHFmBYaz/jvpLwNRYc\ntRq636hbYWKxVCJAGOy4X0IEVZOsW3889dOqDoCbtLMkJcp0Xvj0+XaQcnU4\nDqaLoicKCiREd1OJewTjL6TZfT1zasOSyZfTnbfivw0TcSBR0w5VgutF9fb1\n1w9M++9ClJn8OSrDoYTs5V861dTQU1wMD5Rt1OFAYySyzMrcuX1YOIrNzMKO\n1fbTk60vOddQKwf/fCg8hLIv0t0fmLCLV7Ed7aYO29u4i3Va3Z66bgrANVUf\nwO6ade7yTBSfkAHEE8qJcQ/fUBPqbfnu7HrBumk3LHpyrG+sOOm/ABJgQO9m\niw0uWcqBcv5zjtqUSVslFfxyN7L10QpfhTSinprWkOiwWJPVNtiU0nSeCbO9\nAdKwdobuZVN1NWl1Rwxe/H4xoLVpnexO7FBoWsxpgQCjKwICu/f6j3ixau3B\nvvcl\r\n=Hbik\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKLuICBJZjLrwZ6e9KahDwLy2ePWa1mqKA/yYQ4pbx0wIhAKNauwJ04oXEB+rGDD/PX3z0dE6kcvZmh8hY+oIghPAv"}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.0.1_1582980003393_0.47823463577926817"},"_hasShrinkwrap":false},"1.0.2":{"name":"http-proxy-middleware","version":"1.0.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest","precover":"yarn clean && yarn build","cover":"jest --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@types/express":"^4.17.2","@types/is-glob":"^4.0.1","@types/jest":"^25.1.3","@types/lodash":"^4.14.149","@types/micromatch":"^4.0.1","@types/node":"^13.7.4","@types/supertest":"^2.0.8","browser-sync":"^2.26.7","connect":"^3.7.0","coveralls":"^3.0.5","express":"^4.17.1","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.7","mockttp":"^0.19.3","open":"^7.0.2","prettier":"^1.19.1","supertest":"^4.0.2","ts-jest":"^25.2.0","tslint":"^6.0.0","tslint-config-prettier":"^1.18.0","typescript":"^3.8.2","ws":"^7.2.1"},"dependencies":{"@types/http-proxy":"^1.17.3","http-proxy":"^1.18.0","is-glob":"^4.0.1","lodash":"^4.17.15","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"573a8c45fbdf6b41ea99a8d8216d43f2455bb604","_id":"http-proxy-middleware@1.0.2","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-JHBdMgynLHdKXK9I3BjP8XUKERBCqxvA7dtWj2Da5Bqdo2CRCRQMuUdI36eK1FUFyh6JFIOCBQiQ2ZS+LOs7ww==","shasum":"63e8d6b039c72e7148e410e7a4690be6dc1a3b8d","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.2.tgz","fileCount":25,"unpackedSize":208382,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJebNtZCRA9TVsSAnZWagAAYwcP/AmPitZl+Q2IzgLeRld3\n1OyjjdhrxiDCAT3Wqa319URhySL7Inxog2Omb8wI5degmArsZhjtQEenae3D\nOacaoi3gKHbOQn6cUoaGU+4Fb0di3S1DbOlN534hJDaoORewBrvfM1AHCRV4\ndSgdTaCDPzuFytzfowVM6148/jXXk1GQPW/i44lRnHCWsjoOuyfaheyj8BHg\n4Lu70bEQB7Qg+QwPiCtdhsiHId60oqrsOvyUo2Ux3EJDkNB7pMsOYW5ALb28\n9MHmmEpq1CcxWy2hv+l9J3IqzfQ8WbdjHU/YfbcQpT0Wx+rubkDpcMHbYVsz\n8quMiHAT0M4ebXt+H5ez4jd/b/iXSTEKf0yRYCAvwwrGPTsgu4suPevgJSq0\ngkQWikIDzGIfQCRDyEv0oNC9vJytG8ttjvyB3ztG6q9PUC/HoR4fC+LR+hlC\na/bItafs8/21X6e0mqKuMhPr6TJnyROGJ/HxayizRjG4/Lgps0GKXRHpp8Jr\n6mKClZWbFi3aflSbvAWRhIM6qvFL0kWgxlVPbUnzeOVRy4Nujjft0JvdoDd+\nN+av6tsasYEclgFsKzloiO8eQ73J6/VxcbNz1q0U5l6FaAqa3QuI0i+75Bh0\nP6Rii0A31vlReadrVYDwtUniZqaN/l+8CdcOQpbIm1f0/5ElAJX2rXdjCD2X\nXk6y\r\n=bgRe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGjH8MjrOTzxKWGcWpcugghaH+xbk8FmKJZgZSv0xzhqAiEA+bUyPZtqcEmQgnfQuyYAYS5Z+CrtNZXbhqHSQNUZpT8="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.0.2_1584192345027_0.7979243440019215"},"_hasShrinkwrap":false},"1.0.3":{"name":"http-proxy-middleware","version":"1.0.3","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest","precover":"yarn clean && yarn build","cover":"jest --coverage","precoveralls":"yarn clean && yarn build","coveralls":"jest --coverage --coverageReporters=text-lcov | coveralls","postcoveralls":"yarn clean","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@types/express":"^4.17.2","@types/is-glob":"^4.0.1","@types/jest":"^25.1.3","@types/lodash":"^4.14.149","@types/micromatch":"^4.0.1","@types/node":"^13.7.4","@types/supertest":"^2.0.8","browser-sync":"^2.26.7","connect":"^3.7.0","coveralls":"^3.0.5","express":"^4.17.1","husky":"^4.2.3","jest":"^25.1.0","lint-staged":"^10.0.7","mockttp":"^0.19.3","open":"^7.0.2","prettier":"^1.19.1","supertest":"^4.0.2","ts-jest":"^25.2.0","tslint":"^6.0.0","tslint-config-prettier":"^1.18.0","typescript":"^3.8.2","ws":"^7.2.1"},"dependencies":{"@types/http-proxy":"^1.17.3","http-proxy":"^1.18.0","is-glob":"^4.0.1","lodash":"^4.17.15","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"e767654221fbc866adf16e3c0c96c29ca6800220","_id":"http-proxy-middleware@1.0.3","_nodeVersion":"12.16.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-GHvPeBD+A357zS5tHjzj6ISrVOjjCiy0I92bdyTJz0pNmIjFxO0NX/bX+xkGgnclKQE/5hHAB9JEQ7u9Pw4olg==","shasum":"f73daad8dac622d51fe1769960c914b9b1f75a72","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.3.tgz","fileCount":24,"unpackedSize":61172,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeb+60CRA9TVsSAnZWagAA3TEQAIdqzqTt1VDjJdBdeJrx\ncbW7+g9QKgm2yU0FOxPZt9pn6dHgyQ6aMTdnz1dHDNUzzNxPTMCWfokj4R0C\n58eZFUBVZTrsLDWFzUuzp9waFMJmCXmZ3A7aoVINhBuUh80IQflXejDjUb5H\nwXssYU0N5chW7dPPNAyfL3z8ploILDWU9OFrwq3Ihf3qmu+oGXVGaoXl/r7n\nquKR4B0Q3g7qynqUU6uL+kcX5T5OSLujJaN9CuX5SaNkUQhfZg0AqYCk9Yf0\naojIgN/sb7IWreQPn4kFu+jovFPQdDb1TQS3RaRvoM0FseDX7qmph80yee/c\nAQkv6oIHLI/AsfVsGGHuKlaZr4x8zyfwVWA0mCk3m41DvqkPgRnw15KCEtFd\nzMQPJpoBIBvDiNJjSYYSSVg4/Hkr+ab/6ByJTCyZ1G3NOVT9XCsKiZYr9yg7\nL5enUKyp0QO2e7yEJwbABn/UZf1ix145Nmb3avFYoBSjq1i32Iqm6m89TZ6V\nS0WnRzpzmUE8GEXkvxGHqQf8PF1dvXHsbXwaJ2kErdKX9peqiG+DWm8SVUdq\nLluhk7ClAMoAntAcoLbXTFoLTDCqJU6gnO3VCdiUc3zi+UHaQQg72KToOBiy\nWQmxWL4buEl8CwJCaRuLXcwCEa3RVfbNcamX30AvQ0Sd2coFgZkrWBwx9Va2\n7Kio\r\n=wLwG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDG1YqVRueQNq69tsjgQPnVbeX/Uej2WK3fdBBC73i2ZQIgC3jr/WEBdlA7KIdWXcPDp2io5IEJHh1hDExQXlScQ4U="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.0.3_1584393907695_0.47919582672539907"},"_hasShrinkwrap":false},"1.0.4":{"name":"http-proxy-middleware","version":"1.0.4","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@types/express":"^4.17.3","@types/is-glob":"^4.0.1","@types/jest":"^25.2.1","@types/lodash":"^4.14.150","@types/micromatch":"^4.0.1","@types/node":"^13.13.5","@types/supertest":"^2.0.9","browser-sync":"^2.26.7","connect":"^3.7.0","express":"^4.17.1","husky":"^4.2.5","jest":"^26.0.1","lint-staged":"^10.2.2","mockttp":"^0.20.1","open":"^7.0.3","prettier":"^2.0.5","supertest":"^4.0.2","ts-jest":"^25.5.0","tslint":"^6.1.2","tslint-config-prettier":"^1.18.0","typescript":"^3.8.3","ws":"^7.2.5"},"dependencies":{"@types/http-proxy":"^1.17.4","http-proxy":"^1.18.1","is-glob":"^4.0.1","lodash":"^4.17.15","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"68e3e300574d275ea99f264dedcfd72d7dccc626","_id":"http-proxy-middleware@1.0.4","_nodeVersion":"12.16.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-8wiqujNWlsZNbeTSSWMLUl/u70xbJ5VYRwPR8RcAbvsNxzAZbgwLzRvT96btbm3fAitZUmo5i8LY6WKGyHDgvA==","shasum":"425ea177986a0cda34f9c81ec961c719adb6c2a9","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.4.tgz","fileCount":24,"unpackedSize":61170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJewrezCRA9TVsSAnZWagAATeUQAIjWXDuQael1Xm1p4Wkh\nSxSzWFtHgHXiFvq3vHrn8TL8skN+ZTMeBD7lQIFGJGcQsKFn8U1NYGQ4DUcJ\nBzQtMTH9+E2YgGMcXrKMXgsHNXSKvDUvUyKpQalSeaiyPByn6ijH7PmanYF+\n5YmhkeDchkWgTHWcUPcUAmakC7/4bZQCZ6fxLZVuf/Xz8IE02F94WMyKj6gJ\nadWj7BOMCutWeh1DdU7l5Nn6k2IuE+WBapTieoH/gfJZYSBX6orl/II2M5lc\nke1mitUJ7WPCk+WyndrI/oVH535NOEJ6LubrjemInr7wly6v1ZMLFMIjCfSE\nUvz67mZSuCtkbPMPlLrhWRI+Q5e+2wONR3W1BxQDzgze+eadk0+RnAN1vcTv\nxGkv+XAWprLriMvhJFPWl1orA9aSLKxwny5tgfxgDsHvj1RNv5OowttcKVB0\n5QFYYZVFmOR8siQMJRL/0CP8rpkdppj6aFahdCFTDLIiA/I1WdrhVGtdnegc\nAS2R9TS9X5BJcdimTwjG5gp+c+v9cGEOaAOGyTVno5dWPeq+ZuYFn+K9N6uo\nvpjvcSuPTMb06B6VteZWnTjZBmrEZyDLUc/PdmyZmotzxiNWbZceYxxTmweL\nXnkMcWUqIrZaIIWWLWwnS2Q8bxp6cmTiCT4eHI7aHgdopUWKKMdbsA0f65BW\nDz78\r\n=Vyf6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSzhhygIiXivyOpMoKFMjsoofbYvaLJILMYluTIZdKDwIhAIpUevDb18HmPlG9TE9l9/Y/3iuzo7cXQwuWzkjW5quj"}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.0.4_1589819315004_0.22635473245502125"},"_hasShrinkwrap":false},"0.19.2":{"name":"http-proxy-middleware","version":"0.19.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"index.js","scripts":{"clean":"rm -rf coverage","lint":"prettier \"**/*.{js,md}\" --list-different","lint:fix":"prettier \"**/*.{js,md}\" --write","test":"mocha --recursive --colors --reporter spec","cover":"npm run clean && istanbul cover ./node_modules/mocha/bin/_mocha -- --recursive","coveralls":"istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive --reporter spec && istanbul-coveralls && npm run clean"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware","devDependencies":{"@commitlint/cli":"^7.2.1","@commitlint/config-conventional":"^7.1.2","browser-sync":"^2.26.3","chai":"^4.2.0","connect":"^3.6.6","coveralls":"^3.0.2","express":"^4.16.4","husky":"^1.2.0","istanbul":"^0.4.5","istanbul-coveralls":"^1.0.3","mocha":"^5.2.0","mocha-lcov-reporter":"1.3.0","opn":"^5.4.0","precise-commits":"^1.0.2","prettier":"^1.15.2","ws":"^6.1.2"},"dependencies":{"http-proxy":"^1.18.1","is-glob":"^4.0.0","lodash":"^4.17.11","micromatch":"^3.1.10"},"engines":{"node":">=4.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"precise-commits"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"ffcd889b2aa8bbc59ed93f2bd34a61923748942f","_id":"http-proxy-middleware@0.19.2","_nodeVersion":"12.16.1","_npmVersion":"6.14.4","dist":{"integrity":"sha512-aYk1rTKqLTus23X3L96LGNCGNgWpG4cG0XoZIT1GUPhhulEHX/QalnO6Vbo+WmKWi4AL2IidjuC0wZtbpg0yhQ==","shasum":"ee73dcc8348165afefe8de2ff717751d181608ee","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.2.tgz","fileCount":13,"unpackedSize":47853,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJexC3fCRA9TVsSAnZWagAA2VQP/Rqp9cPOtEy9vWQTjgMM\ngmBEspZoZg4C/EKGcQ0XP68mbb16M3YKP33AtoEd8J2UL6xdUqsWa3iSVxin\n5ytxr6+t26QtF7gn0Zl6lM9ckmHmseGyt6F/N2/d3op8StgF6pDIdXJQqMG8\nwJEAk8FcnrqR3JMYm5iscy5PpOHn11VHWgGBBBGsVKglm5iZozCMINCBPc73\nm5Prd4ae9pTz1Pf59WfH0UBM2TOSNpXTGBICSghHo4CxcG6N+x8Kl2XUsuyk\npnX9PIqWVZb2N1E/VrzRtIiDataCthlixZqQHZKJ8Y4jR1n3oqQK416yjehq\nfH67yeDJx2k5B14cuY9ef1XFJTAKMhgUM+2JDdgHCbA1ppQdN+VctFW7X3Ex\njvr1Ie+PBTtR9b1FUwluQA9TgtXF0BiLP1IrZtS0HSPvbDRPydhrcKLFco9C\nahsstiu2r9nhHhe9L5LhdsFL3nNY9zQEHZkofG76lvz9k5s1y0+pct89lAR0\n+d3Q7mUb+XwKDD1mm304Z5ZE0hpBCwc+km08f+BzjWqNWSOIXE0naMnP+0dF\nCOTPKlm9ZmZ7Qw2E999pbaukET2j6UoZPeVCsXc27k7UCytq1QZwOU585Fy8\nck8Tk+Sqk0LG3GQwIF3DxXxmA1kbwbCjrt6lX0zZzeOTvjr98YuFTtJAI3oQ\n+DNg\r\n=AX3P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCifpynlkcM7/nSh5YTt1Ym+ETwDfFIvhSySlFUHB0gZwIhAI2sS4jjj8Y15NoFLENQumD0u159en5oQm+z+HsYJhDz"}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_0.19.2_1589915102540_0.6155244724847357"},"_hasShrinkwrap":false},"1.0.5":{"name":"http-proxy-middleware","version":"1.0.5","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","@types/express":"^4.17.3","@types/is-glob":"^4.0.1","@types/jest":"^25.2.3","@types/lodash":"^4.14.151","@types/micromatch":"^4.0.1","@types/node":"^14.0.3","@types/supertest":"^2.0.9","browser-sync":"^2.26.7","connect":"^3.7.0","express":"^4.17.1","husky":"^4.2.5","jest":"^26.0.1","lint-staged":"^10.2.4","mockttp":"^0.20.1","open":"^7.0.4","prettier":"^2.0.5","supertest":"^4.0.2","ts-jest":"^26.0.0","tslint":"^6.1.2","tslint-config-prettier":"^1.18.0","typescript":"^3.9.2","ws":"^7.3.0"},"dependencies":{"@types/http-proxy":"^1.17.4","http-proxy":"^1.18.1","is-glob":"^4.0.1","lodash":"^4.17.19","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"5384dcfab6e5d565b97b2ff5d6cac3209aada6e8","_id":"http-proxy-middleware@1.0.5","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-CKzML7u4RdGob8wuKI//H8Ein6wNTEQR7yjVEzPbhBLGdOfkfvgTnp2HLnniKBDP9QW4eG10/724iTWLBeER3g==","shasum":"4c6e25d95a411e3d750bc79ccf66290675176dc2","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.5.tgz","fileCount":24,"unpackedSize":61670,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfB0kHCRA9TVsSAnZWagAALpUP/j4YDwQnfnjhdYWH8ZvD\nmGF0eM4yJR5BjHosTqfs6MnL42ArKo7ypF7DGmIJFHouCogayiWTB+3SrxkL\n0jVnpK5+He3dOaW6KT+3ah2et53KOPid4s9QFyhBxilnQDGYpj2WZgvmR6fI\noy3gVV3dakH/GLRTOGyBnKlKXClvVGDAUhoFfmVpK15SPxFTlLTqiWzd7ept\nSw8C/vFbXNqDm2R+tfeP2+BCOJt8lgp2qtMG6w+rXLBn14woYw7sIKPlV+ta\nuaYX88gj6VwDkj0lxIbaPr45O4cAgbSc+1G8gWSG5C5ARPCjXoH3ndDzyoy3\nTifzlefNNP8a1rFRTVD9I/asVN0bUzD/imSkeFhL3K7W3o4yq5yc7VRLmjzT\n5Q+tvKHSI3oU6oAYwp9wsKTXdP716g2QSRYqKUWU5ZZsg9Q3HrhIKffUVr+N\nfUQw/0yqD6AO/migQJM5MKbR9Y2DQxvWFZtK9qvqxWIWqm24f0uxyZpx4wEC\nnHqSASc75+mfgXuI8rTSfZRJ5N23zUPptoFUdsDOr8krFUdEemfq4zpN1xjq\nzFg/x/vHGqwMb0Dzw12CwIBZv15Fa6WMBgwkJ2jYTROoMcKe3VPMfSC55GnV\nmI0snhPv13RXtEl2MxomOPzTwq8mgsFkwPW8oU4uu8MeTE5QhpBYN+WR+zB1\n0MJd\r\n=03D7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQChGYbmZmxA7KgXxl1UOHp4Xim8uMPPlAtzrF91LA4O3wIhAKIzGqyjjLfIDVyLgSXrVqkZHEQd+y8+tmpWFUUqMquF"}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.0.5_1594312967411_0.25744450312708334"},"_hasShrinkwrap":false},"1.0.6":{"name":"http-proxy-middleware","version":"1.0.6","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn lint:prettier && yarn lint:tslint","lint:prettier":"prettier --check \"**/*.{js,ts,md}\"","lint:tslint":"yarn tslint -c tslint.json '{lib,test}/**/*.ts'","lint:fix":"prettier --write \"**/*.{js,ts,md}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@types/express":"^4.17.3","@types/is-glob":"^4.0.1","@types/jest":"^26.0.14","@types/lodash":"^4.14.162","@types/micromatch":"^4.0.1","@types/node":"^14.11.8","@types/supertest":"^2.0.10","browser-sync":"^2.26.12","connect":"^3.7.0","express":"^4.17.1","husky":"^4.3.0","jest":"^26.5.3","lint-staged":"^10.4.0","mockttp":"^1.0.2","open":"^7.3.0","prettier":"^2.1.2","supertest":"^5.0.0","ts-jest":"^26.4.1","tslint":"^6.1.3","tslint-config-prettier":"^1.18.0","typescript":"^4.0.3","ws":"^7.3.1"},"dependencies":{"@types/http-proxy":"^1.17.4","http-proxy":"^1.18.1","is-glob":"^4.0.1","lodash":"^4.17.20","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"f212a047ef45898ce6053b622cada4b0617b9ddf","_id":"http-proxy-middleware@1.0.6","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-NyL6ZB6cVni7pl+/IT2W0ni5ME00xR0sN27AQZZrpKn1b+qRh+mLbBxIq9Cq1oGfmTc7BUq4HB77mxwCaxAYNg==","shasum":"0618557722f450375d3796d701a8ac5407b3b94e","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.0.6.tgz","fileCount":24,"unpackedSize":61859,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfg1/ZCRA9TVsSAnZWagAAdP8QAJXqF8bThIYwQzZeGxLO\nad1hs8DE7BooTP9ufkkugyHt4v7TY+3sQVn7CdVkZvVinldx0+27LJ0VB29J\nKrHAewjdKl29z0GwgDF6fPpjvArBZHiwzGB/O3UhyKYRtqBJd7gPN0KdTMKF\nfSFeVqRgJQpoRb1BxIltjAywLmtHHMd0NamcnRJjT3UtpbfAWFKEWcQvFyVB\nJ3PNktNpzZG9zLOtmbT0aDaMHjx+IhY9CEehSQd6MZzqMZ4FE0sZks1u6j4e\nnBUm8fuKIJKsyCxeKbOouTk1ejuKBbv8JefS3LjnVp42LlCceH3BlRVmlku6\nq0ituEoVC7mKzeuXtFk+UPD1KIxuk9gvwEHCLE5qU+7zkmpVl1UzG2+h8u3y\n6RJrvESYxidANo0Tim8ueg7comDL+qh3QX0D0xIxox3nSqiGx9vXWYSgFGfI\nHD2fXGnZCIy6zk52+wOPJW7Lt4ySIQL1t+GkOcNO2lXMGhbClmcGQCqkmZDd\neRFSufwlY6P+kIZuua+9n5rcYfRFuLMDFDKyz8wUQ7guWlT/XvF9d/+e7Q+0\n2rmri4dfzQmDQBZplSamyk6lS3qTo20ImYk5NEwl/cSyYWtvs6+F6n8fMZwM\n1U+HokrmJ7L8/JJxG1QmZdktkMlpt0LeOfJzHCrL1JgSKP9QHKY7LILvUzp7\nphkK\r\n=KREU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDz4pj0Z3w72JbAEC/SIi/8w5blIuX/hAXJkf7OxYxaCAIgIHQ1n9LNN1u3VgYRNRZsoPMsTTxbBMND5OkUBDnT9YU="}]},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.0.6_1602445272732_0.03670054966795577"},"_hasShrinkwrap":false},"1.1.0":{"name":"http-proxy-middleware","version":"1.1.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"^4.17.3","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","camelcase":"^6.2.0","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"c38efe9215f4089fc2fc8baf0c7b07840789da47","_id":"http-proxy-middleware@1.1.0","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-OnjU5vyVgcZVe2AjLJyMrk8YLNOC2lspCHirB5ldM+B/dwEfZ5bgVTrFyzE9R7xRWAP/i/FXtvIqKjTNEZBhBg==","shasum":"b896b2cc6836019af4a4f2d5f7b21b99c77ea13f","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.1.0.tgz","fileCount":24,"unpackedSize":63841,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYPXVCRA9TVsSAnZWagAAeAAP/RZ9b9tQpwnz+oPFSUwG\no4WIjhVGYlAlbly5DVS6RuF7flwPocU7/r0sefU/c8rW2SE7Pup9zsch2CFY\nbty4LW3UX1rk9I1EUGs3MEOsb0PDLZxzbgkPxO1WZEYHtnrH4mhGaalD7YCR\nBGNghaD05f2xk2nZMeb3DAGngFhITeC6zW9HInBWoYvJY7+9iPaq6yn/Jn6F\n919ukvn79Vuo5/vNkUtzfGLrNpidwVrjAz1Mh+oZJrynTUJJ0f4ENGCITEez\nRbC8Q+uTuacIWFFLwzmNGRPh56bY5Whoj15SKwtsqhpDOXBhjwNuLE0vtMl2\nvkvW12azSyB8tdy22U0njHs8RPc/ZDqv4LMk6obI/HpoDHI7yDTKka1TV1+o\nwsiwjD8VLrEKOq5hwE2n7aHhqBgGTyYv5/9THeahn/wYR6MVhhuXQ+5YcNTF\nCPr6bKMqBSDFJ925c9Mt3iU21uyEJRgBXu8okEM+AwKKkKC/gnSHGre+i4kY\nu49JCNgiDfZGykzProumDFdBFNaItbb0k5IKYnH0ZkNuCQMK5wCuFG/qr9eN\nU/SSxsHG7CkLtwR9tY0GTdBf2x/JP9LTaLG7rf29hFXbvY5dh3NBq5TuaS5l\nlnZmDGe7ktBsT8EJiwHd8KJdxFMkxuKyXhpGgDQjXLKaP5Ty9dc+mVfoeIRd\nyp5T\r\n=qZxO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDEUvySSZABjHon9F8ZnaStP5FKxndPqB/IPciSExXREAiACXre+2zoOGmyIflA0mE7lmNlxlmSCOb6CITARxCKlXw=="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.1.0_1616967125273_0.06070082130393617"},"_hasShrinkwrap":false},"1.1.1-alpha.1":{"name":"http-proxy-middleware","version":"1.1.1-alpha.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","polka","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","camelcase":"^6.2.0","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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- [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) {\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## 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\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","gitHead":"ee772489529c3a2077b611b494bf273d177292d8","_id":"http-proxy-middleware@1.1.1-alpha.1","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-w1Kl9DmGeSum/+rWP0JNMaT8W+klI/dXVTDETmN/wgWfli1MtGhgF8pGKvNU376pLw74E07f5ZrqmhRL0neOLg==","shasum":"b4555a9aed831b17c5a87073995f01abfeda9e11","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.1.1-alpha.1.tgz","fileCount":24,"unpackedSize":64352,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZwy4CRA9TVsSAnZWagAAHUAP/1dY1zEp7oBONEJi97n9\nqNVPTf8n0d1AiJP7KbjUMJTqT+/ALbxR66KLcYyoz6wdZ4h+1RF+jqd9uh6d\nknbVr/CVZN7EfZhsRyZJTmYGxyza5PmKEQ6w9dGBnPMbbyoetkLYhGnxd5Ne\nHFA9TbgYCynu2oMS+Ugr/Wg78n3NvuLIFElz5Tg9TAJdgTLJuA+p/cDo46BA\n0tYPg1BjOep2Lc2JdOy67vgpYkm8XktNvdzQT9zaJ6qSBKHc7Oq1rDQdXR4C\nP6NI8H/BW7X3tkmn4Rr4Q2Sjysft04OLmz8vQrtc2bhSAsqKZvDWBW+I8Kgx\nrdQgPL2YnCD1Rc88nBmh1rwOLtQOYE9o6we+r6Ythwya2Kzxt+Dn8sFLYwPy\nEjwyuAJbI7lvHSxpN6YAfrDnAlVTqmbNy0MIDsfjICewLNc0p5/DTJlDneDs\nrIzQOy/aYL6sbsZBrTr7Gn2D8IIMyIUNCnbsXo2Khf8Gd7KxEGPgnG9kyo+s\n1k/aI+/mGTkGI4U+pnNdpxEP04wiK5LknytMzyvVnBZnw2Bt5mZp9J+xLo6a\nVo+tQaOjKuvT1Mn+ew4+9T3Y9NFYDmw9cIHbPmLVBo2PDp9kXHwl5NcvgHqd\n5HSg6RpPrsi1tN7GtndJyb1h6p/GmRK8V896zUZd6eqzkahGcmTErNNXsChk\nmk2+\r\n=1akb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPfmvp8tqwxr5+KjZ4FmPnaKdVRpCjTZKqQuuQFrTCSAIgdmt8E3eZA+rRMHsJpXoiyUtmX2GcSO1OQiaK0/ftBoU="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.1.1-alpha.1_1617366199268_0.7974520580359621"},"_hasShrinkwrap":false},"1.1.1":{"name":"http-proxy-middleware","version":"1.1.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"0381fdfbc5976ad8a3632fd92b7406047f1c6748","_id":"http-proxy-middleware@1.1.1","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-FIDg9zPvOwMhQ3XKB2+vdxK6WWbVAH7s5QpqQCif7a1TNL76GNAATWA1sy6q2gSfss8UJ/Nwza3N6QnFkKclpA==","shasum":"48900a68cd9d388c735d1dd97302c919b7e94a13","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.1.1.tgz","fileCount":24,"unpackedSize":64745,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcWV6CRA9TVsSAnZWagAAO1kP/2L6y+vtvNkW10G5uw3a\nT3M77nqkmGoR2erDvG9NAwkQS5omycbJj6H1ce08d2otQ3UPrcriwo/SHucm\ndSqK+rPYddnBuS0lW+8KTUW4HJw2c6mUS9S9DIWXNIletu+WzwriiKMD+YUO\nOl7enu+Qwjwg9xQOLkBtao8hc2P24X5SlJMUEgnDiCwvxsQ7S0MN6zlTHJKh\nV3iryZsuFPHgs9i1TwPL7mHxXVUGKrmaX7z48+bOCrhlNFZiND9dQJbpopSu\nN0hZiPSnMP3lVFhVIRW+ot+G7R+E1AXNrwdya26HuiYp1JdDx21JsL9ynVYX\nb/jPpjGw33YSnW/uOr7ACNaaU/gbx5PJWi+Ewb6IA3OvnG5mSK9CRJI4jYVY\njPsh/53QIywmVUl17RUqm3k2HslN0As4fpPv0gv9meeUsaPxOHTn+E+sGIus\njwFPEIfTJPLr4k1skZCAPhY523S5n/j5PvObZKwLsw7GvNYyooD3tdyNAT1x\nbPILG1Mnlr0eI3Mqe6h7DpUh40Bsl9m3nJX2cBcaTIaQvZE/eg7EgRjO0rof\nzCwhmiZvrWq6SCq7bWiXnaUdSssMJQcIKy/gDH8fqVgXhsZmlwCJvwKufKpF\nPFPl7hKXCLLM2eypBdFUVnh328HlvewNHf/t0fsaO0DPRe/IY3ctY0rZOwkh\n1dVh\r\n=QglH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQbwm2LUaAVLOM6gcfG9MqISC/VR5V63fBugY6SeQpLgIgPpvka8livAEIp2s+bgGeCpNAe2K1LP9Ln/NMFgmIcOA="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.1.1_1618044281517_0.17950443558069162"},"_hasShrinkwrap":false},"1.2.0-beta.1":{"name":"http-proxy-middleware","version":"1.2.0-beta.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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 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) {\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 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` you are not limited to manipulate text responses (html/css/js, etc...); image manipulation will be possible too.\n\nNOTE: `responseInterceptor` disables streaming of target's response.\n\nExample:\n\n```javascript\nconst { responseInterceptor } = require('http-proxy-middleware/handlers');\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('utf-8'); // convert buffer to string\n    return response.replace('Hello', 'Goodbye'); // manipulate response and return the result\n  }),\n});\n```\n\n- interception recipes: <https://github.com/chimurai/http-proxy-middleware/blob/master/response-interceptor/recipes/response-interceptor.md#readme>\n- working example: <https://github.com/chimurai/http-proxy-middleware/blob/response-interceptor/examples/response-interceptor/index.js>\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\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","gitHead":"1432c413f9bf7d1e5f2a884f0892ce456c8c7c44","_id":"http-proxy-middleware@1.2.0-beta.1","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-/pfX8eEXa1nz96Kh1UFAeZ92+9vnIOBFNn4x/RhxQAUxjl4TxQkhJfuBP6drd8Fd0k2KmLrW46w/RKb4B5bXbA==","shasum":"f465643964b704d23ee5720eead9680c5cf479d2","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.2.0-beta.1.tgz","fileCount":30,"unpackedSize":71375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgcgHSCRA9TVsSAnZWagAAzHAQAJSQakJuIQJvd0XZyi+d\n3fCGcotG212MrH6TFsXR49xIglpd7UW3qWDL21hm8jiR2kWQX0SKtoX6Njpr\nHcmjRRckUYw/U4TaKAAd1zhKQbx6AsUVc1MjpE2VySTZ3LxgDQYqRL2ne9fk\nyUY0FRcPgj9GrCGpWE2RAjoPeppr3yPxpW0N/hmawxhDWn6xvR8Dz2kuyriV\nEytl0WDc9it5adPU8jRFEhFraAHobRynKBstV8uZPRncqkOs4pZ0fqDQysRs\nBJKmFlv238rBgPcISrLfnz0Hl04Yibnl3TdO/ZjcYtOAu1dW1et7LHJ64sHF\nS9qqny7/OyEfvn115rmY7Fjg2tH5TTFd5B6rdbBYDgn7Ri1NliUOtXwMlQ+P\n8s/iyKkklXC4YAgvGvnUnDT6sMzS7qyW6xtgy162JudCkSIB3nNvulvYieaK\n845hQUlnb8D50T8aWh9EvcBi7K1PC1LgnorMOuMRwiEvszXsniDOsaCeSpae\nOJN7RJYDhCBYWyaqxhUu+Ku9+e7KR/EMT5PaSB/atkc7baYgANx0MW0XS/oP\nHLZjmtSMnMZ6can+gJrMSJWxC9ns+I38/37Dt6lMW5fNpGdHldw7zaQYLNve\n5swjvu4dDc8JFnJolgd9da+23XIny/BXNBEtOz2SRch+PGD2r7VFfnKcpnzF\nmjI5\r\n=Vp6l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCksn686yk6Ng5ogKgd0S5ZaEvLNN4tRAPwPhhO1LzubQIgDu46AkpA7khgfRum6Rw21xUgTa8xU0OLez9BFYWPp6c="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.2.0-beta.1_1618084306422_0.5777143701543554"},"_hasShrinkwrap":false,"deprecated":"this package has been deprecated"},"1.2.0-beta.2":{"name":"http-proxy-middleware","version":"1.2.0-beta.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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 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) {\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 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/response-interceptor/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('utf-8'); // 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/response-interceptor/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/response-interceptor/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","gitHead":"dfae56e9ee44576403a7669c2f52456dbeb438eb","_id":"http-proxy-middleware@1.2.0-beta.2","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-RTjKZvwB9u4O8pyk9F0kUYbL+qrJAUsc0Y0KsYmvtxuJVFyHagr47tSr7x9BimFzC5AA9vm1KnWKd0LOk5EgrA==","shasum":"4ed796c56a2e42099a6a66643606d6339e84dd7b","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.2.0-beta.2.tgz","fileCount":30,"unpackedSize":72193,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgczyQCRA9TVsSAnZWagAAR00P/R7t4vQJuhpJuuz8aFY+\nREJFdwnz9+J2UQqykMZA2IpFD+W+aZG2f9gg9lJ/L+T4HHeTQZNepvD1RY4A\n/Bvv3UMNF6J3pcXF7s3BPJ88JPWNSxZe6JoeStLiszkbpCEtgoNQZ7yQSAuc\ncNg9CD91+2dk5/vTOxFikHyjn1ZA9aF+Bs5roCQlfO2Hx9S6AaqHuMfrUrp1\nILG4WP+xFz4OIjPFLtaguu1Xa+/sWLXdHNXsRFhV7fE4yEMYZV5vPbhxfiR5\ndw/cdnAwR0jatIA6g5QVLVpMi9mnxG5eoCfIbE3SDc0pzlbfAoDT6yOg3lXS\nF3C0YQnJM1bVUvqUY+D57HAa86iVDoKeLbdj2FUDJGgTk5GECUZwx3IM4zNf\naBUZnrhM2TycezQF514WgiHmUwLHfAwela68l4zm8YJULZJFF/sjPbopwQb3\nrGGJxQRQJ6+5GzjoZ6tfT4AkPGR9i8Klge5qWKsTXkLn+qTbD5wAujO7VbBG\nfK98s+VnGpsN7kI0OgQJDkWCIjj1H01Nddhmh9Z0GNX6hbOtVmXi6BAf6nAv\nPSWCxsp54Od73YW7iSyMZLxzCXZexGGQy1QI1Q/o0YeO5mUpyWCGM8qSaSYA\neTAojInihv3HK/6SInXOtEjygWnm0e3RtFSGf3vtcJYvQc9Q3r8bSy3t/XT8\nPcIl\r\n=Q/kJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICesIfesZ63Ni1UDkML8QkYbfzMejjF7kSQUmCwlenI9AiEA+bNDX1bSbY+NobFGJNCFHgD2REVlSQezdPusUBbvZDU="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.2.0-beta.2_1618164880170_0.41679844754408135"},"_hasShrinkwrap":false},"1.1.2-alpha.0":{"name":"http-proxy-middleware","version":"1.1.2-alpha.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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- [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) {\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## 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\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","gitHead":"2f97202b1f59df3b8ddd7128268d9ab844b8197d","_id":"http-proxy-middleware@1.1.2-alpha.0","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-qgxN4nW7fqe5FqTJDOwSytGfnc4cThn3Wt6cv6P7xhL1EmqIClx/85dDOoc3A6/CeknbLJsfO+44PIhbWQULUw==","shasum":"5ee6a2d14df20d20f7107e8d9ad27f31288e064d","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.1.2-alpha.0.tgz","fileCount":24,"unpackedSize":64896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdK1rCRA9TVsSAnZWagAAySwP/20UkGqLXoYvzXxc2WHC\nRvpA9/7veyR/aGcChrTjXnYTnJvFE3PFbjXkl/2gimSU6SvhZJbM2PgFW0YK\nBZFzcV+E2PoQwPaaoKxx+RG+91Y/KfiRHMFTm9qJmZw/vnozgw2xx1RN2WKk\nHyGG9F2AYEdXo2+QjUg4iR1op6U8ETG1L++s+SsXRxb8Hzaq1w13ErP7VLBT\nERlN8aE28I0lw+oofR7I91FUkP5jm5d9D4MyLOGA0y+/HIlUJ3cF/0r0jI/P\nDEQuyhS02iKEJ7lzPG7MEpLIi6etV5DUN7nLvDL228ZenVpi1L3M1Mw3bE5B\n7fLsJWHRhlSLrtBzl7yz0HFJOv6kfzMk+IReP9D+qcXYIbF4mftzZnG6wiwE\nVWqVn8J2zspPKrrGZIn0i2EI4jGS9Lrt31ZXrfPuGm2e39SD+kr60QWolXwt\n2fELol06Y04NpCDf6W37OeK9CmoF2DSgTe0BwLVEgP0zQRzzhT5CSnUyQob5\n/oh/rLPCPbxRHhOUPm20psQIbScr7VYgEnLFggRTzFGhQ8mjj7fNwqy7F6gP\na6nN5ZD8Hx8NzCiXCKH5mzgk7c3BjVslMN+XOsKg+D7MOyLUiIs0XMomUrD8\n209nDfCxPYyX9nYr9nVJehopdE92fNWSygtKvohkIkoPqB2w5snCmY0uqxs7\nq3EH\r\n=awDB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDal0s7JyRZqwYe2eYQeyho2Xej5js0q2jV6CSvQWbwggIhALx8tco2P8WgFW1x91MYki+H+tpBMw2ZSq/P7zjTtEjz"}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.1.2-alpha.0_1618259306713_0.8024058070304976"},"_hasShrinkwrap":false},"1.1.2-alpha.1":{"name":"http-proxy-middleware","version":"1.1.2-alpha.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![Build Status](https://img.shields.io/travis/chimurai/http-proxy-middleware/master.svg?style=flat-square)](https://travis-ci.org/chimurai/http-proxy-middleware)\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[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\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- [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) {\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## 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\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","gitHead":"2f97202b1f59df3b8ddd7128268d9ab844b8197d","_id":"http-proxy-middleware@1.1.2-alpha.1","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-v3tO39IMIRbUSYPfQG2VYZO7tU7RWOm7R8BKkZnoWomkvGWzBfakw318KWUn69EP3QKMK5tPbALfmz+QilP96Q==","shasum":"654f4d088ae3e08124ff1de560e9d58fb1a30138","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.1.2-alpha.1.tgz","fileCount":24,"unpackedSize":64896,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgdK4pCRA9TVsSAnZWagAA+xMP/23Ybb9TkfSRGurw2fC3\n39aCqGOZ+xoFP1/be8ZqX82iRvbm9az/YB+EHfG17TrEelB/TMPDVdFZ2FVt\nqPq6uLW2jAchKeirycgVUZo4huz3rVGGncqV0oZjpLIyMRX7Zy0ZlvbS3BDw\nf6GV1wnEy8PwDo/p8qvX23VxgSPFNphnUGze7M9NvEQc2XkFGnk5IROurne1\n+jRZVXX+6dfJESy5qE+lp8Mn5k09YOGSj/473gGXrBskv7KUJ7UxPlXBpdEt\nMRNOCOj/66vcquNV6gN09t9Ayvc3D0/6yz3Jzk2TCsGYAddl2Z2j1EYxdlWZ\ngmEucvFs+sfMtI47Qbgrbw7VqUrOfijNc5CyZklExY7aNx4KP8muKdNfXxIm\nbKF7yNImXekwXsXsBq8NWlxIW1skOT8CG9lgo898W60aXFVko5mhFpJK4kDL\nBE1RqMzd9GjmuOz59UEGnceBqJ4aAlMN+cc2kv86RiXrfKGvgeMWosn9cGPY\nwqWDETH/zwz7DGg7XLEmgHptmZVsAoZU1V+OPPLLYVsGBl8TpcJfXXntZHkG\nv+mQ6eavuiQ+SpNQ2J9WzJwEyZWLiM58gD05hBJbacTTn4/qSZ+c0XwsmSan\nqQaP1syCocS3tvfXYbaYxAsCbUTzpvrMg4LKs48QI5okxYfrCnNXuNVukGV3\n9U9x\r\n=fEg0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKbGqJRuk7kpz6zlFV+TPqAJPBc0zo2fCEp8Ms+rdJQAiB1XS7RizSHuqhCm1ePxfZNlzdwWD/O2K4U3c8ufyQBRw=="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.1.2-alpha.1_1618259497110_0.6698023597581009"},"_hasShrinkwrap":false},"1.1.2":{"name":"http-proxy-middleware","version":"1.1.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"13bc071c0caada7a4fb2345b91256167e7d7463b","_id":"http-proxy-middleware@1.1.2","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-YRFUeOG3q85FJjAaYVJUoNRW9a73SDlOtAyQOS5PHLr18QeZ/vEhxywNoOPiEO8BxCegz4RXzTHcvyLEGB78UA==","shasum":"38d062ce4182b2931442efc2d9a0c429cab634f8","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.1.2.tgz","fileCount":24,"unpackedSize":65011,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgd0utCRA9TVsSAnZWagAAFaEP/jlKEYO0uY7URY0SrWEC\nesfX0zbBsGVkT1L0kBOWk3kyKWY3kLDstmrj0JuEv4Uc0CCUZB0dZdb4s/CQ\nWi5Faq8KkeR/A81urug/8CLQpEy+SJi2mEheTN/P1hN1jqJvqyoemzrdpnUP\nxQVOaThSDfqGTEUmrFeNtwidnvrwhvwsobatZD/C1SO7EISksd0EW4h8nRE2\nNXKkRk6iZ4djYYpKs/XcMT1MZfXvucmg4/h0eLq81vSbY1/K4PDtak20f6dS\nrWMWdijZFdQGSiCIbEC1FeI2zUAyTHDKRZ9HWVVw8Ncx3wzoiG19Eq6513NM\nCwpolj764F6IlwTb+EHtnRTBrUaOigBkLZt13xAZW1MmbUzwBHthl5jvOXm5\npjaDCZ4iJmc5XHZ8gArr46wh8G1Qk4gjdJXhgJ6zXsELzMujmndO8AwPqxED\nr66S4GWlzfnKDdwTSxusxetCxy+8yIlBcYfKiL4QgMWDFCFIAZj/B7Ej9Qqi\nUKlcaBvyMH9PlnbR9kJNgrAb5ihdeYvs436GHxA3vdnYy1IhiMkHAPDmqLTz\nzsbm1Xvr5tlSCbVeCYpp+CAV73SZHODVJovcBVyfmjlwNEQ0xKKYgbOaypoy\nLwcvHEou8ov+3rtwuI7ubWa+x4/31iM/mlXTgmlBXh9aNq2vq9tJs1LE/2Ff\nmLbJ\r\n=B/PR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID4QLiM4hInUHlkbJ4vhOyMkS2treLyaqd01CNyhzqB7AiEAm+ewuymtovvvfFHMhWdVR3xQALmLwgq9Xhh+MiYI30A="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.1.2_1618430892692_0.7539643211264488"},"_hasShrinkwrap":false},"1.2.0":{"name":"http-proxy-middleware","version":"1.2.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"017ac01aa08bee2cb286e9f229b9fb78d406e4c5","_id":"http-proxy-middleware@1.2.0","_nodeVersion":"14.13.1","_npmVersion":"7.9.0","dist":{"integrity":"sha512-vNw+AxT0+6VTM1rCJw1bpiIaUQ1Ww/vTyIEOUzdW9kNX4yuhhqV3jLSKDJo/Y/lqEIshaKCDujtvEqWiD9Dn6Q==","shasum":"87776ea3d4d8dda3dc2594a076787bbc6fe4d995","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.2.0.tgz","fileCount":30,"unpackedSize":72825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfDIkCRA9TVsSAnZWagAAfwkP/jSwcRfnTsSx0nSv0X+U\n7s5RM+/YaFj0voFwFO9EXwhUQfqvSujIS4RRc3MkF+eUhkcAzNL2FXCYKsRT\nZbaFND2uMrNvVZHEPzSRLM3Li4ufdcC48tFRc0gDFlDkdq6FEKMnIvri7fhQ\nwno5+bpOZDIS0beOYQXTOOLOjnW+KaqXK/B78/Wz2Huc02DY/3NIeKRSSJpO\n+rnyCtdDCw2uY70OVCN2NUG/Z3vKBY0LDnBV4NryrMvhU/XZaKqjCph6A13n\niXT/yXAIWtduJz5Amqk7QW89PNZ0RpYwHlN3g4ZRmm524mW6ILZd9IjCoUDP\nBqdJsEkoJpHkU01qDbcy3bce4QVBABgsY9/wUwo9cErVHQ3V6Aq8r//F/Hzb\nfann/AF8TbtJMhFHOGk+3L04EH6XM6MFWTYYPdvYWwpgmu4rV/d5ObpZ0kO7\noDT5mxnImWVM8V6BjuN6SOLN0pswetr5fG9d7XNl2Xcisf4SnT+g/xD1FEof\n05K6L8OL2s7fnekKhG5WXFKZwcTjX5FkP/SqFIo0xsVSd/i6zo93SmtVD19V\neHavBKrF2MXtZRGKKqPxcptsOBMSh+B9FkBZLAAl+Q8gcxKnoRoSkaVPjeIz\nHb9rmbtvaTyKSZvGXczilGGlib54UxeaG80cVtQjDUkQ6lMmP4u+LtOfb/g7\ntUzc\r\n=sHcL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAIwJmuCrDXXkFNIkLeVAXohtW/JTxLQhlIMtyd5voMQIhAIH7ta013QmIibMyWGWvbW4TzJPoDly00/5VJcjyYH4k"}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.2.0_1618752035626_0.6101996567188903"},"_hasShrinkwrap":false},"1.2.1-alpha.1":{"name":"http-proxy-middleware","version":"1.2.1-alpha.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/chimurai/http-proxy-middleware/Test/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 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 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('utf-8'); // 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","gitHead":"062fca947f7b7110cb3dde63e7cad8c5b1d27598","_id":"http-proxy-middleware@1.2.1-alpha.1","_nodeVersion":"14.13.1","_npmVersion":"7.9.0","dist":{"integrity":"sha512-SwTuJEU8C6XC5n7HIiR6GW52c/BWLR75f9q1IBkH5jxBqevRNqVcFfvJnQCnQPGfDTYfoVEq1QQQDPNuCTTb8w==","shasum":"e489763677efbdea325f51188d038b7798f2c223","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.2.1-alpha.1.tgz","fileCount":30,"unpackedSize":73965,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgfzlRCRA9TVsSAnZWagAANAIP/R8NMCNE+7dZrrjKmQKw\nj2IdM4r+w1o9osBhOB8aV1NunxkuudvUzbeb5mEVkcR/V+d6Q+8aHG2kYIIF\nNhg0A1dafIrvbud9pIZ48bu43RQZ3s5xdtaVSvDzNldnYw2Q103LSMqr8TQC\nbcs05GJ2NFPaFi6xlJqlKTlenw25LLGYD30MjHg44pT1Rq7adxdzwbEQgEv5\n5cEl2oUwoK6jrMwDKTR67Ckr3whyJ0GjwTFnu75D3mqcOinlder8+mBoYwrB\n0knXXj+wScjJjvqPPL+NWI47iKWhTwwmMGUVdAcMsXmdBg/Dy9Yxx18q/jY6\nrH956cjzV2eBBp3H06ftjrlqlb9DYWAMUuCw8Es4VT4+h6Qa1FPREL+Vsh9k\n6Y8ZhnO+S4v2JDW0ptycEf8CYhLmG7MFIJ83zkmiNN/FpLaQZP0P3tFe8Rbz\nOMASm9UgrdeHNkPcbhgFd32bINmkrdzkwJSOziLznEyPNwvwkUaj60leJ8Cq\nHOC0RrSG4kgfOYEIFiluFjL9tstiYgHiCAODTpswzABdkcGfIr4nwulr1U7v\nMMOgaKLFz2IMtvBRtTN2Chh+0UWrIW/Tzm1wWWqKWY5uLXEZ+v/l1zkAAImP\nGAT3AdSifNiGYnNNiQ0Boa2m5FxfV3t3p4rFv8a1fEXI/Jg1oDjraMBDN2om\n+6wC\r\n=8OXK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC43D449VFE4OHtylWgLrk6fWDFDY6a9WriMGpxln720AiBmu1VHi3eCAxqIqWEk/+O8/18g8Tc26M2AgwQ+ohOZ/A=="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.2.1-alpha.1_1618950481421_0.09258447531085601"},"_hasShrinkwrap":false},"1.2.1":{"name":"http-proxy-middleware","version":"1.2.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn clean && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"1704875df236bfa8ff156502436906cd84fc88bd","_id":"http-proxy-middleware@1.2.1","_nodeVersion":"14.13.1","_npmVersion":"7.9.0","dist":{"integrity":"sha512-mxqwEC+IOneTLuYz1B7fmLUmXXkVWfcbiXe8LsCctIX12vxfJU1Uj9HJD/G9MwK4HvgEdgKI8NZySM3uheC2JQ==","shasum":"cd557a809f56eb98ccb2fdb45593625770ea9c78","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.2.1.tgz","fileCount":30,"unpackedSize":73995,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghBReCRA9TVsSAnZWagAAfV4P/iTTkL6qJyq6erxI2ub9\n0lAHgggaezQeBV+bk2MQgihIN0kA1uN7kKKtD8zASMZSyIb4RWNPSw+IsLJF\nBdiUiv+oNZSvnhQv3g1Oy7rWpSh45wL7WPB1pY0YfU5EBfvE4HktMhMvEcqi\noZl7866iwR+hfWZUld21L0ge58VIMYli1GqKxiqhjPkhsHQxeYIUrcW325oG\nT745stKSzg3rx3wDpLMX1MdBwJh3+b1z+YD8zzQpr4U0unLDuI1WagcCR3PS\nnaS6T+WZBvDI9e+evsOLaVYHtIWtEsrA3hhBUlxS151vBbJUd+O8/XXeD/X2\nfQtQYYCXDd+QkwXNYvUtFSwQ0EsTuPDap9fZPMVhVokg/gQ4+7qeGe2YC3lz\nH6ZWLSddzLNTCA6Vn84mZIvoCH98tVu8ZUtQfl8MUvKQsOF6KDPvDXQEQ69R\nMYEe/d2tM0WXNr35RFRTFWMFa9lWfwsLeza5lk1/ppxSVq/xo2968K7/Jg6t\nxl1WOmvDLXYUlyE8Zcu0/ioj4O9OWHO1kCYHtinQzafXC0h2Qbn+qXo9wCpv\ngbv24mUYGSl3HpW4JX+hfxCtesvtBMOog3yMo9BG3mhU6iQIcC5VtOd65Kl3\nHzgeZxPgwUXKskbC9qQQot2lv62kUtTKh+3+N8KF4yFGm9r8JD2thZhcJQJx\nQQmG\r\n=16Nq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCIHMnoHQ7QPtDi17e4Rfm24uZqg/1Pd3/bAAbB8TcBp3hAh8hepVcdTL0rarFSOxx13YjhMds0BszydVKPR+0zAbN"}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.2.1_1619268702319_0.7473786158720461"},"_hasShrinkwrap":false},"1.3.0":{"name":"http-proxy-middleware","version":"1.3.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","body-parser":"^1.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"34468a161065cd147120390af799a556dc3494e2","_id":"http-proxy-middleware@1.3.0","_nodeVersion":"14.13.1","_npmVersion":"7.9.0","dist":{"integrity":"sha512-nHn8lcFNmxCalzHGXMn0ojKunXC9twBvJ+y7QNhvK/ep7ZDOXvO7Gph01rSwsMOrG4m6N72gAAWXMYhPZvK6OA==","shasum":"eda5e0b7d1f27ac82bd11eb5099d8c309d30cf30","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.3.0.tgz","fileCount":32,"unpackedSize":76406,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgheBwCRA9TVsSAnZWagAARxQP+QESTdWW3rgNSAqwzqCW\nAN4oz/16dSsX/wngZgZTGZ5IP6Pr9LvV6z4yUUc+xMbqBkNVYAWWYpnZPmml\n68nEn3ApEBMLifDNH8Kko5L/z+GuWSkcTGn9fX/AW3VJzvRQojqjgZKEmLz3\nHVgdp6kATW4DwhoMqghUoLZh7/p3hsrzGC7D7yWqKsDZ384itOnmTs57rOoG\nw56VA7YNBMPrYO4DznYHI+boG5e6waJAJ35gc4tE2bsOxT5LW7R1ycLPOodN\nsqhWk5VzzQ7os6uRBO/yX7aV2TLC7DDVl103N0CbupAtSOqG+ajXF+lc+QMO\nDARyzEi6ctka/6sxYMqOeBQ5Sd+mALITv7Vun0QI3R93/eR6EqKsk1prHGHA\nUD8pPHskpY1FiDP/JXufMQH9jhOhFkpHn/ZnBuAAn3wiRjU+b5qIBNccmKh4\nR11hJ8XEtMiaM9zIZ5pb8PESpElvxXIjH7LBufS7/1ZvalDqpIHM8abDSEfC\nzJiGufspTBo+b9T8uiYd3NEfjwB/s0WFMlRyfs0gZ6ERRuikE9N0EKFeoWY9\n0Z+0ebGX6eenSmRXT/c0mI/S5uqQIwEiXhtFL3rkzYkwGNEBGbsKbBBc0wZW\n+3qDKE1EvS1c+VYhiO1ik/Z5wSlBkPZe4IL5MrWz92Jw/+pFemvq/lAFEDMP\nf56r\r\n=Xw+6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBrUnGehnCGxmb5R0um75nu7MLvGgw8c4qP/q6fH4FoQAiEArbLC7DPLMQSMLkQgul3t9oRPweRFz2vUlBNGAyyrWBo="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.3.0_1619386479649_0.14639021965837373"},"_hasShrinkwrap":false},"1.3.1":{"name":"http-proxy-middleware","version":"1.3.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","body-parser":"^1.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=8.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"b78d5d4cbbc681e4c4d1b5257477f40974dc3b84","_id":"http-proxy-middleware@1.3.1","_nodeVersion":"14.16.1","_npmVersion":"6.14.12","dist":{"integrity":"sha512-13eVVDYS4z79w7f1+NPllJtOQFx/FdUW4btIvVRMaRlUY9VGstAbo5MOhLEuUgZFRHn3x50ufn25zkj/boZnEg==","shasum":"43700d6d9eecb7419bf086a128d0f7205d9eb665","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-1.3.1.tgz","fileCount":32,"unpackedSize":76672,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiayDCRA9TVsSAnZWagAA6UUP+gNbexowlPMlxFFgRo0W\nCfuayCUDcT4vWakBoaYUFhuV9fBFgu3P+zPWegfj/B1nwA3WABP8jCaGadci\nPrutjpjM75VOjlyX49EGvFAVb3cmNp+32zVhzuVca0uVmw83rjodFZK7HTN8\nKot7ez1S0zLA3e748lwreuyN96zJB1cXa/HADFUGgC8xwYYoxSTA4ujXIvrM\nFXGpsry4OeGc3UI8eb+BVdGNwgeuA6FI8Av8rdsXF8Vn9XLlvtnyHbCizOcw\nsqhSv7qLqgWHgE8sIeGTX7itWkoiIiGmOGb/3SnnCY6zo4fa4WntzokVwu6h\nJ15ZMCOL9rta8HJf9AnsxzhcUsDzhXbqcVJ2TkIe1/u1Z4irzGWWTVz6x8UW\nNPtVJOha0/x9aap3Nctw01ukdx0OG1EvS/uiwDqXNkN0l4eEUygIuDOWPUrc\nVjfn21FgaDyVxw8argZINximKJC1tZZf801e+N8MaOhop7Oeh2WBKz+2CaxI\ndfJhrATw03/plcMEs7p2J+HgYSXNcmAQoZx+OHv7G6kt3vLqRYAmKtRmJGUN\nbzCdKrQTbokHmozP4amg50J0Y3HqM8vp9C673wFey2nmq24yeoeDuV6df9bB\nI5aRjH2zeQPl73BoHsBvp1EbO2n3Z4j8vWzSg6WU4nxGPbz7BC4dyquvCJPx\ngewp\r\n=+U4i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXpOWXiWvhlyz8tCth1WEWLG36KHOQOMmjO2UY5p8RJAiAA8rsBWqD7f8dgvjz6Q0pUWxp7fJ/kn2srQTDzsjyPuA=="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_1.3.1_1619635330858_0.8286384264152014"},"_hasShrinkwrap":false},"2.0.0":{"name":"http-proxy-middleware","version":"2.0.0","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","precoverage":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","prepare":"yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.0.1","@commitlint/config-conventional":"^12.0.1","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.22","@types/micromatch":"^4.0.1","@types/node":"^14.14.37","@types/supertest":"^2.0.10","@types/ws":"^7.4.0","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","body-parser":"^1.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.23.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^3.3.1","express":"^4.17.1","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.4","mockttp":"^1.2.0","open":"^7.4.2","prettier":"^2.2.1","supertest":"^6.1.3","ts-jest":"^26.5.4","typescript":"^4.2.3","ws":"^7.4.4"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=12.0.0"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"lint-staged"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"6429b647fcbc4ac8f60c37a654e0d1c306fd2551","_id":"http-proxy-middleware@2.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-S+RN5njuyvYV760aiVKnyuTXqUMcSIvYOsHA891DOVQyrdZOwaXtBHpt9FUVPEDAsOvsPArZp6VXQLs44yvkow==","shasum":"20d1ac3409199c83e5d0383ba6436b04e7acb9fe","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.0.tgz","fileCount":32,"unpackedSize":74384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJglXv1CRA9TVsSAnZWagAANN0P/A6orzyohFSVi8L6butU\nG+1u8z37TK4ANPObOMS8I4N6XUEYRy7k35kggEnuKsbjUKqGQnbTjpTSopOl\n1cKEtPo0bwz+fKY7bM1997CnHJtXb8PG+f+A2kdy6ROTvs/0ZKRYAuvhRgO5\nfHEul9qhy+tdC4Jy9kJ5tH+RmaeaI4F/Vc7H9BlkI2RzksSSRjm3UqhyPLqh\n3utUVKag60lQr+sPnaLw0Pa+7KEA/JZWUXYLfZQj/iTqrnnF3YfOYrdAb/4I\npKtbjGluy9/eoWWbbnMa8kan4BH1rTBsn13XUdfU8cXEngVGvUUHMEtMj/JR\nVgOSfPZrrCkYcokOw8QWXpVM/PxxpM6Jd9kgTqFMipR7598zdpWTlpyKh0lM\nwKR0zbcECjFDFMCplDFCneY7HbeLEOPga6+Ao3T5eWpurnCuX2+/fynxgsdD\nFEDqiPAtxgBTfvh3qHTrBtf1iUEhmHbGN3uyGQ2iY9vyAHE2JKfKq49oWiOD\njK+1Z6aeqPmsnxdkHbc7BHf5/7/tHAQneFY474id3Mu/7X/JcvWdCg9C9+FQ\n36dsKVmPXfAbbUlCnfGa4E7GApB0zjjZeG/DdiqbY4RBPIwVW3sGbM9SYu6D\na3XNR9NZqJyKqHDb2Pagy/hxzQ85o4X14XTGZyAqD24Wpa6x1/5d3yx+Zq/R\nJCiO\r\n=h2tW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD/nIwqswYReRy7a68VjGelGW78AWEtVaOwRW0tRlsc+wIgEtOCRBxQxNAfBJMuDfbMafmi7QglzcXl6qqSzNiWHII="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_2.0.0_1620409332955_0.25855329262933857"},"_hasShrinkwrap":false},"2.0.1":{"name":"http-proxy-middleware","version":"2.0.1","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","precoverage":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","prepare":"husky install && yarn build && rm dist/tsconfig.tsbuildinfo"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"^12.1.4","@commitlint/config-conventional":"^12.1.4","@types/express":"4.17.7","@types/is-glob":"^4.0.1","@types/jest":"^26.0.23","@types/micromatch":"^4.0.1","@types/node":"^15.6.2","@types/supertest":"^2.0.11","@types/ws":"^7.4.4","@typescript-eslint/eslint-plugin":"^4.26.0","@typescript-eslint/parser":"^4.26.0","body-parser":"^1.19.0","browser-sync":"^2.26.14","connect":"^3.7.0","eslint":"^7.27.0","eslint-config-prettier":"^8.3.0","eslint-plugin-prettier":"^3.4.0","express":"^4.17.1","get-port":"^5.1.1","husky":"^6.0.0","jest":"^27.0.3","lint-staged":"^11.0.0","mockttp":"^1.2.2","open":"^8.2.0","prettier":"^2.3.0","supertest":"^6.1.3","ts-jest":"^27.0.2","typescript":"^4.3.2","ws":"^7.4.6"},"dependencies":{"@types/http-proxy":"^1.17.5","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"engines":{"node":">=12.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"c9bec81e82664809c816250f15d30543c4447571","_id":"http-proxy-middleware@2.0.1","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-cfaXRVoZxSed/BmkA7SwBVNI9Kj7HFltaE5rqYOub5kWzWZ+gofV2koVN1j2rMW7pEfSSlCHGJ31xmuyFyfLOg==","shasum":"7ef3417a479fb7666a571e09966c66a39bd2c15f","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.1.tgz","fileCount":31,"unpackedSize":63577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3ifYCRA9TVsSAnZWagAAm2sP/2buHJAe6SVUF4OfYHB4\nL0dbqdk0VjTeVwPUzU0XRdpGdZWPs7zGxMpXYqKtCx5alNAe/eTqlUj5r/Bm\nh3tFtJaa49L96cIkJSvOBPRHIEemIQC5thcm9/3Ptoh+I2lKz/RPox0aEpU+\nou4EYJj9ZV1WIRz8rDNY8YMP+m4A5DCTHuye7A9D6UZA1gz4+JJ3rt8ZFf+B\nSDHWXjg9TQG8qbn/c/WB7rljJbRl1BApxbacCqbxbWQRO8EJNgq+Nlc7AqZa\nE6EoxEwO6Usct4EmONUbM3jKlEXabeKWmezLFn/bl8jVmHCK/SkfA4Fd5Uqt\neyRA1BHqBEwS/bQ4dV7jEwBF5g+/4DwiwQ2sunwkWcLFUQ0ZX0ZMdY9H3e24\np57c3nyx0bzL9mvz14Ab7blbBIb+3WBeSBexz9C8v3Iqo9o+qhhy9r7AmlZt\n++NGWPxxlZRgEzo4CTkn1A2G8mBN4usMeWCa2DQ92cH+Uta90pPT43nzHSoQ\nXHQwRpbl8qR04lBFiiyEzH99G5Sh/b+YDVZElDiFrm63donxipfPQiGSjyyX\nTWXe/O0cCPM+defp6pz6+1WOuHC9OwXv/23ZNwf7wDiXzjGebz6GktRn3WVQ\nLzDLYrT6TnH1jJTzow3S8qxy0Zt+1qItinv5Pr8tXcvUgLlQDefPQQ1qDBKL\nc6Zc\r\n=Fxbo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFewngKmPe3A52p88ydpCxBQoTGNTRAF/g1Fzur/HALkAiEArEs5MHcKrOYyoH8SWgCbXdx0leOOj9UwWxdqrD4FS8o="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_2.0.1_1625171927546_0.8719886279600941"},"_hasShrinkwrap":false},"2.0.2":{"name":"http-proxy-middleware","version":"2.0.2","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","precoverage":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","prepare":"husky install","prepack":"yarn build && rm dist/tsconfig.tsbuildinfo","spellcheck":"npx --yes cspell --show-context --show-suggestions '**/*.*'"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"16.1.0","@commitlint/config-conventional":"16.0.0","@types/express":"4.17.13","@types/is-glob":"4.0.2","@types/jest":"27.4.0","@types/micromatch":"4.0.2","@types/node":"17.0.10","@types/supertest":"2.0.11","@types/ws":"8.2.2","@typescript-eslint/eslint-plugin":"5.10.0","@typescript-eslint/parser":"5.10.0","body-parser":"1.19.1","browser-sync":"2.27.7","connect":"3.7.0","eslint":"8.7.0","eslint-config-prettier":"8.3.0","eslint-plugin-prettier":"4.0.0","express":"4.17.2","get-port":"5.1.1","husky":"7.0.4","jest":"27.4.7","lint-staged":"12.2.2","mockttp":"2.5.1","open":"8.4.0","prettier":"2.5.1","supertest":"6.2.2","ts-jest":"27.1.3","typescript":"4.5.5","ws":"8.4.2"},"dependencies":{"@types/http-proxy":"^1.17.8","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"peerDependencies":{"@types/express":"^4.17.13"},"engines":{"node":">=12.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"d7623983e18f0daa724a3fcc0b5d4d1812e4c3c1","_id":"http-proxy-middleware@2.0.2","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-XtmDN5w+vdFTBZaYhdJAbMqn0DP/EhkUaAeo963mojwpKMMbw6nivtFKw07D7DDOH745L5k0VL0P8KRYNEVF/g==","shasum":"94d7593790aad6b3de48164f13792262f656c332","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.2.tgz","fileCount":31,"unpackedSize":63545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh7ZMkCRA9TVsSAnZWagAAZxQP/2KyaQW5CU4vi7ixE8a6\nL/eH3et4SozmSCksMqekjzRfg0hF3MWNXjrBd4f8eGDFPwFZnmH9b/BkjMi+\nw0t7FNYt+BbnaejmO7oNb5r2m1mfrHCG6URS2Jlk5xaaBI7WyMR8Tr0GwNVs\nZ/1L93VhrePCkGB67BsXDIWNDHgPkljS6naVsDi+URk2g/2xSA496sDCM68+\nO0oNKbJ1Mzdt0mok2vtNQkIAtQEhW2iyVP9qXYpZ7yHguNdAEr4V8j6JGyS9\noA5NODs8NBJJbk2Jcmh7YxVHTd6SYqS4PjqRcO/Mm+qEqWVJXbQWKWQe5W0+\nZqJiR+AQMJ7VJYvD7fcpFtIfPEn/Z0MmVnaYh8zKB1KPiYU7OSdhCla7ENj6\nFQ8/c2S8f8YbADwb8W0WzbeilRg1yk9kXljJ/foub8Hq+k+VdC1sfSgHnHl1\nwiXXG51neTv49I/gwRafP+AS69dwPFMoGE8+oQbyM58GErE+Il5iwzwRmNzS\nKWoC9EnNpaFIP7cYsZrf9G11w1ketZRyKHhQPlRfp4oYZXRQZJHRwtlEILO6\ntXQYzHsWpR1BozbCwbL3n+S18/8B3D+shO9EwOlYbBIhLClhxTjxcbeCxyaw\nP/zPEfjYSgpYEPLRerVzQps3jzI7eAAbViCJLKSnWMsUktfROLyF2ldTFRiE\nsmRe\r\n=qgz0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDe6/QBqos20wnw3ZPMs4H8zXbbctRGFtzceX5MUjGvnQIhAMVOXeT8k1aqOLQG740IHrC6Wy5bPYFSBfs9j6ltSmX4"}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_2.0.2_1642959652279_0.3210450462154557"},"_hasShrinkwrap":false},"2.0.3":{"name":"http-proxy-middleware","version":"2.0.3","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","precoverage":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","prepare":"husky install","prepack":"yarn build && rm dist/tsconfig.tsbuildinfo","spellcheck":"npx --yes cspell --show-context --show-suggestions '**/*.*'"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"16.1.0","@commitlint/config-conventional":"16.0.0","@types/express":"4.17.13","@types/is-glob":"4.0.2","@types/jest":"27.4.0","@types/micromatch":"4.0.2","@types/node":"17.0.10","@types/supertest":"2.0.11","@types/ws":"8.2.2","@typescript-eslint/eslint-plugin":"5.10.0","@typescript-eslint/parser":"5.10.0","body-parser":"1.19.1","browser-sync":"2.27.7","connect":"3.7.0","eslint":"8.7.0","eslint-config-prettier":"8.3.0","eslint-plugin-prettier":"4.0.0","express":"4.17.2","get-port":"5.1.1","husky":"7.0.4","jest":"27.4.7","lint-staged":"12.2.2","mockttp":"2.5.1","open":"8.4.0","prettier":"2.5.1","supertest":"6.2.2","ts-jest":"27.1.3","typescript":"4.5.5","ws":"8.4.2"},"dependencies":{"@types/http-proxy":"^1.17.8","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"peerDependencies":{"@types/express":"^4.17.13"},"peerDependenciesMeta":{"@types/express":{"optional":true}},"engines":{"node":">=12.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"cb466286e83782e868df966cd687a656df7a91f2","_id":"http-proxy-middleware@2.0.3","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-1bloEwnrHMnCoO/Gcwbz7eSVvW50KPES01PecpagI+YLNLci4AcuKJrujW4Mc3sBLpFxMSlsLNHS5Nl/lvrTPA==","shasum":"5df04f69a89f530c2284cd71eeaa51ba52243289","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.3.tgz","fileCount":31,"unpackedSize":63631,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAWhpCRA9TVsSAnZWagAAGYIQAKSUwbyTtSt9gu8gDF4c\nWlwjTnIkozSos6FhysFQ7LMxyEGvpL7ur1EOmcpJTXLlwA1UgK7WF7e3qAKu\nWguLJzy9yIIO0NeHmaEi0V0GEnmCzLw0/k6+SCUpX/G1nqRkZWZUKD7Hg3K9\nBHKAqBh87+Co+mgg16FQo566HX1zy8zNg0P1k/8biX0RfQ26l19iknTqwr7i\n+lEzms27GTBd05l4NOn2NlfXt2cNJQ6rgGkHKp+1DHG43rWEsyWYVqzuCXKY\nwuGXiW3TDJioPIpviFA2GyhuffKg5tnBlC7A3zT7XxDKFUDIprgm5KgdvQSn\nxbsyBuGoc5/I7meurrEVY5TLgJ2FKT0JN4MUs2pMXNV1j9r0PZHKlIP/tWiR\nUf9rsxoIU5fjbCX66KhaiIwd31FvkFUmdN/ni/Pgw4U0+mszuv3YVWJ/ucxA\nMHpbzYAbvNC2ZUadXvjBsSxkhoCG2uEWnvdwk3iub94vVt0CHeuoJvADi6fu\nsOAqWAkMAFj56Y3WMfTk4vkKZJlODN/rDikQ11ILVaBwaXtcMHQ1I5U0AxSV\nOTSIWCU30qB+2j6axa+sMEy3jVo6tkHTaDK3u9LOhqQbikCJs03FRyrXK9r3\nhWWqD9I+6xIch96OI6TVuKFMAzJOxmU2jVFM5n0C/8iUKYcev+S/72qad5Wz\nlCng\r\n=sw4P\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFAYyJORCUVTMQBhgXnK+4/LKW1P1eVzWPfV9of9bYIAAiEAuxqyGAh4q98vQp48IBHznQOXe+52VW6qRdoJZU5fSOA="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_2.0.3_1644259433216_0.9231869791531417"},"_hasShrinkwrap":false},"2.0.4":{"name":"http-proxy-middleware","version":"2.0.4","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","precoverage":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","prepare":"husky install","prepack":"yarn build && rm dist/tsconfig.tsbuildinfo","spellcheck":"npx --yes cspell --show-context --show-suggestions '**/*.*'"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"16.2.1","@commitlint/config-conventional":"16.2.1","@types/express":"4.17.13","@types/is-glob":"4.0.2","@types/jest":"27.4.0","@types/micromatch":"4.0.2","@types/node":"17.0.18","@types/supertest":"2.0.11","@types/ws":"8.2.2","@typescript-eslint/eslint-plugin":"5.12.0","@typescript-eslint/parser":"5.12.0","body-parser":"1.19.2","browser-sync":"2.27.7","connect":"3.7.0","eslint":"8.9.0","eslint-config-prettier":"8.3.0","eslint-plugin-prettier":"4.0.0","express":"4.17.3","get-port":"5.1.1","husky":"7.0.4","jest":"27.5.1","lint-staged":"12.3.4","mockttp":"2.6.0","open":"8.4.0","prettier":"2.5.1","supertest":"6.2.2","ts-jest":"27.1.3","typescript":"4.5.5","ws":"8.5.0"},"dependencies":{"@types/http-proxy":"^1.17.8","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"peerDependencies":{"@types/express":"^4.17.13"},"peerDependenciesMeta":{"@types/express":{"optional":true}},"engines":{"node":">=12.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"4baae769e46914299240d4c3ddd59019ba1520bd","_id":"http-proxy-middleware@2.0.4","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-m/4FxX17SUvz4lJ5WPXOHDUuCwIqXLfLHs1s0uZ3oYjhoXlx9csYxaOa0ElDEJ+h8Q4iJ1s+lTMbiCa4EXIJqg==","shasum":"03af0f4676d172ae775cb5c33f592f40e1a4e07a","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.4.tgz","fileCount":31,"unpackedSize":63632,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiLhb5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYPQ//YRbty7EiqQ0kRt12fK28d0IRw8Sf8GpYRjpO8iwu1xEY2WcK\r\nrY5EpmTUPCJSEW0nIuqMPr/xGR/z0wQlFKRCEpBkRgULbifSYb54nIzq+ONI\r\nHgY14itq9RndfvFZA5aeAbLhAGwnf/ORSTcMEXSBgwjDjY/r+apJkUyk10Mk\r\nPJ0NuuRE+6lDgV/Uo1eTacDB8/PpKKPM4idgohmvaOb6OqTVvPk4tLCbLV5u\r\nKl3fjN30vPfQMTZe6rkW6Ui+VpAY2jek73KsBTobGeQhqeHfIS97NAzYeQfu\r\naLplRlZ2DwTw0DoMLrtQEztyvVARm6/RQixFNrr4UHgCG8qss4OtgaMaKKb2\r\ntY9QdcP44C6wxLQACCKZggzqwiSC/x2WnG3MDsHYCPfNfMalhbePL84MD5yj\r\nYu+6JFERsJAd7yHHuOSoEZr8Y9pooUhCaOQr/uejtO3hK5NjaTpnjS+KmDyb\r\nsasQzlT3X0kWQ6TN333PZz6N7O/58sKKwuhEH7lmKzCfUWk8HHpg8y++UhNL\r\naHIvva+gyK8cqGFHfP9amTP+/Gb6qHYMje5/nJ4pFuZkNdr67KmNpSp7fyGn\r\n5UwFwtX9PIQKZZ2uAL4Q2nM9aM0k4gO/WeRJUHezXtR43H5qicM7ed2TPOVU\r\nN6J3/h8i1mLkAfVw86JFmvZ5PjPTFq4j1E8=\r\n=Jk0K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCfTb3Q0dnp1YJdF0k5T2j2z6/ZvGZWBlG3BuUHizp/CgIgQsuUKgiB2j/otYOe1pEHJ8DQMxplHiAvQC41lzLzA0E="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_2.0.4_1647187705261_0.3380553179156407"},"_hasShrinkwrap":false},"2.0.5":{"name":"http-proxy-middleware","version":"2.0.5","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","precoverage":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","prepare":"husky install","prepack":"yarn build && rm dist/tsconfig.tsbuildinfo","spellcheck":"npx --yes cspell --show-context --show-suggestions '**/*.*'"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"16.2.1","@commitlint/config-conventional":"16.2.1","@types/express":"4.17.13","@types/is-glob":"4.0.2","@types/jest":"27.4.0","@types/micromatch":"4.0.2","@types/node":"17.0.18","@types/supertest":"2.0.11","@types/ws":"8.2.2","@typescript-eslint/eslint-plugin":"5.12.0","@typescript-eslint/parser":"5.12.0","body-parser":"1.19.2","browser-sync":"2.27.7","connect":"3.7.0","eslint":"8.9.0","eslint-config-prettier":"8.3.0","eslint-plugin-prettier":"4.0.0","express":"4.17.3","get-port":"5.1.1","husky":"7.0.4","jest":"27.5.1","lint-staged":"12.3.4","mockttp":"2.6.0","open":"8.4.0","prettier":"2.5.1","supertest":"6.2.2","ts-jest":"27.1.3","typescript":"4.5.5","ws":"8.5.0"},"dependencies":{"@types/http-proxy":"^1.17.8","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"peerDependencies":{"@types/express":"^4.17.13"},"peerDependenciesMeta":{"@types/express":{"optional":true}},"engines":{"node":">=12.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"f64c99489526c355a96f6e32709da9299175d4e9","_id":"http-proxy-middleware@2.0.5","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-ORErEaxkjyrhifofwCuQttHPUSestLtiPDwV0qQOFB0ww6695H953wIGRnkakw1K+GAP+t8/RPbfDB75RFL4Fg==","shasum":"2d12fb41a414889372643a1f54279a2f6470aa93","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.5.tgz","fileCount":31,"unpackedSize":63747,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF8RiHCIsMxiBClZWmvPGTOBAPAS6FaVP7zeeNYuy5LZAiEAxwWBmRiEO/AUAANXjXYvFsxCFL9Pivw2kSa4/GCK1UY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiXxscACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqneg//bDbeSMMoeq1V6iKa7Jf2LB+6XUK+kS0bkI6QsE9QjYkmJG+L\r\nLaFNxDdYN7qCc9PhjwDugYG/Q7560IK559C+BtRxLjK7y8+JlJZzsPaMQ5vA\r\n2SjWVkM0t3OGWcrnvSIW8XbePu5Dp1O/d8CRTVX8t2yD89aB8SJ/4YJK1lpb\r\nPPx94tJOzi1ZacYcTwp57lOm87yb0Yd9xEyYe8XB+Q6m3P7sTe/v9IiW5vQT\r\ny1Ws1nCYtVAfbltytKuxuV6DE/B5kHqlM9RhASVw8YVg3NI/J9ygQTwIRWXT\r\nMxVOx0XPUTcWbgyRstmtbQWND2MheqLQ9HiCl6noO/LknSyl+6GCWM3ew8Nh\r\n9M+pWP09T8/b6MkHPxWR+EEACGpzHffcCoBcUHyWiMNwAMgDxG0nbG7b7G+h\r\n0INqt86q6Pca65K9ylAEIHSdilngBZdtb+BAuSDo0LYXGvYchdikHMBp12bF\r\nKYgRo6yAKQFnNT1Qzu/IMIHDwAqtJsJkwt9XdYMwUqLdH2WwZ0lO5LhOgzd3\r\nmyKbJDd+nFQURuvMRSjRwx6AQFKF9HDdugxBvEjsHVIiNcWKVHo5ujiuzDgE\r\nHgMi43GiIsLMbhsQ/fJ/GxSuyHdcZ+0gj5gtneT8pYKA2qwe//KxO9eZY6YQ\r\nio50Uh24bdALzbiAfu+lkLsNeINVedcfUfI=\r\n=0Ygv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_2.0.5_1650400028711_0.6740282828661031"},"_hasShrinkwrap":false},"2.0.6":{"name":"http-proxy-middleware","version":"2.0.6","description":"The one-liner node.js proxy middleware for connect, express and browser-sync","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","precoverage":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","prepare":"husky install","prepack":"yarn build && rm dist/tsconfig.tsbuildinfo","spellcheck":"npx --yes cspell --show-context --show-suggestions '**/*.*'"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"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","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"16.2.1","@commitlint/config-conventional":"16.2.1","@types/express":"4.17.13","@types/is-glob":"4.0.2","@types/jest":"27.4.0","@types/micromatch":"4.0.2","@types/node":"17.0.18","@types/supertest":"2.0.11","@types/ws":"8.2.2","@typescript-eslint/eslint-plugin":"5.12.0","@typescript-eslint/parser":"5.12.0","body-parser":"1.19.2","browser-sync":"2.27.7","connect":"3.7.0","eslint":"8.9.0","eslint-config-prettier":"8.3.0","eslint-plugin-prettier":"4.0.0","express":"4.17.3","get-port":"5.1.1","husky":"7.0.4","jest":"27.5.1","lint-staged":"12.3.4","mockttp":"2.6.0","open":"8.4.0","prettier":"2.5.1","supertest":"6.2.2","ts-jest":"27.1.3","typescript":"4.5.5","ws":"8.5.0"},"dependencies":{"@types/http-proxy":"^1.17.8","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.2"},"peerDependencies":{"@types/express":"^4.17.13"},"peerDependenciesMeta":{"@types/express":{"optional":true}},"engines":{"node":">=12.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"c08cb1e13b8d8c63b517953156444c9b1ce140eb","_id":"http-proxy-middleware@2.0.6","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==","shasum":"e1a4dd6979572c7ab5a4e4b55095d1f32a74963f","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz","fileCount":31,"unpackedSize":64098,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCw9fMaCXaW6JpS8/2MxFduaA4Ivd8IL5Fza+LqXFyklwIgHerwifxrhEySVdRMNDCt1/30mw1n4ZXqfubdOgm6Dlc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYGVqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqUxAAgQLJ61hEAL1oHBUu3UQVE3xpZZPWVuD7PuERZAPESdgxJFxX\r\nrCQNE2gnFxOn/JbIKp2q8lAcgd4AKlmS9z3jBsvpzxeZxL6YAHumxiazjgpp\r\nXpfgfQevXxdPvnNUEDt0qFuC0NymCsJ3UrZrg4fD5iXAthFNKEk3tmKZkPdP\r\nc4nFmoXOO2xdBCjKMKnGv/4ZMVJEU6PAf5hnjPL+8y607OCHE5iyZDGM9VxC\r\nFZrexoM/f92an/jpzwnYgwBSD86GZT6E04P5JfFadQy8FUBNMtZhmlyIwF3Z\r\nBifRfV+dmw4NyATJtFja+7XNeQgONbfhpTykJBbTkX5c7uThER7sGYmRl9T8\r\n0lFM4IntkFhAYnUM4ltyjzoBZUWet3VFgSO4ZF1HnWaRv4b2RNlpOyMRVYD9\r\nX7gZNN3zZhsXr3jeMi1pHmS5iGuxPBc2xRoJNk+SLj0w+VZFpyCqF55O0I7J\r\n4cI+CgDYz1j2QzQOxQD9m7idyzVquGKMeQ0qNv0jEABCBqyzPXIhEYPmNb04\r\nClRtzmQAHao9cue8jJqF6lz1r6AydmTvC1qb3NK7tgSxwQcNQik9vtqI2OtQ\r\ns+rXzhTWTqss4SSc4FRU+nqXkid1LCxRhd91Kunf+svA7ljKYzsJd4cLgx98\r\ne8F0Mry9yJjDOISV6cBmk5Uly2mBIopuW94=\r\n=u+Su\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_2.0.6_1650484586443_0.2991231248524864"},"_hasShrinkwrap":false},"3.0.0-beta.0":{"name":"http-proxy-middleware","version":"3.0.0-beta.0","description":"The one-liner node.js proxy middleware for connect, express, next.js and more","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist && rm -rf coverage","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts'","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","prebuild":"yarn clean","build":"tsc","pretest":"yarn build","test":"jest","precoverage":"yarn build","coverage":"jest --coverage --coverageReporters=lcov","prepare":"husky install","prepack":"yarn build && rm dist/tsconfig.tsbuildinfo","spellcheck":"npx --yes cspell --show-context --show-suggestions '**/*.*'"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","next.js","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"16.2.3","@commitlint/config-conventional":"16.2.1","@types/debug":"4.1.7","@types/express":"4.17.13","@types/is-glob":"4.0.2","@types/jest":"27.4.1","@types/micromatch":"4.0.2","@types/node":"17.0.25","@types/supertest":"2.0.12","@types/ws":"8.5.3","@typescript-eslint/eslint-plugin":"5.20.0","@typescript-eslint/parser":"5.20.0","body-parser":"1.20.0","browser-sync":"2.27.9","connect":"3.7.0","eslint":"8.13.0","eslint-config-prettier":"8.5.0","eslint-plugin-prettier":"4.0.0","express":"4.17.3","get-port":"5.1.1","husky":"7.0.4","jest":"27.5.1","lint-staged":"12.3.8","mockttp":"2.7.0","open":"8.4.0","prettier":"2.6.2","supertest":"6.2.2","ts-jest":"27.1.4","typescript":"4.6.3","ws":"8.5.0"},"dependencies":{"@types/http-proxy":"^1.17.8","debug":"^4.3.4","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.5"},"peerDependencies":{"@types/express":"^4.17.13"},"peerDependenciesMeta":{"@types/express":{"optional":true}},"resolutions":{"browser-sync/portscanner":"2.2.0"},"engines":{"node":">=12.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"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://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/expressjs/express), [next.js](https://github.com/vercel/next.js) 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 <!-- omit in toc -->\n\nThis page is showing documentation for version v3.x.x ([release notes](https://github.com/chimurai/http-proxy-middleware/releases))\n\nSee [MIGRATION.md](https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md) for details on how to migrate from v2.x.x to v3.x.x\n\nIf you're looking for older documentation. Go to:\n\n- <https://github.com/chimurai/http-proxy-middleware/tree/v2.0.4#readme>\n- <https://github.com/chimurai/http-proxy-middleware/tree/v0.21.0#readme>\n\n## TL;DR <!-- omit in toc -->\n\nProxy `/api` requests to `http://www.example.org`\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```javascript\n// javascript\n\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst app = express();\n\napp.use(\n  '/api',\n  createProxyMiddleware({\n    target: 'http://www.example.org/secret',\n    changeOrigin: true,\n  })\n);\n\napp.listen(3000);\n\n// proxy and change the base path from \"/api\" to \"/secret\"\n// http://localhost:3000/api/foo/bar -> http://www.example.org/secret/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(\n  '/api',\n  createProxyMiddleware({\n    target: 'http://www.example.org/api',\n    changeOrigin: true,\n  })\n);\n\napp.listen(3000);\n\n// proxy and keep the same base path \"/api\"\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## Table of Contents <!-- omit in toc -->\n\n<!-- // spell-checker:disable -->\n\n- [Install](#install)\n- [Basic usage](#basic-usage)\n- [Express Server Example](#express-server-example)\n  - [app.use(path, proxy)](#appusepath-proxy)\n- [Options](#options)\n  - [`pathFilter` (string, []string, glob, []glob, function)](#pathfilter-string-string-glob-glob-function)\n  - [`pathRewrite` (object/function)](#pathrewrite-objectfunction)\n  - [`router` (object/function)](#router-objectfunction)\n  - [`plugins` (Array)](#plugins-array)\n  - [`ejectPlugins` (boolean) default: `false`](#ejectplugins-boolean-default-false)\n  - [`logger` (Object)](#logger-object)\n- [`http-proxy` events](#http-proxy-events)\n- [`http-proxy` options](#http-proxy-options)\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- [Debugging](#debugging)\n- [Working examples](#working-examples)\n- [Recipes](#recipes)\n- [Compatible servers](#compatible-servers)\n- [Tests](#tests)\n- [Changelog](#changelog)\n- [License](#license)\n\n<!-- // spell-checker:enable -->\n\n## Install\n\n```shell\nnpm install --save-dev http-proxy-middleware\n```\n\n## Basic usage\n\nCreate and configure a proxy middleware with: `createProxyMiddleware(config)`.\n\n```javascript\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst apiProxy = createProxyMiddleware({\n  target: 'http://www.example.org',\n  changeOrigin: true,\n});\n\n// 'apiProxy' is now ready to be used as middleware in a server.\n```\n\n- **options.target**: target host to proxy to. _(protocol + host)_\n- **options.changeOrigin**: for virtual hosted sites\n\n- see full list of [`http-proxy-middleware` configuration options](#options)\n\n## Express Server Example\n\nAn example with `express` server.\n\n```javascript\n// include dependencies\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst app = express();\n\n// proxy middleware options\n/** @type {import('http-proxy-middleware/dist/types').Options} */\nconst options = {\n  target: 'http://www.example.org/api', // target host with the same base path\n  changeOrigin: true, // needed for virtual hosted sites\n};\n\n// create the proxy\nconst exampleProxy = createProxyMiddleware(options);\n\n// mount `exampleProxy` in web server\napp.use('/api', exampleProxy);\napp.listen(3000);\n```\n\n### app.use(path, proxy)\n\nIf you want to use the server's `app.use` `path` parameter to match requests.\nUse `pathFilter` option to further include/exclude requests which you want to proxy.\n\n```javascript\napp.use(\n  createProxyMiddleware({\n    target: 'http://www.example.org/api',\n    changeOrigin: true,\n    pathFilter: '/api/proxy-only-this-path',\n  })\n);\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## Options\n\nhttp-proxy-middleware options:\n\n### `pathFilter` (string, []string, glob, []glob, function)\n\nNarrow down which requests should be proxied. The `path` used for filtering is the `request.url` pathname. In Express, this is the `path` relative to the mount-point of the proxy.\n\n- **path matching**\n\n  - `createProxyMiddleware({...})` - matches any path, all requests will be proxied when `pathFilter` is not configured.\n  - `createProxyMiddleware({ pathFilter: '/api', ...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `createProxyMiddleware({ pathFilter: ['/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({ pathFilter: '**', ...})` matches any path, all requests will be proxied.\n  - `createProxyMiddleware({ pathFilter: '**/*.html', ...})` matches any path which ends with `.html`\n  - `createProxyMiddleware({ pathFilter: '/*.html', ...})` matches paths directly under path-absolute\n  - `createProxyMiddleware({ pathFilter: '/api/**/*.html', ...})` matches requests ending with `.html` in the path of `/api`\n  - `createProxyMiddleware({ pathFilter: ['/api/**', '/ajax/**'], ...})` combine multiple patterns\n  - `createProxyMiddleware({ pathFilter: ['/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 pathFilter = function (path, req) {\n    return path.match('^/api') && req.method === 'GET';\n  };\n\n  const apiProxy = createProxyMiddleware({\n    target: 'http://www.example.org',\n    pathFilter: pathFilter,\n  });\n  ```\n\n### `pathRewrite` (object/function)\n\nRewrite target's url path. Object-keys will be used as _RegExp_ to match paths.\n\n```javascript\n// rewrite path\npathRewrite: {'^/old/api' : '/new/api'}\n\n// remove path\npathRewrite: {'^/remove/api' : ''}\n\n// add base path\npathRewrite: {'^/' : '/basepath/'}\n\n// custom rewriting\npathRewrite: function (path, req) { return path.replace('/api', '/base/api') }\n\n// custom rewriting, returning Promise\npathRewrite: 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### `router` (object/function)\n\nRe-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.\nrouter: {\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)\nrouter: function(req) {\n    return 'http://localhost:8004';\n}\n\n// Custom router function (target object)\nrouter: 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\nrouter: async function(req) {\n    const url = await doSomeIO();\n    return url;\n}\n```\n\n### `plugins` (Array)\n\n```js\nconst simpleRequestLogger = (proxyServer, options) => {\n  proxyServer.on('proxyReq', (proxyReq, req, res) => {\n    console.log(`[HPM] [${req.method}] ${req.url}`); // outputs: [HPM] GET /users\n  });\n},\n\nconst config = {\n  target: `http://example.org`,\n  changeOrigin: true,\n  plugins: [simpleRequestLogger],\n};\n```\n\n### `ejectPlugins` (boolean) default: `false`\n\nIf you're not satisfied with the pre-configured plugins, you can eject them by configuring `ejectPlugins: true`.\n\nNOTE: register your own error handlers to prevent server from crashing.\n\n```js\n// eject default plugins and manually add them back\n\nconst {\n  debugProxyErrorsPlugin, // subscribe to proxy errors to prevent server from crashing\n  loggerPlugin, // log proxy events to a logger (ie. console)\n  errorResponsePlugin, // return 5xx response on proxy error\n  proxyEventsPlugin, // implements the \"on:\" option\n} = require('http-proxy-middleware');\n\ncreateProxyMiddleware({\n  target: `http://example.org`,\n  changeOrigin: true,\n  ejectPlugins: true,\n  plugins: [debugProxyErrorsPlugin, loggerPlugin, errorResponsePlugin, proxyEventsPlugin],\n});\n```\n\n### `logger` (Object)\n\nConfigure a logger to output information from http-proxy-middleware: ie. `console`, `winston`, `pino`, `bunyan`, `log4js`, etc...\n\nOnly `info`, `warn`, `error` are used internally for compatibility across different loggers.\n\nIf you use `winston`, make sure to enable interpolation: <https://github.com/winstonjs/winston#string-interpolation>\n\nSee also logger recipes ([recipes/logger.md](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/logger.md)) for more details.\n\n```javascript\ncreateProxyMiddleware({\n  logger: console,\n});\n```\n\n## `http-proxy` events\n\nSubscribe to [http-proxy events](https://github.com/nodejitsu/node-http-proxy#listening-for-proxy-events) with the `on` option:\n\n```js\ncreateProxyMiddleware({\n  target: 'http://www.example.org',\n  on: {\n    proxyReq: (proxyReq, req, res) => {\n      /* handle proxyReq */\n    },\n    proxyRes: (proxyRes, req, res) => {\n      /* handle proxyRes */\n    },\n    error: (err, req, res) => {\n      /* handle error */\n    },\n  },\n});\n```\n\n- **option.on.error**: 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.on.proxyRes**: 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.on.proxyReq**: 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.on.proxyReqWs**: 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.on.open**: 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', hybridParseAndLogMessage);\n  }\n  ```\n\n- **option.on.close**: 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\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\n    ```json\n    cookieDomainRewrite: {\n      \"unchanged.domain\": \"unchanged.domain\",\n      \"old.domain\": \"new.domain\",\n      \"*\": \"\"\n    }\n    ```\n\n- **option.cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values:\n\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\n    ```json\n    cookiePathRewrite: {\n      \"/unchanged.path/\": \"/unchanged.path/\",\n      \"/old.path/\": \"/new.path/\",\n      \"*\": \"\"\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## WebSocket\n\n```javascript\n// verbose api\ncreateProxyMiddleware({ pathFilter: '/', target: 'http://echo.websocket.org', ws: true });\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({ target: '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  on: {\n    proxyReq: fixRequestBody,\n  },\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  on: {\n    proxyRes: 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```\n\nCheck out [interception recipes](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/response-interceptor.md#readme) for more examples.\n\n## Debugging\n\nConfigure the `DEBUG` environment variable enable debug logging.\n\nSee [`debug`](https://github.com/debug-js/debug#readme) project for more options.\n\n```shell\nDEBUG=http-proxy-middleware* node server.js\n\n$ http-proxy-middleware proxy created +0ms\n$ http-proxy-middleware proxying request to target: 'http://www.example.org' +359ms\n```\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- [next.js](https://www.npmjs.com/package/next)\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# check spelling mistakes\n$ yarn spellcheck\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-2022 Steven Chim\n","readmeFilename":"README.md","gitHead":"ce4ae3caacf2696be68dd617c8cc5021b159aaf3","_id":"http-proxy-middleware@3.0.0-beta.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-99DWW7XRJdLGkVKkXh7sOP1adeSMss2wzI6qAI7klyishj/E8/I+EgtvPuFsSdZ+zDy2D8YizF8vs31Y61Y1bA==","shasum":"4c32cd1a190ec3c5d4e255b88c267ef47de0ec32","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.0-beta.0.tgz","fileCount":57,"unpackedSize":76518,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPkMwthqeSBB1eThVDlzMB82lFNjCr5AKpLlJHoZN24AiB79K3C/hSXY3MaoMf2cpM9EAv/pVV6k8adcUi4bUoWAA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYuhtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrjzhAAjYNSSp4oNf3DtOiHWKXYxIuIAtLJdTAVTSLWs6Mq/nVLruj+\r\n2RAFg8DP5rcCq9SQg5jowcByFZDLI5QDtOHcmZ2BKN//3cfHLl0cX2PiRIfE\r\np3x+HV72uHhJNCvv5jTeuVmCUMMy8P+BV9nhVKKnJ7zUA/QKdGPsNDADqRuf\r\ndyAVOCtzH1k5fTjENjXKER1W6++WJr/KMRfdsxGW6D6ilR+D+iJ6GI+AHLjN\r\nAFRZJaa9Ul6Q4qyhivPo0TGM3m0OrLLxNQYoq0pYG6T+bpU+GsaKJq97XLDw\r\nyrRWBOCV2M/rZPc/zrKoZUfijMlqJKhvt/xzkOISj8wXnPc+AXtEqNPHpiS7\r\nONbDIbhrTUJxL/WOoTZu7Mx6xxa0Hqu7jzZU8tbmEPnCVdoLy28AymZaFjYt\r\nmII0DTnXmfdgEp2Cn3VByf9/krhP4dRsrnk7/bk9POSDNs/Aj1XpNXqqZpZu\r\nw3BCX3XyGuBY9TIx/XeFZ805JajO+lGqfsyy0TtZ/mI9p6qGNBFgFZjU6rUV\r\nNMIm06MQcrrP1m6vqlDSNDkJeqRGkY0WmmV+rPS3KiM0GVep69FtyrZ5ix2w\r\n9BpNbeGteBUbH7iuZe9qDIwhNj03HSFAmeSLriykm/njeXCaPUif9VvV1dtC\r\nXlZdXIkzhb3oYPdbQZDE03mSbGHSW30e+Fk=\r\n=au0a\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_3.0.0-beta.0_1650649197259_0.7730530193171159"},"_hasShrinkwrap":false},"3.0.0-beta.1":{"name":"http-proxy-middleware","version":"3.0.0-beta.1","description":"The one-liner node.js proxy middleware for connect, express, next.js and more","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist coverage tsconfig.tsbuildinfo .eslintcache","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts' --cache","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc --build","test":"jest","coverage":"jest --coverage","prepare":"husky install","prepack":"yarn clean && yarn test && yarn build","spellcheck":"npx --yes cspell --show-context --show-suggestions '**/*.*'"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","next.js","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"17.4.4","@commitlint/config-conventional":"17.4.4","@types/debug":"4.1.7","@types/express":"4.17.17","@types/is-glob":"4.0.2","@types/jest":"29.4.0","@types/micromatch":"4.0.2","@types/node":"18.14.5","@types/supertest":"2.0.12","@types/ws":"8.5.4","@typescript-eslint/eslint-plugin":"5.54.0","@typescript-eslint/parser":"5.54.0","body-parser":"1.20.2","browser-sync":"2.28.1","connect":"3.7.0","eslint":"8.35.0","eslint-config-prettier":"8.6.0","eslint-plugin-prettier":"4.2.1","express":"4.18.2","get-port":"5.1.1","husky":"8.0.3","jest":"29.4.3","lint-staged":"13.1.2","mockttp":"3.7.0","open":"8.4.2","prettier":"2.8.4","supertest":"6.3.3","ts-jest":"29.0.5","typescript":"4.9.5","ws":"8.12.1"},"dependencies":{"@types/http-proxy":"^1.17.10","debug":"^4.3.4","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.5"},"engines":{"node":">=12.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"readme":"# http-proxy-middleware\n\n[![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/chimurai/http-proxy-middleware/ci.yml?branch=master&logo=github-actions&logoColor=white&style=flat-square)](https://github.com/chimurai/http-proxy-middleware/actions/workflows/ci.yml?query=branch%3Amaster)\n[![Coveralls](https://img.shields.io/coveralls/chimurai/http-proxy-middleware.svg?style=flat-square&logo=coveralls)](https://coveralls.io/r/chimurai/http-proxy-middleware)\n[![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/chimurai/http-proxy-middleware?logo=snyk&style=flat-square)](https://security.snyk.io/package/npm/http-proxy-middleware)\n[![npm](https://img.shields.io/npm/v/http-proxy-middleware?color=%23CC3534&style=flat-square&logo=npm)](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/expressjs/express), [next.js](https://github.com/vercel/next.js) and [many more](#compatible-servers).\n\nPowered by the popular Nodejitsu [`http-proxy`](https://github.com/http-party/node-http-proxy). [![GitHub stars](https://img.shields.io/github/stars/http-party/node-http-proxy.svg?style=social&label=Star)](https://github.com/http-party/node-http-proxy)\n\n## ⚠️ Note <!-- omit in toc -->\n\nThis page is showing documentation for version v3.x.x ([release notes](https://github.com/chimurai/http-proxy-middleware/releases))\n\nSee [MIGRATION.md](https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md) for details on how to migrate from v2.x.x to v3.x.x\n\nIf you're looking for older documentation. Go to:\n\n- <https://github.com/chimurai/http-proxy-middleware/tree/v2.0.4#readme>\n- <https://github.com/chimurai/http-proxy-middleware/tree/v0.21.0#readme>\n\n## TL;DR <!-- omit in toc -->\n\nProxy `/api` requests to `http://www.example.org`\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```javascript\n// javascript\n\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst app = express();\n\napp.use(\n  '/api',\n  createProxyMiddleware({\n    target: 'http://www.example.org/secret',\n    changeOrigin: true,\n  })\n);\n\napp.listen(3000);\n\n// proxy and change the base path from \"/api\" to \"/secret\"\n// http://127.0.0.1:3000/api/foo/bar -> http://www.example.org/secret/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(\n  '/api',\n  createProxyMiddleware({\n    target: 'http://www.example.org/api',\n    changeOrigin: true,\n  })\n);\n\napp.listen(3000);\n\n// proxy and keep the same base path \"/api\"\n// http://127.0.0.1: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## Table of Contents <!-- omit in toc -->\n\n<!-- // spell-checker:disable -->\n\n- [Install](#install)\n- [Basic usage](#basic-usage)\n- [Express Server Example](#express-server-example)\n  - [app.use(path, proxy)](#appusepath-proxy)\n- [Options](#options)\n  - [`pathFilter` (string, \\[\\]string, glob, \\[\\]glob, function)](#pathfilter-string-string-glob-glob-function)\n  - [`pathRewrite` (object/function)](#pathrewrite-objectfunction)\n  - [`router` (object/function)](#router-objectfunction)\n  - [`plugins` (Array)](#plugins-array)\n  - [`ejectPlugins` (boolean) default: `false`](#ejectplugins-boolean-default-false)\n  - [`logger` (Object)](#logger-object)\n- [`http-proxy` events](#http-proxy-events)\n- [`http-proxy` options](#http-proxy-options)\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- [Node.js 17+: ECONNREFUSED issue with IPv6 and localhost (#705)](#nodejs-17-econnrefused-issue-with-ipv6-and-localhost-705)\n- [Debugging](#debugging)\n- [Working examples](#working-examples)\n- [Recipes](#recipes)\n- [Compatible servers](#compatible-servers)\n- [Tests](#tests)\n- [Changelog](#changelog)\n- [License](#license)\n\n<!-- // spell-checker:enable -->\n\n## Install\n\n```shell\nnpm install --save-dev http-proxy-middleware\n```\n\n## Basic usage\n\nCreate and configure a proxy middleware with: `createProxyMiddleware(config)`.\n\n```javascript\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst apiProxy = createProxyMiddleware({\n  target: 'http://www.example.org',\n  changeOrigin: true,\n});\n\n// 'apiProxy' is now ready to be used as middleware in a server.\n```\n\n- **options.target**: target host to proxy to. _(protocol + host)_\n- **options.changeOrigin**: for virtual hosted sites\n\n- see full list of [`http-proxy-middleware` configuration options](#options)\n\n## Express Server Example\n\nAn example with `express` server.\n\n```javascript\n// include dependencies\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst app = express();\n\n// create the proxy\n/** @type {import('http-proxy-middleware/dist/types').RequestHandler<express.Request, express.Response>} */\nconst exampleProxy = createProxyMiddleware({\n  target: 'http://www.example.org/api', // target host with the same base path\n  changeOrigin: true, // needed for virtual hosted sites\n});\n\n// mount `exampleProxy` in web server\napp.use('/api', exampleProxy);\napp.listen(3000);\n```\n\n### app.use(path, proxy)\n\nIf you want to use the server's `app.use` `path` parameter to match requests.\nUse `pathFilter` option to further include/exclude requests which you want to proxy.\n\n```javascript\napp.use(\n  createProxyMiddleware({\n    target: 'http://www.example.org/api',\n    changeOrigin: true,\n    pathFilter: '/api/proxy-only-this-path',\n  })\n);\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## Options\n\nhttp-proxy-middleware options:\n\n### `pathFilter` (string, []string, glob, []glob, function)\n\nNarrow down which requests should be proxied. The `path` used for filtering is the `request.url` pathname. In Express, this is the `path` relative to the mount-point of the proxy.\n\n- **path matching**\n\n  - `createProxyMiddleware({...})` - matches any path, all requests will be proxied when `pathFilter` is not configured.\n  - `createProxyMiddleware({ pathFilter: '/api', ...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `createProxyMiddleware({ pathFilter: ['/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({ pathFilter: '**', ...})` matches any path, all requests will be proxied.\n  - `createProxyMiddleware({ pathFilter: '**/*.html', ...})` matches any path which ends with `.html`\n  - `createProxyMiddleware({ pathFilter: '/*.html', ...})` matches paths directly under path-absolute\n  - `createProxyMiddleware({ pathFilter: '/api/**/*.html', ...})` matches requests ending with `.html` in the path of `/api`\n  - `createProxyMiddleware({ pathFilter: ['/api/**', '/ajax/**'], ...})` combine multiple patterns\n  - `createProxyMiddleware({ pathFilter: ['/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 pathFilter = function (path, req) {\n    return path.match('^/api') && req.method === 'GET';\n  };\n\n  const apiProxy = createProxyMiddleware({\n    target: 'http://www.example.org',\n    pathFilter: pathFilter,\n  });\n  ```\n\n### `pathRewrite` (object/function)\n\nRewrite target's url path. Object-keys will be used as _RegExp_ to match paths.\n\n```javascript\n// rewrite path\npathRewrite: {'^/old/api' : '/new/api'}\n\n// remove path\npathRewrite: {'^/remove/api' : ''}\n\n// add base path\npathRewrite: {'^/' : '/basepath/'}\n\n// custom rewriting\npathRewrite: function (path, req) { return path.replace('/api', '/base/api') }\n\n// custom rewriting, returning Promise\npathRewrite: 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### `router` (object/function)\n\nRe-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.\nrouter: {\n    'integration.localhost:3000' : 'http://127.0.0.1:8001',  // host only\n    'staging.localhost:3000'     : 'http://127.0.0.1:8002',  // host only\n    'localhost:3000/api'         : 'http://127.0.0.1:8003',  // host + path\n    '/rest'                      : 'http://127.0.0.1:8004'   // path only\n}\n\n// Custom router function (string target)\nrouter: function(req) {\n    return 'http://127.0.0.1:8004';\n}\n\n// Custom router function (target object)\nrouter: function(req) {\n    return {\n        protocol: 'https:', // The : is required\n        host: '127.0.0.1',\n        port: 8004\n    };\n}\n\n// Asynchronous router function which returns promise\nrouter: async function(req) {\n    const url = await doSomeIO();\n    return url;\n}\n```\n\n### `plugins` (Array)\n\n```js\nconst simpleRequestLogger = (proxyServer, options) => {\n  proxyServer.on('proxyReq', (proxyReq, req, res) => {\n    console.log(`[HPM] [${req.method}] ${req.url}`); // outputs: [HPM] GET /users\n  });\n},\n\nconst config = {\n  target: `http://example.org`,\n  changeOrigin: true,\n  plugins: [simpleRequestLogger],\n};\n```\n\n### `ejectPlugins` (boolean) default: `false`\n\nIf you're not satisfied with the pre-configured plugins, you can eject them by configuring `ejectPlugins: true`.\n\nNOTE: register your own error handlers to prevent server from crashing.\n\n```js\n// eject default plugins and manually add them back\n\nconst {\n  debugProxyErrorsPlugin, // subscribe to proxy errors to prevent server from crashing\n  loggerPlugin, // log proxy events to a logger (ie. console)\n  errorResponsePlugin, // return 5xx response on proxy error\n  proxyEventsPlugin, // implements the \"on:\" option\n} = require('http-proxy-middleware');\n\ncreateProxyMiddleware({\n  target: `http://example.org`,\n  changeOrigin: true,\n  ejectPlugins: true,\n  plugins: [debugProxyErrorsPlugin, loggerPlugin, errorResponsePlugin, proxyEventsPlugin],\n});\n```\n\n### `logger` (Object)\n\nConfigure a logger to output information from http-proxy-middleware: ie. `console`, `winston`, `pino`, `bunyan`, `log4js`, etc...\n\nOnly `info`, `warn`, `error` are used internally for compatibility across different loggers.\n\nIf you use `winston`, make sure to enable interpolation: <https://github.com/winstonjs/winston#string-interpolation>\n\nSee also logger recipes ([recipes/logger.md](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/logger.md)) for more details.\n\n```javascript\ncreateProxyMiddleware({\n  logger: console,\n});\n```\n\n## `http-proxy` events\n\nSubscribe to [http-proxy events](https://github.com/nodejitsu/node-http-proxy#listening-for-proxy-events) with the `on` option:\n\n```js\ncreateProxyMiddleware({\n  target: 'http://www.example.org',\n  on: {\n    proxyReq: (proxyReq, req, res) => {\n      /* handle proxyReq */\n    },\n    proxyRes: (proxyRes, req, res) => {\n      /* handle proxyRes */\n    },\n    error: (err, req, res) => {\n      /* handle error */\n    },\n  },\n});\n```\n\n- **option.on.error**: 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.on.proxyRes**: 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.on.proxyReq**: 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.on.proxyReqWs**: 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.on.open**: 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', hybridParseAndLogMessage);\n  }\n  ```\n\n- **option.on.close**: 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\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\n    ```json\n    cookieDomainRewrite: {\n      \"unchanged.domain\": \"unchanged.domain\",\n      \"old.domain\": \"new.domain\",\n      \"*\": \"\"\n    }\n    ```\n\n- **option.cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values:\n\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\n    ```json\n    cookiePathRewrite: {\n      \"/unchanged.path/\": \"/unchanged.path/\",\n      \"/old.path/\": \"/new.path/\",\n      \"*\": \"\"\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://127.0.0.1:4003/',\n        buffer: streamify(req.rawBody),\n      },\n      next\n    );\n  };\n  ```\n\n## WebSocket\n\n```javascript\n// verbose api\ncreateProxyMiddleware({ pathFilter: '/', target: 'http://echo.websocket.org', ws: true });\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({ target: '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  on: {\n    proxyReq: fixRequestBody,\n  },\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  on: {\n    proxyRes: 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```\n\nCheck out [interception recipes](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/response-interceptor.md#readme) for more examples.\n\n## Node.js 17+: ECONNREFUSED issue with IPv6 and localhost ([#705](https://github.com/chimurai/http-proxy-middleware/issues/705))\n\nNode.js 17+ no longer prefers IPv4 over IPv6 for DNS lookups.\nE.g. It's **not** guaranteed that `localhost` will be resolved to `127.0.0.1` – it might just as well be `::1` (or some other IP address).\n\nIf your target server only accepts IPv4 connections, trying to proxy to `localhost` will fail if resolved to `::1` (IPv6).\n\nWays to solve it:\n\n- Change `target: \"http://localhost\"` to `target: \"http://127.0.0.1\"` (IPv4).\n- Change the target server to (also) accept IPv6 connections.\n- Add this flag when running `node`: `node index.js --dns-result-order=ipv4first`. (Not recommended.)\n\n> Note: There’s a thing called [Happy Eyeballs](https://en.wikipedia.org/wiki/Happy_Eyeballs) which means connecting to both IPv4 and IPv6 in parallel, which Node.js doesn’t have, but explains why for example `curl` can connect.\n\n## Debugging\n\nConfigure the `DEBUG` environment variable enable debug logging.\n\nSee [`debug`](https://github.com/debug-js/debug#readme) project for more options.\n\n```shell\nDEBUG=http-proxy-middleware* node server.js\n\n$ http-proxy-middleware proxy created +0ms\n$ http-proxy-middleware proxying request to target: 'http://www.example.org' +359ms\n```\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- [next.js](https://www.npmjs.com/package/next)\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# check spelling mistakes\n$ yarn spellcheck\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-2022 Steven Chim\n","readmeFilename":"README.md","gitHead":"47b7e018f614bcdc06f72c4fdbac3a91ba3b5bb7","_id":"http-proxy-middleware@3.0.0-beta.1","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-hdiTlVVoaxncf239csnEpG5ew2lRWnoNR1PMWOO6kYulSphlrfLs5JFZtFVH3R5EUWSZNMkeUqvkvfctuWaK8A==","shasum":"aa5800c01d3cf340eeff89bb2de381ce67a8385f","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.0-beta.1.tgz","fileCount":57,"unpackedSize":80231,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDGv+5T6QaSmSUOhVri0f7utBATMDxCClWlnAZBuv4YQAiBfgHV0NEJ56hi3WM1mPMwxoPihtvQnjTNJ90lIxgP4+g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAnTTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoIZA//apn3QT7zpJfm/VVY8TpYk+FI38u+beG9QSyPIjxNHvIxiLds\r\nTNrpqCtT6FETcDdD1TpVSdSQ2rJarymE/FRcRjsKPWUKSefaCQJqKK94gbE/\r\nXPeHWeKY/8HljOBjhyt41rFROwelBYaykBZ8R4CMm4+uls3CIuLn1Jr1JzXY\r\nYA2oF07t99Vzjqe90kavoCMOpWrMWR1ntlvooCBWV7qchA+FuWzw35A4FD68\r\nTGD++gffxBOC4AsluyqNju/6hJfTUpadntmyfDjTJUX2Pcy72EG8rb+2SJHd\r\nLsepnNNHvtUmFSYqjlbwGwCMv/5TqQgT11hwUBI3JixxmEDmwpqj10CzyRdR\r\nzW26qGgFWyaSPz8+k5y1bdvQjZAmfnDZJTWbbOUX5wMNojU4r2IJQR/LMgZM\r\n44pwHo591VJ+V8mzshQ7A50iowyWQO5nh2DmI9rahT5oGGPvRW+QSCUiyMXn\r\nmEYuoecuKd4wgD5B/zQvNjOJx/YuOn/WZWU90N4CvAWkSHe51VDPm0nNWPrY\r\nUkggr61EWvV4APEbCmxehVDpPXIGgI1hBhzjFnmI8Usl6tKYj41T/+h3mhx9\r\n6S3J1EnFo+hEGawHBeQ1VT2NyWmfYWTKWLGT/i/rscen4BK/vS9FTcTYUKbX\r\nq5fT3885lFJ6I0QPmwhxA+vz7mYkFRkK4Ro=\r\n=EcWQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_3.0.0-beta.1_1677882579310_0.21997976613152748"},"_hasShrinkwrap":false},"3.0.0":{"name":"http-proxy-middleware","version":"3.0.0","description":"The one-liner node.js proxy middleware for connect, express, next.js and more","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean":"rm -rf dist coverage tsconfig.tsbuildinfo .eslintcache","lint":"yarn prettier && yarn eslint","lint:fix":"yarn prettier:fix && yarn eslint:fix","eslint":"eslint '{src,test}/**/*.ts' --cache","eslint:fix":"yarn eslint --fix","prettier":"prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"","prettier:fix":"prettier --write \"**/*.{js,ts,md,yml,json,html}\"","build":"tsc --build","test":"jest","coverage":"jest --coverage","prepare":"husky","prepack":"yarn clean && yarn test && yarn build","spellcheck":"npx --yes cspell --show-context --show-suggestions '**/*.*'"},"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","next.js","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"author":{"name":"Steven Chim"},"license":"MIT","bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","devDependencies":{"@commitlint/cli":"17.7.1","@commitlint/config-conventional":"17.7.0","@types/debug":"4.1.12","@types/express":"4.17.21","@types/is-glob":"4.0.4","@types/jest":"29.5.12","@types/micromatch":"4.0.6","@types/node":"20.11.30","@types/supertest":"2.0.12","@types/ws":"8.5.10","@typescript-eslint/eslint-plugin":"7.4.0","@typescript-eslint/parser":"7.4.0","body-parser":"1.20.2","browser-sync":"3.0.2","connect":"3.7.0","eslint":"8.57.0","eslint-config-prettier":"9.1.0","eslint-plugin-prettier":"5.1.3","express":"4.19.2","get-port":"5.1.1","husky":"9.0.11","jest":"29.7.0","lint-staged":"15.2.2","mockttp":"3.10.1","open":"8.4.2","prettier":"3.2.5","supertest":"6.3.4","ts-jest":"29.1.2","typescript":"5.4.3","ws":"8.16.0"},"dependencies":{"@types/http-proxy":"^1.17.10","debug":"^4.3.4","http-proxy":"^1.18.1","is-glob":"^4.0.1","is-plain-obj":"^3.0.0","micromatch":"^4.0.5"},"engines":{"node":"^14.15.0 || ^16.10.0 || >=18.0.0"},"commitlint":{"extends":["@commitlint/config-conventional"]},"gitHead":"84bfa46fc7174f46b9f24c1e7a7a1a977f0993f3","_id":"http-proxy-middleware@3.0.0","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-36AV1fIaI2cWRzHo+rbcxhe3M3jUDCNzc4D5zRl57sEWRAxdXYtw7FSQKYY6PDKssiAKjLYypbssHk+xs/kMXw==","shasum":"550790357d6f92a9b82ab2d63e07343a791cf26b","tarball":"https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.0.tgz","fileCount":57,"unpackedSize":80043,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFyGVADq2exBDnh9HnLdMilbqN1MGYmFSo6hIro1fJMrAiBhwKuwQyzYMny2K5J9Znro8fjLUCPRhHluG+cRTI6DAg=="}]},"_npmUser":{"name":"chimurai","email":"stevenchim@gmail.com"},"directories":{},"maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/http-proxy-middleware_3.0.0_1712007534615_0.059550009306416074"},"_hasShrinkwrap":false}},"readme":"# http-proxy-middleware\n\n[![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/chimurai/http-proxy-middleware/ci.yml?branch=master&logo=github-actions&logoColor=white&style=flat-square)](https://github.com/chimurai/http-proxy-middleware/actions/workflows/ci.yml?query=branch%3Amaster)\n[![Coveralls](https://img.shields.io/coveralls/chimurai/http-proxy-middleware.svg?style=flat-square&logo=coveralls)](https://coveralls.io/r/chimurai/http-proxy-middleware)\n[![Known Vulnerabilities](https://snyk.io/test/github/chimurai/http-proxy-middleware/badge.svg)](https://snyk.io/test/github/chimurai/http-proxy-middleware)\n[![npm](https://img.shields.io/npm/v/http-proxy-middleware?color=%23CC3534&style=flat-square&logo=npm)](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/expressjs/express), [next.js](https://github.com/vercel/next.js) and [many more](#compatible-servers).\n\nPowered by the popular Nodejitsu [`http-proxy`](https://github.com/http-party/node-http-proxy). [![GitHub stars](https://img.shields.io/github/stars/http-party/node-http-proxy.svg?style=social&label=Star)](https://github.com/http-party/node-http-proxy)\n\n## ⚠️ Note <!-- omit in toc -->\n\nThis page is showing documentation for version v3.x.x ([release notes](https://github.com/chimurai/http-proxy-middleware/releases))\n\nSee [MIGRATION.md](https://github.com/chimurai/http-proxy-middleware/blob/master/MIGRATION.md) for details on how to migrate from v2.x.x to v3.x.x\n\nIf you're looking for older documentation. Go to:\n\n- <https://github.com/chimurai/http-proxy-middleware/tree/v2.0.4#readme>\n- <https://github.com/chimurai/http-proxy-middleware/tree/v0.21.0#readme>\n\n## TL;DR <!-- omit in toc -->\n\nProxy `/api` requests to `http://www.example.org`\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```javascript\n// javascript\n\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst app = express();\n\napp.use(\n  '/api',\n  createProxyMiddleware({\n    target: 'http://www.example.org/secret',\n    changeOrigin: true,\n  }),\n);\n\napp.listen(3000);\n\n// proxy and change the base path from \"/api\" to \"/secret\"\n// http://127.0.0.1:3000/api/foo/bar -> http://www.example.org/secret/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(\n  '/api',\n  createProxyMiddleware({\n    target: 'http://www.example.org/api',\n    changeOrigin: true,\n  }),\n);\n\napp.listen(3000);\n\n// proxy and keep the same base path \"/api\"\n// http://127.0.0.1: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## Table of Contents <!-- omit in toc -->\n\n<!-- // spell-checker:disable -->\n\n- [Install](#install)\n- [Basic usage](#basic-usage)\n- [Express Server Example](#express-server-example)\n  - [app.use(path, proxy)](#appusepath-proxy)\n- [Options](#options)\n  - [`pathFilter` (string, \\[\\]string, glob, \\[\\]glob, function)](#pathfilter-string-string-glob-glob-function)\n  - [`pathRewrite` (object/function)](#pathrewrite-objectfunction)\n  - [`router` (object/function)](#router-objectfunction)\n  - [`plugins` (Array)](#plugins-array)\n  - [`ejectPlugins` (boolean) default: `false`](#ejectplugins-boolean-default-false)\n  - [`logger` (Object)](#logger-object)\n- [`http-proxy` events](#http-proxy-events)\n- [`http-proxy` options](#http-proxy-options)\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- [Node.js 17+: ECONNREFUSED issue with IPv6 and localhost (#705)](#nodejs-17-econnrefused-issue-with-ipv6-and-localhost-705)\n- [Debugging](#debugging)\n- [Working examples](#working-examples)\n- [Recipes](#recipes)\n- [Compatible servers](#compatible-servers)\n- [Tests](#tests)\n- [Changelog](#changelog)\n- [License](#license)\n\n<!-- // spell-checker:enable -->\n\n## Install\n\n```shell\nnpm install --save-dev http-proxy-middleware\n```\n\n## Basic usage\n\nCreate and configure a proxy middleware with: `createProxyMiddleware(config)`.\n\n```javascript\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst apiProxy = createProxyMiddleware({\n  target: 'http://www.example.org',\n  changeOrigin: true,\n});\n\n// 'apiProxy' is now ready to be used as middleware in a server.\n```\n\n- **options.target**: target host to proxy to. _(protocol + host)_\n- **options.changeOrigin**: for virtual hosted sites\n\n- see full list of [`http-proxy-middleware` configuration options](#options)\n\n## Express Server Example\n\nAn example with `express` server.\n\n```javascript\n// include dependencies\nconst express = require('express');\nconst { createProxyMiddleware } = require('http-proxy-middleware');\n\nconst app = express();\n\n// create the proxy\n/** @type {import('http-proxy-middleware/dist/types').RequestHandler<express.Request, express.Response>} */\nconst exampleProxy = createProxyMiddleware({\n  target: 'http://www.example.org/api', // target host with the same base path\n  changeOrigin: true, // needed for virtual hosted sites\n});\n\n// mount `exampleProxy` in web server\napp.use('/api', exampleProxy);\napp.listen(3000);\n```\n\n### app.use(path, proxy)\n\nIf you want to use the server's `app.use` `path` parameter to match requests.\nUse `pathFilter` option to further include/exclude requests which you want to proxy.\n\n```javascript\napp.use(\n  createProxyMiddleware({\n    target: 'http://www.example.org/api',\n    changeOrigin: true,\n    pathFilter: '/api/proxy-only-this-path',\n  }),\n);\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## Options\n\nhttp-proxy-middleware options:\n\n### `pathFilter` (string, []string, glob, []glob, function)\n\nNarrow down which requests should be proxied. The `path` used for filtering is the `request.url` pathname. In Express, this is the `path` relative to the mount-point of the proxy.\n\n- **path matching**\n\n  - `createProxyMiddleware({...})` - matches any path, all requests will be proxied when `pathFilter` is not configured.\n  - `createProxyMiddleware({ pathFilter: '/api', ...})` - matches paths starting with `/api`\n\n- **multiple path matching**\n\n  - `createProxyMiddleware({ pathFilter: ['/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({ pathFilter: '**', ...})` matches any path, all requests will be proxied.\n  - `createProxyMiddleware({ pathFilter: '**/*.html', ...})` matches any path which ends with `.html`\n  - `createProxyMiddleware({ pathFilter: '/*.html', ...})` matches paths directly under path-absolute\n  - `createProxyMiddleware({ pathFilter: '/api/**/*.html', ...})` matches requests ending with `.html` in the path of `/api`\n  - `createProxyMiddleware({ pathFilter: ['/api/**', '/ajax/**'], ...})` combine multiple patterns\n  - `createProxyMiddleware({ pathFilter: ['/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 pathFilter = function (path, req) {\n    return path.match('^/api') && req.method === 'GET';\n  };\n\n  const apiProxy = createProxyMiddleware({\n    target: 'http://www.example.org',\n    pathFilter: pathFilter,\n  });\n  ```\n\n### `pathRewrite` (object/function)\n\nRewrite target's url path. Object-keys will be used as _RegExp_ to match paths.\n\n```javascript\n// rewrite path\npathRewrite: {'^/old/api' : '/new/api'}\n\n// remove path\npathRewrite: {'^/remove/api' : ''}\n\n// add base path\npathRewrite: {'^/' : '/basepath/'}\n\n// custom rewriting\npathRewrite: function (path, req) { return path.replace('/api', '/base/api') }\n\n// custom rewriting, returning Promise\npathRewrite: 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### `router` (object/function)\n\nRe-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.\nrouter: {\n    'integration.localhost:3000' : 'http://127.0.0.1:8001',  // host only\n    'staging.localhost:3000'     : 'http://127.0.0.1:8002',  // host only\n    'localhost:3000/api'         : 'http://127.0.0.1:8003',  // host + path\n    '/rest'                      : 'http://127.0.0.1:8004'   // path only\n}\n\n// Custom router function (string target)\nrouter: function(req) {\n    return 'http://127.0.0.1:8004';\n}\n\n// Custom router function (target object)\nrouter: function(req) {\n    return {\n        protocol: 'https:', // The : is required\n        host: '127.0.0.1',\n        port: 8004\n    };\n}\n\n// Asynchronous router function which returns promise\nrouter: async function(req) {\n    const url = await doSomeIO();\n    return url;\n}\n```\n\n### `plugins` (Array)\n\n```js\nconst simpleRequestLogger = (proxyServer, options) => {\n  proxyServer.on('proxyReq', (proxyReq, req, res) => {\n    console.log(`[HPM] [${req.method}] ${req.url}`); // outputs: [HPM] GET /users\n  });\n},\n\nconst config = {\n  target: `http://example.org`,\n  changeOrigin: true,\n  plugins: [simpleRequestLogger],\n};\n```\n\n### `ejectPlugins` (boolean) default: `false`\n\nIf you're not satisfied with the pre-configured plugins, you can eject them by configuring `ejectPlugins: true`.\n\nNOTE: register your own error handlers to prevent server from crashing.\n\n```js\n// eject default plugins and manually add them back\n\nconst {\n  debugProxyErrorsPlugin, // subscribe to proxy errors to prevent server from crashing\n  loggerPlugin, // log proxy events to a logger (ie. console)\n  errorResponsePlugin, // return 5xx response on proxy error\n  proxyEventsPlugin, // implements the \"on:\" option\n} = require('http-proxy-middleware');\n\ncreateProxyMiddleware({\n  target: `http://example.org`,\n  changeOrigin: true,\n  ejectPlugins: true,\n  plugins: [debugProxyErrorsPlugin, loggerPlugin, errorResponsePlugin, proxyEventsPlugin],\n});\n```\n\n### `logger` (Object)\n\nConfigure a logger to output information from http-proxy-middleware: ie. `console`, `winston`, `pino`, `bunyan`, `log4js`, etc...\n\nOnly `info`, `warn`, `error` are used internally for compatibility across different loggers.\n\nIf you use `winston`, make sure to enable interpolation: <https://github.com/winstonjs/winston#string-interpolation>\n\nSee also logger recipes ([recipes/logger.md](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/logger.md)) for more details.\n\n```javascript\ncreateProxyMiddleware({\n  logger: console,\n});\n```\n\n## `http-proxy` events\n\nSubscribe to [http-proxy events](https://github.com/nodejitsu/node-http-proxy#listening-for-proxy-events) with the `on` option:\n\n```js\ncreateProxyMiddleware({\n  target: 'http://www.example.org',\n  on: {\n    proxyReq: (proxyReq, req, res) => {\n      /* handle proxyReq */\n    },\n    proxyRes: (proxyRes, req, res) => {\n      /* handle proxyRes */\n    },\n    error: (err, req, res) => {\n      /* handle error */\n    },\n  },\n});\n```\n\n- **option.on.error**: 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.on.proxyRes**: 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.on.proxyReq**: 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.on.proxyReqWs**: 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.on.open**: 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', hybridParseAndLogMessage);\n  }\n  ```\n\n- **option.on.close**: 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\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\n    ```json\n    cookieDomainRewrite: {\n      \"unchanged.domain\": \"unchanged.domain\",\n      \"old.domain\": \"new.domain\",\n      \"*\": \"\"\n    }\n    ```\n\n- **option.cookiePathRewrite**: rewrites path of `set-cookie` headers. Possible values:\n\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\n    ```json\n    cookiePathRewrite: {\n      \"/unchanged.path/\": \"/unchanged.path/\",\n      \"/old.path/\": \"/new.path/\",\n      \"*\": \"\"\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://127.0.0.1:4003/',\n        buffer: streamify(req.rawBody),\n      },\n      next,\n    );\n  };\n  ```\n\n## WebSocket\n\n```javascript\n// verbose api\ncreateProxyMiddleware({ pathFilter: '/', target: 'http://echo.websocket.org', ws: true });\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({ target: '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  on: {\n    proxyReq: fixRequestBody,\n  },\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  on: {\n    proxyRes: 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```\n\nCheck out [interception recipes](https://github.com/chimurai/http-proxy-middleware/blob/master/recipes/response-interceptor.md#readme) for more examples.\n\n## Node.js 17+: ECONNREFUSED issue with IPv6 and localhost ([#705](https://github.com/chimurai/http-proxy-middleware/issues/705))\n\nNode.js 17+ no longer prefers IPv4 over IPv6 for DNS lookups.\nE.g. It's **not** guaranteed that `localhost` will be resolved to `127.0.0.1` – it might just as well be `::1` (or some other IP address).\n\nIf your target server only accepts IPv4 connections, trying to proxy to `localhost` will fail if resolved to `::1` (IPv6).\n\nWays to solve it:\n\n- Change `target: \"http://localhost\"` to `target: \"http://127.0.0.1\"` (IPv4).\n- Change the target server to (also) accept IPv6 connections.\n- Add this flag when running `node`: `node index.js --dns-result-order=ipv4first`. (Not recommended.)\n\n> Note: There’s a thing called [Happy Eyeballs](https://en.wikipedia.org/wiki/Happy_Eyeballs) which means connecting to both IPv4 and IPv6 in parallel, which Node.js doesn’t have, but explains why for example `curl` can connect.\n\n## Debugging\n\nConfigure the `DEBUG` environment variable enable debug logging.\n\nSee [`debug`](https://github.com/debug-js/debug#readme) project for more options.\n\n```shell\nDEBUG=http-proxy-middleware* node server.js\n\n$ http-proxy-middleware proxy created +0ms\n$ http-proxy-middleware proxying request to target: 'http://www.example.org' +359ms\n```\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- [next.js](https://www.npmjs.com/package/next)\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# check spelling mistakes\n$ yarn spellcheck\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-2022 Steven Chim\n","maintainers":[{"name":"chimurai","email":"stevenchim@gmail.com"}],"time":{"modified":"2024-04-01T21:38:54.984Z","created":"2015-03-14T21:57:46.940Z","0.0.1":"2015-03-14T21:57:46.940Z","0.0.2":"2015-03-15T00:13:33.039Z","0.0.3":"2015-03-15T00:28:46.736Z","0.0.4":"2015-03-16T13:04:00.213Z","0.0.5":"2015-03-31T12:42:27.334Z","0.1.0":"2015-07-09T03:49:23.416Z","0.2.0":"2015-07-13T09:38:01.476Z","0.3.0":"2015-07-19T11:13:43.967Z","0.3.1":"2015-07-24T15:54:23.908Z","0.3.2":"2015-07-25T13:02:45.831Z","0.4.0":"2015-07-28T21:26:17.656Z","0.5.0":"2015-08-07T18:31:38.698Z","0.6.0":"2015-08-18T11:42:02.364Z","0.7.0":"2015-08-23T21:02:39.919Z","0.8.0":"2015-08-31T10:50:34.399Z","0.8.1":"2015-09-09T16:04:28.500Z","0.8.2":"2015-09-23T18:45:34.376Z","0.9.0":"2015-09-28T22:04:08.950Z","0.9.1":"2016-01-18T21:46:10.860Z","0.10.0-beta":"2016-01-26T21:30:19.853Z","0.10.0":"2016-02-05T19:20:01.172Z","0.11.0":"2016-02-24T20:00:47.471Z","0.12.0":"2016-03-13T17:51:38.449Z","0.13.0":"2016-03-23T20:22:52.857Z","0.14.0":"2016-04-18T20:37:44.882Z","0.15.0":"2016-05-03T21:02:36.666Z","0.15.1-beta":"2016-05-18T16:54:18.659Z","0.15.1":"2016-05-26T22:02:04.255Z","0.15.2":"2016-05-29T12:51:16.198Z","0.16.0":"2016-06-13T18:52:35.740Z","0.17.0-beta":"2016-06-16T15:24:47.966Z","0.17.0":"2016-07-03T15:35:21.923Z","0.17.1":"2016-08-11T21:30:30.925Z","0.17.2-beta":"2016-09-10T13:14:50.421Z","0.17.2":"2016-09-28T22:28:13.856Z","0.17.3":"2016-12-07T21:22:00.680Z","0.17.4":"2017-03-02T23:07:30.843Z","0.18.0":"2018-03-12T22:47:20.345Z","0.19.0":"2018-08-29T21:15:47.242Z","0.19.1":"2018-11-25T20:18:42.852Z","0.20.0-beta.0":"2019-05-31T21:02:11.520Z","0.20.0-beta.1":"2019-06-02T19:09:52.421Z","0.20.0-beta.2":"2019-07-09T19:41:34.272Z","0.20.0":"2019-09-03T19:56:26.579Z","0.21.0-beta.1":"2019-12-25T23:46:49.903Z","0.21.0-beta.2":"2020-01-05T17:05:03.266Z","0.21.0-beta.3":"2020-02-14T20:00:56.387Z","0.21.0":"2020-02-16T18:32:06.492Z","0.22.0-alpha":"2020-02-17T21:08:55.856Z","1.0.0":"2020-02-18T22:30:22.194Z","1.0.1":"2020-02-29T12:40:03.575Z","1.0.2":"2020-03-14T13:25:45.248Z","1.0.3":"2020-03-16T21:25:07.879Z","1.0.4":"2020-05-18T16:28:35.104Z","0.19.2":"2020-05-19T19:05:02.777Z","1.0.5":"2020-07-09T16:42:47.545Z","1.0.6":"2020-10-11T19:41:12.902Z","1.1.0":"2021-03-28T21:32:05.398Z","1.1.1-alpha.1":"2021-04-02T12:23:19.427Z","1.1.1":"2021-04-10T08:44:41.676Z","1.2.0-beta.1":"2021-04-10T19:51:46.547Z","1.2.0-beta.2":"2021-04-11T18:14:40.385Z","1.1.2-alpha.0":"2021-04-12T20:28:26.876Z","1.1.2-alpha.1":"2021-04-12T20:31:37.289Z","1.1.2":"2021-04-14T20:08:12.807Z","1.2.0":"2021-04-18T13:20:35.776Z","1.2.1-alpha.1":"2021-04-20T20:28:01.628Z","1.2.1":"2021-04-24T12:51:42.460Z","1.3.0":"2021-04-25T21:34:39.774Z","1.3.1":"2021-04-28T18:42:10.992Z","2.0.0":"2021-05-07T17:42:13.132Z","2.0.1":"2021-07-01T20:38:47.726Z","2.0.2":"2022-01-23T17:40:52.439Z","2.0.3":"2022-02-07T18:43:53.392Z","2.0.4":"2022-03-13T16:08:25.409Z","2.0.5":"2022-04-19T20:27:08.840Z","2.0.6":"2022-04-20T19:56:26.619Z","3.0.0-beta.0":"2022-04-22T17:39:57.519Z","3.0.0-beta.1":"2023-03-03T22:29:39.457Z","3.0.0":"2024-04-01T21:38:54.826Z"},"homepage":"https://github.com/chimurai/http-proxy-middleware#readme","keywords":["reverse","proxy","middleware","http","https","connect","express","fastify","polka","next.js","browser-sync","gulp","grunt-contrib-connect","websocket","ws","cors"],"repository":{"type":"git","url":"git+https://github.com/chimurai/http-proxy-middleware.git"},"author":{"name":"Steven Chim"},"bugs":{"url":"https://github.com/chimurai/http-proxy-middleware/issues"},"license":"MIT","readmeFilename":"README.md","users":{"kongxianghuan":true,"chimurai":true,"pensierinmusica":true,"hbin000":true,"cqcookie":true,"program247365":true,"jonniespratley":true,"dnik":true,"zhanghaili":true,"smcmill2":true,"quality520":true,"craigpatten":true,"ymk":true,"roccomuso":true,"manikantag":true,"antixrist":true,"quafoo":true,"taoqianbao":true,"wangnan0610":true,"monolithed":true,"ystrdy":true,"wickie":true,"johnnychq":true,"dyyz993":true,"vur":true,"nanxing":true,"leizongmin":true,"onursimsek":true,"wujr5":true,"jits":true,"shakakira":true,"abuelwafa":true,"nuer":true,"zollero":true,"iori20091101":true,"panlw":true,"bengi":true,"mark24code":true,"jacky3399":true,"scott.m.sarsfield":true,"xueboren":true,"dean-xu":true,"xiaochao":true,"wangfeia":true,"richleego":true,"king.v":true,"stone_breaker":true,"npmlincq":true,"caikan":true,"ierceg":true,"edwardxyt":true,"hehehai":true,"bigbird92":true,"chirag8642":true,"jamiemagique":true,"yikuo":true,"jinglf000":true,"jedaviata":true,"rocket0191":true,"hehaiyang":true,"joe.li":true,"largepuma":true,"icoon.li":true,"yeming":true,"xyyjk":true,"dai'liljian":true,"sayrilamar":true,"fakefarm":true,"jonschlinkert":true,"stona":true,"xfloops":true,"netoperatorwibby":true,"zuojiang":true,"vivek.vikhere":true,"warmilk":true,"maxwelldu":true,"hewenxuan":true,"xingtao":true,"ganeshkbhat":true,"jameskrill":true,"rubiadias":true,"syrontillp":true,"prasad.adss":true,"karzanosman984":true,"yangteng":true}}