unplugin-https-reverse-proxy 0.0.16 → 0.0.18

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-G5VIL2MO.js";
3
+ } from "./chunk-HXDI3VOY.js";
4
4
 
5
5
  // src/webpack.ts
6
6
  import { createWebpackPlugin } from "unplugin";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-G5VIL2MO.js";
3
+ } from "./chunk-HXDI3VOY.js";
4
4
 
5
5
  // src/vite.ts
6
6
  import { createVitePlugin } from "unplugin";
@@ -311,7 +311,7 @@ var CaddyInstant = class {
311
311
  * @returns
312
312
  */
313
313
  async run(source, target, options) {
314
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
314
+ source = source.replace("0.0.0.0", "127.0.0.1");
315
315
  const {
316
316
  restore = true,
317
317
  base = "/",
@@ -320,9 +320,9 @@ var CaddyInstant = class {
320
320
  } = options || {};
321
321
  if (!this.inited)
322
322
  await this.init();
323
- if (await tryPort(443))
323
+ if (https && await tryPort(443))
324
324
  await kill(443, "tcp");
325
- if (process2.platform === "win32" && await tryPort(80))
325
+ if ((process2.platform === "win32" || !https) && await tryPort(80))
326
326
  await kill(80, "tcp");
327
327
  if (!await this.updateHost(source.split(":")[0], target.split(":")[0]))
328
328
  throw new Error("update host failed");
@@ -475,7 +475,7 @@ var unpluginFactory = (options) => ({
475
475
  }
476
476
  try {
477
477
  const devServer = __spreadValues(__spreadValues({
478
- host: "127.0.0.1",
478
+ host: "localhost",
479
479
  port: 8080
480
480
  }, compiler.options.devServer), process3.VUE_CLI_SERVICE.projectOptions.devServer);
481
481
  const source = `${devServer.host}:${devServer.port}`;
package/dist/esbuild.cjs CHANGED
@@ -371,7 +371,7 @@ var CaddyInstant = class {
371
371
  * @returns
372
372
  */
373
373
  async run(source, target, options) {
374
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
374
+ source = source.replace("0.0.0.0", "127.0.0.1");
375
375
  const {
376
376
  restore = true,
377
377
  base = "/",
@@ -380,9 +380,9 @@ var CaddyInstant = class {
380
380
  } = options || {};
381
381
  if (!this.inited)
382
382
  await this.init();
383
- if (await tryPort(443))
383
+ if (https && await tryPort(443))
384
384
  await (0, import_kill_port.default)(443, "tcp");
385
- if (import_node_process2.default.platform === "win32" && await tryPort(80))
385
+ if ((import_node_process2.default.platform === "win32" || !https) && await tryPort(80))
386
386
  await (0, import_kill_port.default)(80, "tcp");
387
387
  if (!await this.updateHost(source.split(":")[0], target.split(":")[0]))
388
388
  throw new Error("update host failed");
@@ -535,7 +535,7 @@ var unpluginFactory = (options) => ({
535
535
  }
536
536
  try {
537
537
  const devServer = __spreadValues(__spreadValues({
538
- host: "127.0.0.1",
538
+ host: "localhost",
539
539
  port: 8080
540
540
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
541
541
  const source = `${devServer.host}:${devServer.port}`;
package/dist/esbuild.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-G5VIL2MO.js";
3
+ } from "./chunk-HXDI3VOY.js";
4
4
  import "./chunk-CQC5SSJR.js";
5
5
 
6
6
  // src/esbuild.ts
package/dist/index.cjs CHANGED
@@ -370,7 +370,7 @@ var CaddyInstant = class {
370
370
  * @returns
371
371
  */
372
372
  async run(source, target, options) {
373
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
373
+ source = source.replace("0.0.0.0", "127.0.0.1");
374
374
  const {
375
375
  restore = true,
376
376
  base = "/",
@@ -379,9 +379,9 @@ var CaddyInstant = class {
379
379
  } = options || {};
380
380
  if (!this.inited)
381
381
  await this.init();
382
- if (await tryPort(443))
382
+ if (https && await tryPort(443))
383
383
  await (0, import_kill_port.default)(443, "tcp");
384
- if (import_node_process2.default.platform === "win32" && await tryPort(80))
384
+ if ((import_node_process2.default.platform === "win32" || !https) && await tryPort(80))
385
385
  await (0, import_kill_port.default)(80, "tcp");
386
386
  if (!await this.updateHost(source.split(":")[0], target.split(":")[0]))
387
387
  throw new Error("update host failed");
@@ -534,7 +534,7 @@ var unpluginFactory = (options) => ({
534
534
  }
535
535
  try {
536
536
  const devServer = __spreadValues(__spreadValues({
537
- host: "127.0.0.1",
537
+ host: "localhost",
538
538
  port: 8080
539
539
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
540
540
  const source = `${devServer.host}:${devServer.port}`;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  src_default,
3
3
  unplugin,
4
4
  unpluginFactory
5
- } from "./chunk-G5VIL2MO.js";
5
+ } from "./chunk-HXDI3VOY.js";
6
6
  import "./chunk-CQC5SSJR.js";
7
7
  export {
8
8
  src_default as default,
package/dist/nuxt.cjs CHANGED
@@ -374,7 +374,7 @@ var CaddyInstant = class {
374
374
  * @returns
375
375
  */
376
376
  async run(source, target, options) {
377
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
377
+ source = source.replace("0.0.0.0", "127.0.0.1");
378
378
  const {
379
379
  restore = true,
380
380
  base = "/",
@@ -383,9 +383,9 @@ var CaddyInstant = class {
383
383
  } = options || {};
384
384
  if (!this.inited)
385
385
  await this.init();
386
- if (await tryPort(443))
386
+ if (https && await tryPort(443))
387
387
  await (0, import_kill_port.default)(443, "tcp");
388
- if (import_node_process2.default.platform === "win32" && await tryPort(80))
388
+ if ((import_node_process2.default.platform === "win32" || !https) && await tryPort(80))
389
389
  await (0, import_kill_port.default)(80, "tcp");
390
390
  if (!await this.updateHost(source.split(":")[0], target.split(":")[0]))
391
391
  throw new Error("update host failed");
@@ -538,7 +538,7 @@ var unpluginFactory = (options) => ({
538
538
  }
539
539
  try {
540
540
  const devServer = __spreadValues(__spreadValues({
541
- host: "127.0.0.1",
541
+ host: "localhost",
542
542
  port: 8080
543
543
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
544
544
  const source = `${devServer.host}:${devServer.port}`;
package/dist/nuxt.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-HWUN3C5Q.js";
3
+ } from "./chunk-D3S54OXA.js";
4
4
  import {
5
5
  webpack_default
6
- } from "./chunk-MPY62XIL.js";
7
- import "./chunk-G5VIL2MO.js";
6
+ } from "./chunk-6MDRTXCZ.js";
7
+ import "./chunk-HXDI3VOY.js";
8
8
  import "./chunk-CQC5SSJR.js";
9
9
 
10
10
  // src/nuxt.ts
package/dist/rollup.cjs CHANGED
@@ -371,7 +371,7 @@ var CaddyInstant = class {
371
371
  * @returns
372
372
  */
373
373
  async run(source, target, options) {
374
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
374
+ source = source.replace("0.0.0.0", "127.0.0.1");
375
375
  const {
376
376
  restore = true,
377
377
  base = "/",
@@ -380,9 +380,9 @@ var CaddyInstant = class {
380
380
  } = options || {};
381
381
  if (!this.inited)
382
382
  await this.init();
383
- if (await tryPort(443))
383
+ if (https && await tryPort(443))
384
384
  await (0, import_kill_port.default)(443, "tcp");
385
- if (import_node_process2.default.platform === "win32" && await tryPort(80))
385
+ if ((import_node_process2.default.platform === "win32" || !https) && await tryPort(80))
386
386
  await (0, import_kill_port.default)(80, "tcp");
387
387
  if (!await this.updateHost(source.split(":")[0], target.split(":")[0]))
388
388
  throw new Error("update host failed");
@@ -535,7 +535,7 @@ var unpluginFactory = (options) => ({
535
535
  }
536
536
  try {
537
537
  const devServer = __spreadValues(__spreadValues({
538
- host: "127.0.0.1",
538
+ host: "localhost",
539
539
  port: 8080
540
540
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
541
541
  const source = `${devServer.host}:${devServer.port}`;
package/dist/rollup.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unpluginFactory
3
- } from "./chunk-G5VIL2MO.js";
3
+ } from "./chunk-HXDI3VOY.js";
4
4
  import "./chunk-CQC5SSJR.js";
5
5
 
6
6
  // src/rollup.ts
package/dist/vite.cjs CHANGED
@@ -371,7 +371,7 @@ var CaddyInstant = class {
371
371
  * @returns
372
372
  */
373
373
  async run(source, target, options) {
374
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
374
+ source = source.replace("0.0.0.0", "127.0.0.1");
375
375
  const {
376
376
  restore = true,
377
377
  base = "/",
@@ -380,9 +380,9 @@ var CaddyInstant = class {
380
380
  } = options || {};
381
381
  if (!this.inited)
382
382
  await this.init();
383
- if (await tryPort(443))
383
+ if (https && await tryPort(443))
384
384
  await (0, import_kill_port.default)(443, "tcp");
385
- if (import_node_process2.default.platform === "win32" && await tryPort(80))
385
+ if ((import_node_process2.default.platform === "win32" || !https) && await tryPort(80))
386
386
  await (0, import_kill_port.default)(80, "tcp");
387
387
  if (!await this.updateHost(source.split(":")[0], target.split(":")[0]))
388
388
  throw new Error("update host failed");
@@ -535,7 +535,7 @@ var unpluginFactory = (options) => ({
535
535
  }
536
536
  try {
537
537
  const devServer = __spreadValues(__spreadValues({
538
- host: "127.0.0.1",
538
+ host: "localhost",
539
539
  port: 8080
540
540
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
541
541
  const source = `${devServer.host}:${devServer.port}`;
package/dist/vite.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  vite_default
3
- } from "./chunk-HWUN3C5Q.js";
4
- import "./chunk-G5VIL2MO.js";
3
+ } from "./chunk-D3S54OXA.js";
4
+ import "./chunk-HXDI3VOY.js";
5
5
  import "./chunk-CQC5SSJR.js";
6
6
  export {
7
7
  vite_default as default
package/dist/webpack.cjs CHANGED
@@ -371,7 +371,7 @@ var CaddyInstant = class {
371
371
  * @returns
372
372
  */
373
373
  async run(source, target, options) {
374
- source = source.replace("0.0.0.0", "127.0.0.1").replace("localhost", "127.0.0.1");
374
+ source = source.replace("0.0.0.0", "127.0.0.1");
375
375
  const {
376
376
  restore = true,
377
377
  base = "/",
@@ -380,9 +380,9 @@ var CaddyInstant = class {
380
380
  } = options || {};
381
381
  if (!this.inited)
382
382
  await this.init();
383
- if (await tryPort(443))
383
+ if (https && await tryPort(443))
384
384
  await (0, import_kill_port.default)(443, "tcp");
385
- if (import_node_process2.default.platform === "win32" && await tryPort(80))
385
+ if ((import_node_process2.default.platform === "win32" || !https) && await tryPort(80))
386
386
  await (0, import_kill_port.default)(80, "tcp");
387
387
  if (!await this.updateHost(source.split(":")[0], target.split(":")[0]))
388
388
  throw new Error("update host failed");
@@ -535,7 +535,7 @@ var unpluginFactory = (options) => ({
535
535
  }
536
536
  try {
537
537
  const devServer = __spreadValues(__spreadValues({
538
- host: "127.0.0.1",
538
+ host: "localhost",
539
539
  port: 8080
540
540
  }, compiler.options.devServer), import_node_process3.default.VUE_CLI_SERVICE.projectOptions.devServer);
541
541
  const source = `${devServer.host}:${devServer.port}`;
package/dist/webpack.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  webpack_default
3
- } from "./chunk-MPY62XIL.js";
4
- import "./chunk-G5VIL2MO.js";
3
+ } from "./chunk-6MDRTXCZ.js";
4
+ import "./chunk-HXDI3VOY.js";
5
5
  import "./chunk-CQC5SSJR.js";
6
6
  export {
7
7
  webpack_default as default
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.16",
4
+ "version": "0.0.18",
5
5
  "packageManager": "pnpm@8.6.12",
6
6
  "description": "",
7
7
  "license": "MIT",
@@ -164,7 +164,7 @@ export class CaddyInstant {
164
164
  * @returns
165
165
  */
166
166
  async run(source: string, target: string, options?: Partial<RunOptions>) {
167
- source = source.replace('0.0.0.0', '127.0.0.1').replace('localhost', '127.0.0.1')
167
+ source = source.replace('0.0.0.0', '127.0.0.1')
168
168
  const {
169
169
  restore = true,
170
170
  base = '/',
@@ -175,9 +175,9 @@ export class CaddyInstant {
175
175
  if (!this.inited)
176
176
  await this.init()
177
177
 
178
- if (await tryPort(443))
178
+ if (https && await tryPort(443))
179
179
  await kill(443, 'tcp')
180
- if (process.platform === 'win32' && await tryPort(80))
180
+ if ((process.platform === 'win32' || !https) && await tryPort(80))
181
181
  await kill(80, 'tcp')
182
182
 
183
183
  if (!await this.updateHost(source.split(':')[0], target.split(':')[0]))
package/src/index.ts CHANGED
@@ -138,7 +138,7 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
138
138
  // })
139
139
 
140
140
  const devServer = {
141
- host: '127.0.0.1',
141
+ host: 'localhost',
142
142
  port: 8080,
143
143
  ...compiler.options.devServer,
144
144
  // @ts-expect-error vuecli