unplugin-https-reverse-proxy 2.0.0 → 2.0.2
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/dist/{chunk-SO2FMQ2Q.js → chunk-E6C23MZG.js} +23 -8
- package/dist/esbuild.cjs +23 -8
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +23 -8
- package/dist/index.js +1 -1
- package/dist/nuxt.cjs +15 -8
- package/dist/nuxt.js +5 -1
- package/dist/rollup.cjs +23 -8
- package/dist/rollup.js +1 -1
- package/dist/rspack.cjs +23 -8
- package/dist/rspack.js +1 -1
- package/dist/vite.cjs +23 -8
- package/dist/vite.js +1 -1
- package/dist/webpack.cjs +23 -8
- package/dist/webpack.js +1 -1
- package/package.json +1 -1
- package/src/caddy/index.ts +14 -10
- package/src/index.ts +15 -0
- package/src/nuxt.ts +5 -0
|
@@ -505,19 +505,22 @@ ${target.split(":")[0]}${https ? "" : ":80"} {
|
|
|
505
505
|
const lines = data.toString().split("\n").map((line) => line.trim());
|
|
506
506
|
for (const line of lines) {
|
|
507
507
|
showCaddyLog && line && console.info(line);
|
|
508
|
-
|
|
509
|
-
if (line.includes("
|
|
510
|
-
|
|
508
|
+
try {
|
|
509
|
+
if (line.includes("Error:") || line && JSON.parse(line).level === "error") {
|
|
510
|
+
if (line.includes("parsing caddyfile tokens")) {
|
|
511
|
+
consola.error("Caddyfile syntax error, please contact the author:\n", `${this.caddyfile}
|
|
511
512
|
|
|
512
513
|
${line}
|
|
513
514
|
`);
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
515
|
+
await this.baseCleanup();
|
|
516
|
+
process3.exit();
|
|
517
|
+
} else {
|
|
518
|
+
consola.error(`${line}
|
|
518
519
|
`);
|
|
519
|
-
|
|
520
|
+
return reject(line);
|
|
521
|
+
}
|
|
520
522
|
}
|
|
523
|
+
} catch {
|
|
521
524
|
}
|
|
522
525
|
if (line.includes("config file changed"))
|
|
523
526
|
consola.success("Detect added a new reverse proxy config, restarted.\n");
|
|
@@ -642,6 +645,10 @@ var unpluginFactory = (options) => ({
|
|
|
642
645
|
consola.fail("please provide target");
|
|
643
646
|
return;
|
|
644
647
|
}
|
|
648
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
649
|
+
consola.fail("target must be a domain");
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
645
652
|
const _printUrls = server.printUrls.bind(server);
|
|
646
653
|
let source = `localhost:${config.server.port || 5173}`;
|
|
647
654
|
const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
|
|
@@ -671,6 +678,10 @@ var unpluginFactory = (options) => ({
|
|
|
671
678
|
consola.fail("please provide target");
|
|
672
679
|
return;
|
|
673
680
|
}
|
|
681
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
682
|
+
consola.fail("target must be a domain");
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
674
685
|
const devServer = {
|
|
675
686
|
host: "localhost",
|
|
676
687
|
port: 8080,
|
|
@@ -721,6 +732,10 @@ var unpluginFactory = (options) => ({
|
|
|
721
732
|
consola.fail("please provide target");
|
|
722
733
|
return;
|
|
723
734
|
}
|
|
735
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
736
|
+
consola.fail("target must be a domain");
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
724
739
|
const devServer = {
|
|
725
740
|
host: "localhost",
|
|
726
741
|
port: 8080,
|
package/dist/esbuild.cjs
CHANGED
|
@@ -590,19 +590,22 @@ ${target.split(":")[0]}${https ? "" : ":80"} {
|
|
|
590
590
|
const lines = data.toString().split("\n").map((line) => line.trim());
|
|
591
591
|
for (const line of lines) {
|
|
592
592
|
showCaddyLog && line && console.info(line);
|
|
593
|
-
|
|
594
|
-
if (line.includes("
|
|
595
|
-
|
|
593
|
+
try {
|
|
594
|
+
if (line.includes("Error:") || line && JSON.parse(line).level === "error") {
|
|
595
|
+
if (line.includes("parsing caddyfile tokens")) {
|
|
596
|
+
consola.error("Caddyfile syntax error, please contact the author:\n", `${this.caddyfile}
|
|
596
597
|
|
|
597
598
|
${line}
|
|
598
599
|
`);
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
await this.baseCleanup();
|
|
601
|
+
import_node_process4.default.exit();
|
|
602
|
+
} else {
|
|
603
|
+
consola.error(`${line}
|
|
603
604
|
`);
|
|
604
|
-
|
|
605
|
+
return reject(line);
|
|
606
|
+
}
|
|
605
607
|
}
|
|
608
|
+
} catch {
|
|
606
609
|
}
|
|
607
610
|
if (line.includes("config file changed"))
|
|
608
611
|
consola.success("Detect added a new reverse proxy config, restarted.\n");
|
|
@@ -727,6 +730,10 @@ var unpluginFactory = (options) => ({
|
|
|
727
730
|
consola.fail("please provide target");
|
|
728
731
|
return;
|
|
729
732
|
}
|
|
733
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
734
|
+
consola.fail("target must be a domain");
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
730
737
|
const _printUrls = server.printUrls.bind(server);
|
|
731
738
|
let source = `localhost:${config.server.port || 5173}`;
|
|
732
739
|
const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
|
|
@@ -756,6 +763,10 @@ var unpluginFactory = (options) => ({
|
|
|
756
763
|
consola.fail("please provide target");
|
|
757
764
|
return;
|
|
758
765
|
}
|
|
766
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
767
|
+
consola.fail("target must be a domain");
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
759
770
|
const devServer = {
|
|
760
771
|
host: "localhost",
|
|
761
772
|
port: 8080,
|
|
@@ -806,6 +817,10 @@ var unpluginFactory = (options) => ({
|
|
|
806
817
|
consola.fail("please provide target");
|
|
807
818
|
return;
|
|
808
819
|
}
|
|
820
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
821
|
+
consola.fail("target must be a domain");
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
809
824
|
const devServer = {
|
|
810
825
|
host: "localhost",
|
|
811
826
|
port: 8080,
|
package/dist/esbuild.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -590,19 +590,22 @@ ${target.split(":")[0]}${https ? "" : ":80"} {
|
|
|
590
590
|
const lines = data.toString().split("\n").map((line) => line.trim());
|
|
591
591
|
for (const line of lines) {
|
|
592
592
|
showCaddyLog && line && console.info(line);
|
|
593
|
-
|
|
594
|
-
if (line.includes("
|
|
595
|
-
|
|
593
|
+
try {
|
|
594
|
+
if (line.includes("Error:") || line && JSON.parse(line).level === "error") {
|
|
595
|
+
if (line.includes("parsing caddyfile tokens")) {
|
|
596
|
+
consola.error("Caddyfile syntax error, please contact the author:\n", `${this.caddyfile}
|
|
596
597
|
|
|
597
598
|
${line}
|
|
598
599
|
`);
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
await this.baseCleanup();
|
|
601
|
+
import_node_process4.default.exit();
|
|
602
|
+
} else {
|
|
603
|
+
consola.error(`${line}
|
|
603
604
|
`);
|
|
604
|
-
|
|
605
|
+
return reject(line);
|
|
606
|
+
}
|
|
605
607
|
}
|
|
608
|
+
} catch {
|
|
606
609
|
}
|
|
607
610
|
if (line.includes("config file changed"))
|
|
608
611
|
consola.success("Detect added a new reverse proxy config, restarted.\n");
|
|
@@ -727,6 +730,10 @@ var unpluginFactory = (options) => ({
|
|
|
727
730
|
consola.fail("please provide target");
|
|
728
731
|
return;
|
|
729
732
|
}
|
|
733
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
734
|
+
consola.fail("target must be a domain");
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
730
737
|
const _printUrls = server.printUrls.bind(server);
|
|
731
738
|
let source = `localhost:${config.server.port || 5173}`;
|
|
732
739
|
const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
|
|
@@ -756,6 +763,10 @@ var unpluginFactory = (options) => ({
|
|
|
756
763
|
consola.fail("please provide target");
|
|
757
764
|
return;
|
|
758
765
|
}
|
|
766
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
767
|
+
consola.fail("target must be a domain");
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
759
770
|
const devServer = {
|
|
760
771
|
host: "localhost",
|
|
761
772
|
port: 8080,
|
|
@@ -806,6 +817,10 @@ var unpluginFactory = (options) => ({
|
|
|
806
817
|
consola.fail("please provide target");
|
|
807
818
|
return;
|
|
808
819
|
}
|
|
820
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
821
|
+
consola.fail("target must be a domain");
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
809
824
|
const devServer = {
|
|
810
825
|
host: "localhost",
|
|
811
826
|
port: 8080,
|
package/dist/index.js
CHANGED
package/dist/nuxt.cjs
CHANGED
|
@@ -591,19 +591,22 @@ ${target.split(":")[0]}${https ? "" : ":80"} {
|
|
|
591
591
|
const lines = data.toString().split("\n").map((line) => line.trim());
|
|
592
592
|
for (const line of lines) {
|
|
593
593
|
showCaddyLog && line && console.info(line);
|
|
594
|
-
|
|
595
|
-
if (line.includes("
|
|
596
|
-
|
|
594
|
+
try {
|
|
595
|
+
if (line.includes("Error:") || line && JSON.parse(line).level === "error") {
|
|
596
|
+
if (line.includes("parsing caddyfile tokens")) {
|
|
597
|
+
consola.error("Caddyfile syntax error, please contact the author:\n", `${this.caddyfile}
|
|
597
598
|
|
|
598
599
|
${line}
|
|
599
600
|
`);
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
601
|
+
await this.baseCleanup();
|
|
602
|
+
import_node_process4.default.exit();
|
|
603
|
+
} else {
|
|
604
|
+
consola.error(`${line}
|
|
604
605
|
`);
|
|
605
|
-
|
|
606
|
+
return reject(line);
|
|
607
|
+
}
|
|
606
608
|
}
|
|
609
|
+
} catch {
|
|
607
610
|
}
|
|
608
611
|
if (line.includes("config file changed"))
|
|
609
612
|
consola.success("Detect added a new reverse proxy config, restarted.\n");
|
|
@@ -727,6 +730,10 @@ var nuxt_default = (0, import_kit.defineNuxtModule)({
|
|
|
727
730
|
consola.fail("please provide target");
|
|
728
731
|
return;
|
|
729
732
|
}
|
|
733
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
734
|
+
consola.fail("target must be a domain");
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
730
737
|
_nuxt.hook("listen", (_, listener) => {
|
|
731
738
|
const url = listener.url;
|
|
732
739
|
const source = new URL(url).host;
|
package/dist/nuxt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vitePrintUrls
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E6C23MZG.js";
|
|
4
4
|
import {
|
|
5
5
|
consola,
|
|
6
6
|
isAdmin
|
|
@@ -32,6 +32,10 @@ var nuxt_default = defineNuxtModule({
|
|
|
32
32
|
consola.fail("please provide target");
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
36
|
+
consola.fail("target must be a domain");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
35
39
|
_nuxt.hook("listen", (_, listener) => {
|
|
36
40
|
const url = listener.url;
|
|
37
41
|
const source = new URL(url).host;
|
package/dist/rollup.cjs
CHANGED
|
@@ -590,19 +590,22 @@ ${target.split(":")[0]}${https ? "" : ":80"} {
|
|
|
590
590
|
const lines = data.toString().split("\n").map((line) => line.trim());
|
|
591
591
|
for (const line of lines) {
|
|
592
592
|
showCaddyLog && line && console.info(line);
|
|
593
|
-
|
|
594
|
-
if (line.includes("
|
|
595
|
-
|
|
593
|
+
try {
|
|
594
|
+
if (line.includes("Error:") || line && JSON.parse(line).level === "error") {
|
|
595
|
+
if (line.includes("parsing caddyfile tokens")) {
|
|
596
|
+
consola.error("Caddyfile syntax error, please contact the author:\n", `${this.caddyfile}
|
|
596
597
|
|
|
597
598
|
${line}
|
|
598
599
|
`);
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
await this.baseCleanup();
|
|
601
|
+
import_node_process4.default.exit();
|
|
602
|
+
} else {
|
|
603
|
+
consola.error(`${line}
|
|
603
604
|
`);
|
|
604
|
-
|
|
605
|
+
return reject(line);
|
|
606
|
+
}
|
|
605
607
|
}
|
|
608
|
+
} catch {
|
|
606
609
|
}
|
|
607
610
|
if (line.includes("config file changed"))
|
|
608
611
|
consola.success("Detect added a new reverse proxy config, restarted.\n");
|
|
@@ -727,6 +730,10 @@ var unpluginFactory = (options) => ({
|
|
|
727
730
|
consola.fail("please provide target");
|
|
728
731
|
return;
|
|
729
732
|
}
|
|
733
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
734
|
+
consola.fail("target must be a domain");
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
730
737
|
const _printUrls = server.printUrls.bind(server);
|
|
731
738
|
let source = `localhost:${config.server.port || 5173}`;
|
|
732
739
|
const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
|
|
@@ -756,6 +763,10 @@ var unpluginFactory = (options) => ({
|
|
|
756
763
|
consola.fail("please provide target");
|
|
757
764
|
return;
|
|
758
765
|
}
|
|
766
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
767
|
+
consola.fail("target must be a domain");
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
759
770
|
const devServer = {
|
|
760
771
|
host: "localhost",
|
|
761
772
|
port: 8080,
|
|
@@ -806,6 +817,10 @@ var unpluginFactory = (options) => ({
|
|
|
806
817
|
consola.fail("please provide target");
|
|
807
818
|
return;
|
|
808
819
|
}
|
|
820
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
821
|
+
consola.fail("target must be a domain");
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
809
824
|
const devServer = {
|
|
810
825
|
host: "localhost",
|
|
811
826
|
port: 8080,
|
package/dist/rollup.js
CHANGED
package/dist/rspack.cjs
CHANGED
|
@@ -589,19 +589,22 @@ ${target.split(":")[0]}${https ? "" : ":80"} {
|
|
|
589
589
|
const lines = data.toString().split("\n").map((line) => line.trim());
|
|
590
590
|
for (const line of lines) {
|
|
591
591
|
showCaddyLog && line && console.info(line);
|
|
592
|
-
|
|
593
|
-
if (line.includes("
|
|
594
|
-
|
|
592
|
+
try {
|
|
593
|
+
if (line.includes("Error:") || line && JSON.parse(line).level === "error") {
|
|
594
|
+
if (line.includes("parsing caddyfile tokens")) {
|
|
595
|
+
consola.error("Caddyfile syntax error, please contact the author:\n", `${this.caddyfile}
|
|
595
596
|
|
|
596
597
|
${line}
|
|
597
598
|
`);
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
599
|
+
await this.baseCleanup();
|
|
600
|
+
import_node_process4.default.exit();
|
|
601
|
+
} else {
|
|
602
|
+
consola.error(`${line}
|
|
602
603
|
`);
|
|
603
|
-
|
|
604
|
+
return reject(line);
|
|
605
|
+
}
|
|
604
606
|
}
|
|
607
|
+
} catch {
|
|
605
608
|
}
|
|
606
609
|
if (line.includes("config file changed"))
|
|
607
610
|
consola.success("Detect added a new reverse proxy config, restarted.\n");
|
|
@@ -726,6 +729,10 @@ var unpluginFactory = (options) => ({
|
|
|
726
729
|
consola.fail("please provide target");
|
|
727
730
|
return;
|
|
728
731
|
}
|
|
732
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
733
|
+
consola.fail("target must be a domain");
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
729
736
|
const _printUrls = server.printUrls.bind(server);
|
|
730
737
|
let source = `localhost:${config.server.port || 5173}`;
|
|
731
738
|
const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
|
|
@@ -755,6 +762,10 @@ var unpluginFactory = (options) => ({
|
|
|
755
762
|
consola.fail("please provide target");
|
|
756
763
|
return;
|
|
757
764
|
}
|
|
765
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
766
|
+
consola.fail("target must be a domain");
|
|
767
|
+
return;
|
|
768
|
+
}
|
|
758
769
|
const devServer = {
|
|
759
770
|
host: "localhost",
|
|
760
771
|
port: 8080,
|
|
@@ -805,6 +816,10 @@ var unpluginFactory = (options) => ({
|
|
|
805
816
|
consola.fail("please provide target");
|
|
806
817
|
return;
|
|
807
818
|
}
|
|
819
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
820
|
+
consola.fail("target must be a domain");
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
808
823
|
const devServer = {
|
|
809
824
|
host: "localhost",
|
|
810
825
|
port: 8080,
|
package/dist/rspack.js
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -590,19 +590,22 @@ ${target.split(":")[0]}${https ? "" : ":80"} {
|
|
|
590
590
|
const lines = data.toString().split("\n").map((line) => line.trim());
|
|
591
591
|
for (const line of lines) {
|
|
592
592
|
showCaddyLog && line && console.info(line);
|
|
593
|
-
|
|
594
|
-
if (line.includes("
|
|
595
|
-
|
|
593
|
+
try {
|
|
594
|
+
if (line.includes("Error:") || line && JSON.parse(line).level === "error") {
|
|
595
|
+
if (line.includes("parsing caddyfile tokens")) {
|
|
596
|
+
consola.error("Caddyfile syntax error, please contact the author:\n", `${this.caddyfile}
|
|
596
597
|
|
|
597
598
|
${line}
|
|
598
599
|
`);
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
await this.baseCleanup();
|
|
601
|
+
import_node_process4.default.exit();
|
|
602
|
+
} else {
|
|
603
|
+
consola.error(`${line}
|
|
603
604
|
`);
|
|
604
|
-
|
|
605
|
+
return reject(line);
|
|
606
|
+
}
|
|
605
607
|
}
|
|
608
|
+
} catch {
|
|
606
609
|
}
|
|
607
610
|
if (line.includes("config file changed"))
|
|
608
611
|
consola.success("Detect added a new reverse proxy config, restarted.\n");
|
|
@@ -727,6 +730,10 @@ var unpluginFactory = (options) => ({
|
|
|
727
730
|
consola.fail("please provide target");
|
|
728
731
|
return;
|
|
729
732
|
}
|
|
733
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
734
|
+
consola.fail("target must be a domain");
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
730
737
|
const _printUrls = server.printUrls.bind(server);
|
|
731
738
|
let source = `localhost:${config.server.port || 5173}`;
|
|
732
739
|
const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
|
|
@@ -756,6 +763,10 @@ var unpluginFactory = (options) => ({
|
|
|
756
763
|
consola.fail("please provide target");
|
|
757
764
|
return;
|
|
758
765
|
}
|
|
766
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
767
|
+
consola.fail("target must be a domain");
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
759
770
|
const devServer = {
|
|
760
771
|
host: "localhost",
|
|
761
772
|
port: 8080,
|
|
@@ -806,6 +817,10 @@ var unpluginFactory = (options) => ({
|
|
|
806
817
|
consola.fail("please provide target");
|
|
807
818
|
return;
|
|
808
819
|
}
|
|
820
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
821
|
+
consola.fail("target must be a domain");
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
809
824
|
const devServer = {
|
|
810
825
|
host: "localhost",
|
|
811
826
|
port: 8080,
|
package/dist/vite.js
CHANGED
package/dist/webpack.cjs
CHANGED
|
@@ -590,19 +590,22 @@ ${target.split(":")[0]}${https ? "" : ":80"} {
|
|
|
590
590
|
const lines = data.toString().split("\n").map((line) => line.trim());
|
|
591
591
|
for (const line of lines) {
|
|
592
592
|
showCaddyLog && line && console.info(line);
|
|
593
|
-
|
|
594
|
-
if (line.includes("
|
|
595
|
-
|
|
593
|
+
try {
|
|
594
|
+
if (line.includes("Error:") || line && JSON.parse(line).level === "error") {
|
|
595
|
+
if (line.includes("parsing caddyfile tokens")) {
|
|
596
|
+
consola.error("Caddyfile syntax error, please contact the author:\n", `${this.caddyfile}
|
|
596
597
|
|
|
597
598
|
${line}
|
|
598
599
|
`);
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
600
|
+
await this.baseCleanup();
|
|
601
|
+
import_node_process4.default.exit();
|
|
602
|
+
} else {
|
|
603
|
+
consola.error(`${line}
|
|
603
604
|
`);
|
|
604
|
-
|
|
605
|
+
return reject(line);
|
|
606
|
+
}
|
|
605
607
|
}
|
|
608
|
+
} catch {
|
|
606
609
|
}
|
|
607
610
|
if (line.includes("config file changed"))
|
|
608
611
|
consola.success("Detect added a new reverse proxy config, restarted.\n");
|
|
@@ -727,6 +730,10 @@ var unpluginFactory = (options) => ({
|
|
|
727
730
|
consola.fail("please provide target");
|
|
728
731
|
return;
|
|
729
732
|
}
|
|
733
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
734
|
+
consola.fail("target must be a domain");
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
730
737
|
const _printUrls = server.printUrls.bind(server);
|
|
731
738
|
let source = `localhost:${config.server.port || 5173}`;
|
|
732
739
|
const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
|
|
@@ -756,6 +763,10 @@ var unpluginFactory = (options) => ({
|
|
|
756
763
|
consola.fail("please provide target");
|
|
757
764
|
return;
|
|
758
765
|
}
|
|
766
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
767
|
+
consola.fail("target must be a domain");
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
759
770
|
const devServer = {
|
|
760
771
|
host: "localhost",
|
|
761
772
|
port: 8080,
|
|
@@ -806,6 +817,10 @@ var unpluginFactory = (options) => ({
|
|
|
806
817
|
consola.fail("please provide target");
|
|
807
818
|
return;
|
|
808
819
|
}
|
|
820
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
821
|
+
consola.fail("target must be a domain");
|
|
822
|
+
return;
|
|
823
|
+
}
|
|
809
824
|
const devServer = {
|
|
810
825
|
host: "localhost",
|
|
811
826
|
port: 8080,
|
package/dist/webpack.js
CHANGED
package/package.json
CHANGED
package/src/caddy/index.ts
CHANGED
|
@@ -324,18 +324,22 @@ ${target.split(':')[0]}${https ? '' : ':80'} {
|
|
|
324
324
|
// caddy log
|
|
325
325
|
// eslint-disable-next-line no-console
|
|
326
326
|
showCaddyLog && line && console.info(line)
|
|
327
|
-
|
|
328
|
-
if (line.includes('
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
327
|
+
try {
|
|
328
|
+
if (line.includes('Error:') || (line && JSON.parse(line).level === 'error')) {
|
|
329
|
+
if (line.includes('parsing caddyfile tokens')) {
|
|
330
|
+
consola.error('Caddyfile syntax error, please contact the author:\n', `${this.caddyfile}\n\n${line}\n`)
|
|
331
|
+
await this.baseCleanup()
|
|
332
|
+
process.exit()
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
consola.error(`${line}\n`)
|
|
336
|
+
// child.kill()
|
|
337
|
+
return reject(line)
|
|
338
|
+
}
|
|
337
339
|
}
|
|
338
340
|
}
|
|
341
|
+
catch {}
|
|
342
|
+
|
|
339
343
|
if (line.includes('config file changed'))
|
|
340
344
|
consola.success('Detect added a new reverse proxy config, restarted.\n')
|
|
341
345
|
|
package/src/index.ts
CHANGED
|
@@ -102,6 +102,11 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
|
|
|
102
102
|
return
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
106
|
+
consola.fail('target must be a domain')
|
|
107
|
+
return
|
|
108
|
+
}
|
|
109
|
+
|
|
105
110
|
const _printUrls = server.printUrls.bind(server)
|
|
106
111
|
|
|
107
112
|
let source = `localhost:${config.server.port || 5173}`
|
|
@@ -138,6 +143,11 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
|
|
|
138
143
|
return
|
|
139
144
|
}
|
|
140
145
|
|
|
146
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
147
|
+
consola.fail('target must be a domain')
|
|
148
|
+
return
|
|
149
|
+
}
|
|
150
|
+
|
|
141
151
|
const devServer = {
|
|
142
152
|
host: 'localhost',
|
|
143
153
|
port: 8080,
|
|
@@ -200,6 +210,11 @@ export const unpluginFactory: UnpluginFactory<Options> = options => ({
|
|
|
200
210
|
return
|
|
201
211
|
}
|
|
202
212
|
|
|
213
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
214
|
+
consola.fail('target must be a domain')
|
|
215
|
+
return
|
|
216
|
+
}
|
|
217
|
+
|
|
203
218
|
const devServer = {
|
|
204
219
|
host: 'localhost',
|
|
205
220
|
port: 8080,
|
package/src/nuxt.ts
CHANGED
|
@@ -36,6 +36,11 @@ export default defineNuxtModule<ModuleOptions>({
|
|
|
36
36
|
return
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
if (target.match(/^(?:https?)?:\/\//)) {
|
|
40
|
+
consola.fail('target must be a domain')
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
// https://github.com/nuxt/cli/issues/220#issuecomment-1735394141
|
|
40
45
|
_nuxt.hook('listen', (_, listener) => {
|
|
41
46
|
const url = listener.url
|