Socket
Socket
Sign inDemoInstall

http-proxy-middleware

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-proxy-middleware - npm Package Compare versions

Comparing version 0.17.2-beta to 0.17.2

6

CHANGELOG.md
# 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))

14

lib/index.js

@@ -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 {

8

package.json
{
"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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc