http-proxy-middleware 0.20.0-beta.2 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Changelog
2
2
 
3
- ## next
3
+ ## [v0.20.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.20.0)
4
4
 
5
+ - fix(ws): concurrent websocket requests do not get upgraded ([#335](https://github.com/chimurai/http-proxy-middleware/issues/335))
5
6
  - chore: drop node 6 (BREAKING CHANGE)
6
7
  - chore: update to micromatch@4 ([BREAKING CHANGE](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md#400---2019-03-20))
7
8
  - chore: update dev dependencies
@@ -35,10 +35,12 @@ class HttpProxyMiddleware {
35
35
  }
36
36
  });
37
37
  this.catchUpgradeRequest = server => {
38
- server.on('upgrade', this.handleUpgrade);
39
- // prevent duplicate upgrade handling;
40
- // in case external upgrade is also configured
41
- this.wsInternalSubscribed = true;
38
+ if (!this.wsInternalSubscribed) {
39
+ server.on('upgrade', this.handleUpgrade);
40
+ // prevent duplicate upgrade handling;
41
+ // in case external upgrade is also configured
42
+ this.wsInternalSubscribed = true;
43
+ }
42
44
  };
43
45
  this.handleUpgrade = (req, socket, head) => {
44
46
  if (this.shouldProxy(this.config.context, req)) {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "http-proxy-middleware",
3
- "version": "0.20.0-beta.2",
3
+ "version": "0.20.0",
4
4
  "description": "The one-liner node.js proxy middleware for connect, express and browser-sync",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
9
9
  "scripts": {
10
- "clean": "rm -rf coverage",
10
+ "clean": "rm -rf dist && rm -rf coverage",
11
11
  "lint": "yarn lint:prettier && yarn lint:tslint",
12
12
  "lint:prettier": "prettier --check \"**/*.{js,ts,md}\"",
13
13
  "lint:tslint": "yarn tslint -c tslint.json '{lib,test}/**/*.ts'",
@@ -20,7 +20,7 @@
20
20
  "precoveralls": "yarn clean && yarn build",
21
21
  "coveralls": "jest --runInBand --coverage --coverageReporters=text-lcov | coveralls",
22
22
  "postcoveralls": "yarn clean",
23
- "prepublish": "yarn build"
23
+ "prepare": "yarn clean && yarn build"
24
24
  },
25
25
  "repository": {
26
26
  "type": "git",
@@ -48,33 +48,33 @@
48
48
  },
49
49
  "homepage": "https://github.com/chimurai/http-proxy-middleware",
50
50
  "devDependencies": {
51
- "@commitlint/cli": "^7.2.1",
52
- "@commitlint/config-conventional": "^7.1.2",
53
- "@types/express": "^4.16.1",
51
+ "@commitlint/cli": "^8.0.0",
52
+ "@commitlint/config-conventional": "^8.0.0",
53
+ "@types/express": "^4.17.0",
54
54
  "@types/http-proxy": "^1.17.0",
55
55
  "@types/is-glob": "^4.0.0",
56
- "@types/jest": "^24.0.11",
57
- "@types/lodash": "^4.14.123",
56
+ "@types/jest": "^24.0.15",
57
+ "@types/lodash": "^4.14.136",
58
58
  "@types/micromatch": "^3.1.0",
59
- "@types/node": "^12.0.4",
60
- "browser-sync": "^2.26.3",
59
+ "@types/node": "^12.6.2",
60
+ "browser-sync": "^2.26.7",
61
61
  "connect": "^3.6.6",
62
- "coveralls": "^3.0.3",
62
+ "coveralls": "^3.0.5",
63
63
  "express": "^4.16.4",
64
- "husky": "^2.3.0",
64
+ "husky": "^3.0.0",
65
65
  "jest": "^24.5.0",
66
- "open": "^6.3.0",
67
- "prettier": "^1.15.2",
66
+ "open": "^6.4.0",
67
+ "prettier": "^1.18.2",
68
68
  "ts-jest": "^24.0.0",
69
- "tslint": "^5.14.0",
69
+ "tslint": "^5.18.0",
70
70
  "tslint-config-prettier": "^1.18.0",
71
- "typescript": "^3.4.1",
72
- "ws": "^7.0.0"
71
+ "typescript": "^3.5.3",
72
+ "ws": "^7.1.0"
73
73
  },
74
74
  "dependencies": {
75
75
  "http-proxy": "^1.17.0",
76
76
  "is-glob": "^4.0.1",
77
- "lodash": "^4.17.11",
77
+ "lodash": "^4.17.14",
78
78
  "micromatch": "^4.0.2"
79
79
  },
80
80
  "engines": {