@modern-js/plugin-proxy 2.1.0 → 2.2.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 +11 -0
- package/dist/js/modern/utils/macCAManager.js +2 -2
- package/dist/js/modern/utils/whistleProxy.js +1 -1
- package/dist/js/node/utils/macCAManager.js +2 -2
- package/dist/js/node/utils/whistleProxy.js +1 -1
- package/dist/types/utils/macCAManager.d.ts +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @modern-js/plugin-proxy
|
|
2
2
|
|
|
3
|
+
## 2.2.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 965fb00: fix: plugin-proxy rootca request port error
|
|
8
|
+
|
|
9
|
+
fix: 修复插件代理 rootca 请求端口错误
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [49eff0c]
|
|
12
|
+
- @modern-js/utils@2.2.0
|
|
13
|
+
|
|
3
14
|
## 2.1.0
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -24,13 +24,13 @@ const isRootCAExists = () => {
|
|
|
24
24
|
}
|
|
25
25
|
return false;
|
|
26
26
|
};
|
|
27
|
-
const generateRootCA = () => new Promise((resolve, reject) => {
|
|
27
|
+
const generateRootCA = (port) => new Promise((resolve, reject) => {
|
|
28
28
|
if (fs.existsSync(defaultRootCA)) {
|
|
29
29
|
fs.removeSync(defaultRootCA);
|
|
30
30
|
}
|
|
31
31
|
fs.ensureDirSync(defaultCertDir);
|
|
32
32
|
const stream = fs.createWriteStream(defaultRootCA);
|
|
33
|
-
http.get(
|
|
33
|
+
http.get(`http://localhost:${port}/cgi-bin/rootca`, (response) => {
|
|
34
34
|
response.pipe(stream);
|
|
35
35
|
stream.on("finish", () => {
|
|
36
36
|
resolve(defaultRootCA);
|
|
@@ -55,13 +55,13 @@ const isRootCAExists = () => {
|
|
|
55
55
|
}
|
|
56
56
|
return false;
|
|
57
57
|
};
|
|
58
|
-
const generateRootCA = () => new Promise((resolve, reject) => {
|
|
58
|
+
const generateRootCA = (port) => new Promise((resolve, reject) => {
|
|
59
59
|
if (import_utils.fs.existsSync(defaultRootCA)) {
|
|
60
60
|
import_utils.fs.removeSync(defaultRootCA);
|
|
61
61
|
}
|
|
62
62
|
import_utils.fs.ensureDirSync(defaultCertDir);
|
|
63
63
|
const stream = import_utils.fs.createWriteStream(defaultRootCA);
|
|
64
|
-
import_http.default.get(
|
|
64
|
+
import_http.default.get(`http://localhost:${port}/cgi-bin/rootca`, (response) => {
|
|
65
65
|
response.pipe(stream);
|
|
66
66
|
stream.on("finish", () => {
|
|
67
67
|
resolve(defaultRootCA);
|
|
@@ -65,7 +65,7 @@ class WhistleProxy {
|
|
|
65
65
|
return __async(this, null, function* () {
|
|
66
66
|
try {
|
|
67
67
|
if (!(0, import_macCAManager.isRootCAExists)()) {
|
|
68
|
-
yield (0, import_macCAManager.generateRootCA)();
|
|
68
|
+
yield (0, import_macCAManager.generateRootCA)(this.port);
|
|
69
69
|
(0, import_macCAManager.trustRootCA)();
|
|
70
70
|
}
|
|
71
71
|
} catch (err) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const defaultRootCA: string;
|
|
2
2
|
export declare const trustRootCA: () => void;
|
|
3
3
|
export declare const isRootCAExists: () => boolean;
|
|
4
|
-
export declare const generateRootCA: () => Promise<unknown>;
|
|
4
|
+
export declare const generateRootCA: (port: number) => Promise<unknown>;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.2.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.18.0",
|
|
35
35
|
"whistle": "^2.7.18",
|
|
36
|
-
"@modern-js/utils": "2.
|
|
36
|
+
"@modern-js/utils": "2.2.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/jest": "^27",
|
|
40
40
|
"@types/node": "^14",
|
|
41
41
|
"typescript": "^4",
|
|
42
42
|
"jest": "^27",
|
|
43
|
-
"@modern-js/core": "2.
|
|
44
|
-
"@scripts/
|
|
45
|
-
"@scripts/
|
|
43
|
+
"@modern-js/core": "2.2.0",
|
|
44
|
+
"@scripts/build": "2.2.0",
|
|
45
|
+
"@scripts/jest-config": "2.2.0"
|
|
46
46
|
},
|
|
47
47
|
"sideEffects": false,
|
|
48
48
|
"publishConfig": {
|