unplugin-https-reverse-proxy 0.0.3 → 0.0.4

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/README.md CHANGED
@@ -35,6 +35,15 @@ Example: [`playground/`](./playground/)
35
35
  // webpack.config.js
36
36
  module.exports = {
37
37
  /* ... */
38
+ devServer: {
39
+ client: {
40
+ // ↓ for HMR
41
+ webSocketURL: {
42
+ protocol: 'wss',
43
+ port: 443,
44
+ },
45
+ },
46
+ },
38
47
  plugins: [
39
48
  require('unplugin-https-reverse-proxy/webpack')({ /* options */ })
40
49
  ]
@@ -65,6 +74,15 @@ export default defineNuxtConfig({
65
74
  ```ts
66
75
  // vue.config.js
67
76
  module.exports = {
77
+ devServer: {
78
+ client: {
79
+ // ↓ for HMR
80
+ webSocketURL: {
81
+ protocol: 'wss',
82
+ port: 443,
83
+ },
84
+ },
85
+ },
68
86
  configureWebpack: {
69
87
  plugins: [
70
88
  require('unplugin-https-reverse-proxy/webpack')({ /* options */ }),
@@ -192,11 +192,14 @@ function testCaddy() {
192
192
  return resolve(false);
193
193
  chmodSync(caddyPath, 493);
194
194
  const child = process2.platform === "win32" ? spawn(caddyPath, []) : spawn("sudo", [caddyPath]);
195
+ child.on("close", () => {
196
+ return resolve(true);
197
+ });
195
198
  child.on("error", (err) => {
196
- reject(err);
199
+ return reject(err);
197
200
  });
198
201
  child.stdout.on("data", (_data) => {
199
- resolve(true);
202
+ return resolve(true);
200
203
  });
201
204
  });
202
205
  }
@@ -276,7 +279,7 @@ var CaddyInstant = class {
276
279
  throw new Error("update host failed");
277
280
  if (await tryPort(443))
278
281
  await kill(443, "tcp");
279
- if (await tryPort(80))
282
+ if (process2.platform === "win32" && await tryPort(80))
280
283
  await kill(80, "tcp");
281
284
  return new Promise((resolve, reject) => {
282
285
  const child = process2.platform !== "win32" ? spawn("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : spawn(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
@@ -290,6 +293,7 @@ var CaddyInstant = class {
290
293
  }
291
294
  });
292
295
  child.stdout.on("data", (_data) => {
296
+ console.log(_data.toString());
293
297
  resolve(async () => {
294
298
  if (!restore)
295
299
  return;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-HSZFTLD3.js";
3
+ } from "./chunk-BWNBY4RY.js";
4
4
 
5
5
  // src/vite.ts
6
6
  import { createVitePlugin } from "unplugin";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-HSZFTLD3.js";
3
+ } from "./chunk-BWNBY4RY.js";
4
4
 
5
5
  // src/webpack.ts
6
6
  import { createWebpackPlugin } from "unplugin";
package/dist/esbuild.cjs CHANGED
@@ -229,11 +229,14 @@ function testCaddy() {
229
229
  return resolve(false);
230
230
  (0, import_node_fs.chmodSync)(caddyPath, 493);
231
231
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
232
+ child.on("close", () => {
233
+ return resolve(true);
234
+ });
232
235
  child.on("error", (err) => {
233
- reject(err);
236
+ return reject(err);
234
237
  });
235
238
  child.stdout.on("data", (_data) => {
236
- resolve(true);
239
+ return resolve(true);
237
240
  });
238
241
  });
239
242
  }
@@ -313,7 +316,7 @@ var CaddyInstant = class {
313
316
  throw new Error("update host failed");
314
317
  if (await tryPort(443))
315
318
  await (0, import_kill_port.default)(443, "tcp");
316
- if (await tryPort(80))
319
+ if (import_node_process2.default.platform === "win32" && await tryPort(80))
317
320
  await (0, import_kill_port.default)(80, "tcp");
318
321
  return new Promise((resolve, reject) => {
319
322
  const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
@@ -327,6 +330,7 @@ var CaddyInstant = class {
327
330
  }
328
331
  });
329
332
  child.stdout.on("data", (_data) => {
333
+ console.log(_data.toString());
330
334
  resolve(async () => {
331
335
  if (!restore)
332
336
  return;
package/dist/esbuild.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-HSZFTLD3.js";
3
+ } from "./chunk-BWNBY4RY.js";
4
4
 
5
5
  // src/esbuild.ts
6
6
  import { createEsbuildPlugin } from "unplugin";
package/dist/index.cjs CHANGED
@@ -228,11 +228,14 @@ function testCaddy() {
228
228
  return resolve(false);
229
229
  (0, import_node_fs.chmodSync)(caddyPath, 493);
230
230
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
231
+ child.on("close", () => {
232
+ return resolve(true);
233
+ });
231
234
  child.on("error", (err) => {
232
- reject(err);
235
+ return reject(err);
233
236
  });
234
237
  child.stdout.on("data", (_data) => {
235
- resolve(true);
238
+ return resolve(true);
236
239
  });
237
240
  });
238
241
  }
@@ -312,7 +315,7 @@ var CaddyInstant = class {
312
315
  throw new Error("update host failed");
313
316
  if (await tryPort(443))
314
317
  await (0, import_kill_port.default)(443, "tcp");
315
- if (await tryPort(80))
318
+ if (import_node_process2.default.platform === "win32" && await tryPort(80))
316
319
  await (0, import_kill_port.default)(80, "tcp");
317
320
  return new Promise((resolve, reject) => {
318
321
  const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
@@ -326,6 +329,7 @@ var CaddyInstant = class {
326
329
  }
327
330
  });
328
331
  child.stdout.on("data", (_data) => {
332
+ console.log(_data.toString());
329
333
  resolve(async () => {
330
334
  if (!restore)
331
335
  return;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  src_default,
3
3
  unplugin,
4
4
  unpluginFactory
5
- } from "./chunk-HSZFTLD3.js";
5
+ } from "./chunk-BWNBY4RY.js";
6
6
  export {
7
7
  src_default as default,
8
8
  unplugin,
package/dist/nuxt.cjs CHANGED
@@ -232,11 +232,14 @@ function testCaddy() {
232
232
  return resolve(false);
233
233
  (0, import_node_fs.chmodSync)(caddyPath, 493);
234
234
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
235
+ child.on("close", () => {
236
+ return resolve(true);
237
+ });
235
238
  child.on("error", (err) => {
236
- reject(err);
239
+ return reject(err);
237
240
  });
238
241
  child.stdout.on("data", (_data) => {
239
- resolve(true);
242
+ return resolve(true);
240
243
  });
241
244
  });
242
245
  }
@@ -316,7 +319,7 @@ var CaddyInstant = class {
316
319
  throw new Error("update host failed");
317
320
  if (await tryPort(443))
318
321
  await (0, import_kill_port.default)(443, "tcp");
319
- if (await tryPort(80))
322
+ if (import_node_process2.default.platform === "win32" && await tryPort(80))
320
323
  await (0, import_kill_port.default)(80, "tcp");
321
324
  return new Promise((resolve, reject) => {
322
325
  const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
@@ -330,6 +333,7 @@ var CaddyInstant = class {
330
333
  }
331
334
  });
332
335
  child.stdout.on("data", (_data) => {
336
+ console.log(_data.toString());
333
337
  resolve(async () => {
334
338
  if (!restore)
335
339
  return;
package/dist/nuxt.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-47EXOCHO.js";
3
+ } from "./chunk-CCEFFLWU.js";
4
4
  import {
5
5
  webpack_default
6
- } from "./chunk-Q7EG3ZFW.js";
7
- import "./chunk-HSZFTLD3.js";
6
+ } from "./chunk-YJTJH7KX.js";
7
+ import "./chunk-BWNBY4RY.js";
8
8
 
9
9
  // src/nuxt.ts
10
10
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
package/dist/rollup.cjs CHANGED
@@ -229,11 +229,14 @@ function testCaddy() {
229
229
  return resolve(false);
230
230
  (0, import_node_fs.chmodSync)(caddyPath, 493);
231
231
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
232
+ child.on("close", () => {
233
+ return resolve(true);
234
+ });
232
235
  child.on("error", (err) => {
233
- reject(err);
236
+ return reject(err);
234
237
  });
235
238
  child.stdout.on("data", (_data) => {
236
- resolve(true);
239
+ return resolve(true);
237
240
  });
238
241
  });
239
242
  }
@@ -313,7 +316,7 @@ var CaddyInstant = class {
313
316
  throw new Error("update host failed");
314
317
  if (await tryPort(443))
315
318
  await (0, import_kill_port.default)(443, "tcp");
316
- if (await tryPort(80))
319
+ if (import_node_process2.default.platform === "win32" && await tryPort(80))
317
320
  await (0, import_kill_port.default)(80, "tcp");
318
321
  return new Promise((resolve, reject) => {
319
322
  const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
@@ -327,6 +330,7 @@ var CaddyInstant = class {
327
330
  }
328
331
  });
329
332
  child.stdout.on("data", (_data) => {
333
+ console.log(_data.toString());
330
334
  resolve(async () => {
331
335
  if (!restore)
332
336
  return;
package/dist/rollup.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-HSZFTLD3.js";
3
+ } from "./chunk-BWNBY4RY.js";
4
4
 
5
5
  // src/rollup.ts
6
6
  import { createRollupPlugin } from "unplugin";
package/dist/vite.cjs CHANGED
@@ -229,11 +229,14 @@ function testCaddy() {
229
229
  return resolve(false);
230
230
  (0, import_node_fs.chmodSync)(caddyPath, 493);
231
231
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
232
+ child.on("close", () => {
233
+ return resolve(true);
234
+ });
232
235
  child.on("error", (err) => {
233
- reject(err);
236
+ return reject(err);
234
237
  });
235
238
  child.stdout.on("data", (_data) => {
236
- resolve(true);
239
+ return resolve(true);
237
240
  });
238
241
  });
239
242
  }
@@ -313,7 +316,7 @@ var CaddyInstant = class {
313
316
  throw new Error("update host failed");
314
317
  if (await tryPort(443))
315
318
  await (0, import_kill_port.default)(443, "tcp");
316
- if (await tryPort(80))
319
+ if (import_node_process2.default.platform === "win32" && await tryPort(80))
317
320
  await (0, import_kill_port.default)(80, "tcp");
318
321
  return new Promise((resolve, reject) => {
319
322
  const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
@@ -327,6 +330,7 @@ var CaddyInstant = class {
327
330
  }
328
331
  });
329
332
  child.stdout.on("data", (_data) => {
333
+ console.log(_data.toString());
330
334
  resolve(async () => {
331
335
  if (!restore)
332
336
  return;
package/dist/vite.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-47EXOCHO.js";
4
- import "./chunk-HSZFTLD3.js";
3
+ } from "./chunk-CCEFFLWU.js";
4
+ import "./chunk-BWNBY4RY.js";
5
5
  export {
6
6
  vite_default as default
7
7
  };
package/dist/webpack.cjs CHANGED
@@ -229,11 +229,14 @@ function testCaddy() {
229
229
  return resolve(false);
230
230
  (0, import_node_fs.chmodSync)(caddyPath, 493);
231
231
  const child = import_node_process2.default.platform === "win32" ? (0, import_node_child_process.spawn)(caddyPath, []) : (0, import_node_child_process.spawn)("sudo", [caddyPath]);
232
+ child.on("close", () => {
233
+ return resolve(true);
234
+ });
232
235
  child.on("error", (err) => {
233
- reject(err);
236
+ return reject(err);
234
237
  });
235
238
  child.stdout.on("data", (_data) => {
236
- resolve(true);
239
+ return resolve(true);
237
240
  });
238
241
  });
239
242
  }
@@ -313,7 +316,7 @@ var CaddyInstant = class {
313
316
  throw new Error("update host failed");
314
317
  if (await tryPort(443))
315
318
  await (0, import_kill_port.default)(443, "tcp");
316
- if (await tryPort(80))
319
+ if (import_node_process2.default.platform === "win32" && await tryPort(80))
317
320
  await (0, import_kill_port.default)(80, "tcp");
318
321
  return new Promise((resolve, reject) => {
319
322
  const child = import_node_process2.default.platform !== "win32" ? (0, import_node_child_process.spawn)("sudo", [caddyPath, "reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]) : (0, import_node_child_process.spawn)(caddyPath, ["reverse-proxy", "--from", `${target.split(":")[0]}`, "--to", `${source}`, "--internal-certs"]);
@@ -327,6 +330,7 @@ var CaddyInstant = class {
327
330
  }
328
331
  });
329
332
  child.stdout.on("data", (_data) => {
333
+ console.log(_data.toString());
330
334
  resolve(async () => {
331
335
  if (!restore)
332
336
  return;
package/dist/webpack.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  webpack_default
3
- } from "./chunk-Q7EG3ZFW.js";
4
- import "./chunk-HSZFTLD3.js";
3
+ } from "./chunk-YJTJH7KX.js";
4
+ import "./chunk-BWNBY4RY.js";
5
5
  export {
6
6
  webpack_default as default
7
7
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-https-reverse-proxy",
3
3
  "type": "module",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "packageManager": "pnpm@8.6.12",
6
6
  "description": "",
7
7
  "license": "MIT",