unplugin-https-reverse-proxy 4.0.4 → 4.1.0-beta.10

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.
Files changed (56) hide show
  1. package/README.md +30 -6
  2. package/dist/{chunk-2P7SUCQ3.js → chunk-EY3HXBJ4.js} +0 -26
  3. package/dist/chunk-RKHJN6KY.js +53 -0
  4. package/dist/{chunk-5R33PUJP.js → chunk-U7KAIPZC.js} +981 -796
  5. package/dist/chunk-WOMR3ZLM.js +17 -0
  6. package/dist/esbuild.cjs +1077 -864
  7. package/dist/esbuild.js +4 -2
  8. package/dist/index.cjs +1077 -864
  9. package/dist/index.js +4 -2
  10. package/dist/nuxt.cjs +1049 -850
  11. package/dist/nuxt.js +6 -9
  12. package/dist/privilege-state.cjs +44 -0
  13. package/dist/privilege-state.d.cts +7 -0
  14. package/dist/privilege-state.d.ts +7 -0
  15. package/dist/privilege-state.js +10 -0
  16. package/dist/privileged-helper.cjs +824 -0
  17. package/dist/privileged-helper.d.cts +2 -0
  18. package/dist/privileged-helper.d.ts +2 -0
  19. package/dist/privileged-helper.js +797 -0
  20. package/dist/rollup.cjs +1077 -864
  21. package/dist/rollup.js +4 -2
  22. package/dist/rspack.cjs +1077 -864
  23. package/dist/rspack.js +4 -2
  24. package/dist/utils.cjs +0 -28
  25. package/dist/utils.d.cts +1 -3
  26. package/dist/utils.d.ts +1 -3
  27. package/dist/utils.js +1 -5
  28. package/dist/vite.cjs +1077 -864
  29. package/dist/vite.js +4 -2
  30. package/dist/webpack.cjs +1077 -864
  31. package/dist/webpack.js +4 -2
  32. package/package.json +1 -4
  33. package/src/caddy/caddyfile.ts +3 -0
  34. package/src/caddy/config.ts +195 -53
  35. package/src/caddy/constants.ts +30 -1
  36. package/src/caddy/index.ts +239 -206
  37. package/src/caddy/privileged.ts +124 -0
  38. package/src/caddy/utils.ts +0 -43
  39. package/src/index.ts +49 -22
  40. package/src/nuxt.ts +1 -6
  41. package/src/privilege-state.ts +23 -0
  42. package/src/privileged/bootstrap.ts +289 -0
  43. package/src/privileged/client.ts +288 -0
  44. package/src/privileged/entry.ts +73 -0
  45. package/src/privileged/hosts-file.ts +142 -0
  46. package/src/privileged/launch.ts +332 -0
  47. package/src/privileged/path-guard.ts +74 -0
  48. package/src/privileged/ports.ts +45 -0
  49. package/src/privileged/protocol.ts +111 -0
  50. package/src/privileged/server.ts +578 -0
  51. package/src/privileged/session.ts +169 -0
  52. package/src/privileged/validation.ts +38 -0
  53. package/src/privileged/windows-elevation.ts +80 -0
  54. package/src/privileged-helper.ts +123 -0
  55. package/src/utils.ts +0 -28
  56. package/src/host/index.ts +0 -52
package/dist/rspack.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  src_default
3
- } from "./chunk-5R33PUJP.js";
3
+ } from "./chunk-U7KAIPZC.js";
4
+ import "./chunk-EY3HXBJ4.js";
4
5
  import "./chunk-C5A7XLKL.js";
5
- import "./chunk-2P7SUCQ3.js";
6
+ import "./chunk-WOMR3ZLM.js";
7
+ import "./chunk-RKHJN6KY.js";
6
8
 
7
9
  // src/rspack.ts
8
10
  var rspack_default = src_default.rspack;
package/dist/utils.cjs CHANGED
@@ -30,33 +30,19 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/utils.ts
31
31
  var utils_exports = {};
32
32
  __export(utils_exports, {
33
- chmodRecursive: () => chmodRecursive,
34
33
  consola: () => consola,
35
34
  generateQrcode: () => generateQrcode,
36
35
  getIpv4List: () => getIpv4List,
37
- isAdmin: () => isAdmin,
38
36
  once: () => once
39
37
  });
40
38
  module.exports = __toCommonJS(utils_exports);
41
- var import_node_child_process = require("child_process");
42
- var import_promises = require("fs/promises");
43
39
  var import_node_os = require("os");
44
- var import_node_path = __toESM(require("path"), 1);
45
- var import_node_process = __toESM(require("process"), 1);
46
40
  var import_consola = require("consola");
47
41
  var import_picocolors = __toESM(require("picocolors"), 1);
48
42
  var import_qrcode_terminal = __toESM(require("qrcode-terminal"), 1);
49
43
  var consola = (0, import_consola.createConsola)({
50
44
  level: 3
51
45
  }).withTag("reverse-proxy");
52
- async function chmodRecursive(_path, mode) {
53
- await (0, import_promises.chmod)(_path, mode);
54
- if ((await (0, import_promises.stat)(_path)).isDirectory()) {
55
- const children = await (0, import_promises.readdir)(_path);
56
- for (const child of children)
57
- await chmodRecursive(import_node_path.default.join(_path, child), mode);
58
- }
59
- }
60
46
  function once(fn) {
61
47
  let called = false;
62
48
  return (...args) => {
@@ -66,18 +52,6 @@ function once(fn) {
66
52
  return fn(...args);
67
53
  };
68
54
  }
69
- function isAdmin() {
70
- if (import_node_process.default.platform === "win32") {
71
- try {
72
- (0, import_node_child_process.execSync)("net session", { stdio: "ignore" });
73
- return true;
74
- } catch {
75
- return false;
76
- }
77
- } else {
78
- return !!(import_node_process.default.getuid && import_node_process.default.getuid() === 0);
79
- }
80
- }
81
55
  function getIpv4List() {
82
56
  const interfaces = (0, import_node_os.networkInterfaces)();
83
57
  return Object.values(interfaces).flatMap((nInterface) => nInterface ?? []).filter(
@@ -93,11 +67,9 @@ async function generateQrcode(input) {
93
67
  }
94
68
  // Annotate the CommonJS export names for ESM import in node:
95
69
  0 && (module.exports = {
96
- chmodRecursive,
97
70
  consola,
98
71
  generateQrcode,
99
72
  getIpv4List,
100
- isAdmin,
101
73
  once
102
74
  });
103
75
  exports.default = module.exports;
package/dist/utils.d.cts CHANGED
@@ -1,10 +1,8 @@
1
1
  import * as _consola from 'consola';
2
2
 
3
3
  declare const consola: _consola.ConsolaInstance;
4
- declare function chmodRecursive(_path: string, mode: number): Promise<void>;
5
4
  declare function once<T extends (...args: any[]) => any>(fn: T): (...args: Parameters<T>) => ReturnType<T>;
6
- declare function isAdmin(): boolean;
7
5
  declare function getIpv4List(): string[];
8
6
  declare function generateQrcode(input: string): Promise<string>;
9
7
 
10
- export { chmodRecursive, consola, generateQrcode, getIpv4List, isAdmin, once };
8
+ export { consola, generateQrcode, getIpv4List, once };
package/dist/utils.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import * as _consola from 'consola';
2
2
 
3
3
  declare const consola: _consola.ConsolaInstance;
4
- declare function chmodRecursive(_path: string, mode: number): Promise<void>;
5
4
  declare function once<T extends (...args: any[]) => any>(fn: T): (...args: Parameters<T>) => ReturnType<T>;
6
- declare function isAdmin(): boolean;
7
5
  declare function getIpv4List(): string[];
8
6
  declare function generateQrcode(input: string): Promise<string>;
9
7
 
10
- export { chmodRecursive, consola, generateQrcode, getIpv4List, isAdmin, once };
8
+ export { consola, generateQrcode, getIpv4List, once };
package/dist/utils.js CHANGED
@@ -1,16 +1,12 @@
1
1
  import {
2
- chmodRecursive,
3
2
  consola,
4
3
  generateQrcode,
5
4
  getIpv4List,
6
- isAdmin,
7
5
  once
8
- } from "./chunk-2P7SUCQ3.js";
6
+ } from "./chunk-EY3HXBJ4.js";
9
7
  export {
10
- chmodRecursive,
11
8
  consola,
12
9
  generateQrcode,
13
10
  getIpv4List,
14
- isAdmin,
15
11
  once
16
12
  };