http-proxy-middleware
Advanced tools
Comparing version 0.17.2-beta to 0.17.2
# Changelog | ||
## [v0.17.2](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.2) | ||
- feat(logging): improve error message & add link to Node errors page. ([#106](https://github.com/chimurai/http-proxy-middleware/pull/106)) ([cloudmu](https://github.com/cloudmu)) | ||
- feat(pathRewrite): path can be empty string. ([#110](https://github.com/chimurai/http-proxy-middleware/pull/110)) ([sunnylqm](https://github.com/sunnylqm)) | ||
- bug(websocket): memory leak when option 'ws:true' is used. ([#114](https://github.com/chimurai/http-proxy-middleware/pull/114)) ([julbra](https://github.com/julbra)) | ||
- chore(package.json): reduce package size. ([#109](https://github.com/chimurai/http-proxy-middleware/pull/109)) | ||
## [v0.17.1](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.1) | ||
@@ -4,0 +10,0 @@ - fix(Express sub Router): 404 on non-proxy routes ([#94](https://github.com/chimurai/http-proxy-middleware/issues/94)) |
@@ -16,2 +16,3 @@ var _ = require('lodash'); | ||
var wsUpgradeDebounced = _.debounce(handleUpgrade); | ||
var wsInitialized = false; | ||
var config = configFactory.createConfig(context, opts); | ||
@@ -47,2 +48,3 @@ var proxyOptions = config.options; | ||
if (proxyOptions.ws === true) { | ||
// use initial request to access the server object to subscribe to http upgrade event | ||
catchUpgradeRequest(req.connection.server); | ||
@@ -53,6 +55,14 @@ } | ||
function catchUpgradeRequest(server) { | ||
server.on('upgrade', wsUpgradeDebounced); | ||
// subscribe once; don't subscribe on every request... | ||
// https://github.com/chimurai/http-proxy-middleware/issues/113 | ||
if (!wsInitialized) { | ||
server.on('upgrade', wsUpgradeDebounced); | ||
wsInitialized = true; | ||
} | ||
} | ||
function handleUpgrade(req, socket, head) { | ||
// set to initialized when used externally | ||
wsInitialized = true; | ||
if (shouldProxy(config.context, req)) { | ||
@@ -125,3 +135,3 @@ var activeProxyOptions = prepareProxyRequest(req); | ||
if (path) { | ||
if (typeof path === 'string') { | ||
req.url = path; | ||
@@ -128,0 +138,0 @@ } else { |
{ | ||
"name": "http-proxy-middleware", | ||
"version": "0.17.2-beta", | ||
"version": "0.17.2", | ||
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync", | ||
@@ -55,7 +55,7 @@ "main": "index.js", | ||
"dependencies": { | ||
"http-proxy": "^1.14.0", | ||
"is-glob": "^2.0.1", | ||
"lodash": "^4.14.2", | ||
"http-proxy": "^1.15.1", | ||
"is-glob": "^3.0.0", | ||
"lodash": "^4.16.2", | ||
"micromatch": "^2.3.11" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43974
587
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@3.1.0(transitive)
Updatedhttp-proxy@^1.15.1
Updatedis-glob@^3.0.0
Updatedlodash@^4.16.2