unplugin-https-reverse-proxy 2.0.2 → 2.0.3-beta.1

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,769 +0,0 @@
1
- import {
2
- chmodRecursive,
3
- consola,
4
- generateQrcode,
5
- getIpv4List,
6
- isAdmin,
7
- once
8
- } from "./chunk-2P7SUCQ3.js";
9
-
10
- // src/index.ts
11
- import process4 from "node:process";
12
- import { Table } from "console-table-printer";
13
- import c from "picocolors";
14
- import { createUnplugin } from "unplugin";
15
-
16
- // src/caddy/index.ts
17
- import { spawn } from "node:child_process";
18
- import { chmodSync as chmodSync2, createWriteStream, existsSync, mkdirSync, unlinkSync, writeFileSync } from "node:fs";
19
- import { readFile, unlink, writeFile } from "node:fs/promises";
20
- import { platform } from "node:os";
21
- import { join as join2 } from "node:path";
22
- import process3 from "node:process";
23
- import { got } from "got-cjs";
24
- import { HttpProxyAgent } from "http-proxy-agent";
25
- import { HttpsProxyAgent } from "https-proxy-agent";
26
- import * as lockfile from "proper-lockfile";
27
-
28
- // src/host/index.ts
29
- import { exec } from "node:child_process";
30
- import { chmodSync } from "node:fs";
31
- import process from "node:process";
32
- import { promisify } from "node:util";
33
- import hostile from "hostile";
34
- var _setHost = promisify(hostile.set);
35
- var _removeHost = promisify(hostile.remove);
36
- function getPathOfSystemHostsPath() {
37
- return process.platform === "win32" ? `${process.env.windir || "C:\\WINDOWS"}\\system32\\drivers\\etc\\hosts` : "/etc/hosts";
38
- }
39
- async function syncHost() {
40
- return new Promise((resolve, _reject) => {
41
- exec(
42
- process.platform === "win32" ? "ipconfig /flushdns" : "sudo -E killall -HUP mDNSResponder",
43
- (error, _stdout, _stderr) => {
44
- if (error) {
45
- consola.error(`exec error: ${error}`);
46
- return resolve(false);
47
- }
48
- return resolve(true);
49
- }
50
- );
51
- });
52
- }
53
- async function addHost(ip, host) {
54
- if (process.platform !== "win32")
55
- chmodSync(getPathOfSystemHostsPath(), 511);
56
- await _setHost("127.0.0.1", "localhost");
57
- await _setHost(ip, host);
58
- if (ip === "localhost")
59
- await _setHost("127.0.0.1", host);
60
- return await syncHost();
61
- }
62
- async function removeHost(ip, host) {
63
- if (process.platform !== "win32")
64
- chmodSync(getPathOfSystemHostsPath(), 511);
65
- await _removeHost(ip, host);
66
- if (ip === "localhost")
67
- await _removeHost("127.0.0.1", host);
68
- return await syncHost();
69
- }
70
-
71
- // src/caddy/constants.ts
72
- import os from "node:os";
73
- import { join } from "node:path";
74
- import process2 from "node:process";
75
- import dotenvFlow from "dotenv-flow";
76
- dotenvFlow.config({
77
- silent: true
78
- });
79
- function resolvePath(path) {
80
- if (path.startsWith("~"))
81
- return join(os.homedir() || "", path.slice(1));
82
- return path;
83
- }
84
- var TEMP_DIR = resolvePath(process2.env.UHRP_CADDY_PATH || process2.env.TEMP || process2.env.TMPDIR || "/tmp");
85
- var caddyPath = join(TEMP_DIR, `caddy${process2.platform === "win32" ? ".exe" : ""}`);
86
- var caddyFilePath = join(TEMP_DIR, "CADDYFILE");
87
- var caddyLockFilePath = join(TEMP_DIR, "caddylock");
88
- var supportList = [
89
- {
90
- platform: "dragonfly",
91
- arch: "amd64"
92
- },
93
- {
94
- platform: "freebsd",
95
- arch: "amd64"
96
- },
97
- {
98
- platform: "freebsd",
99
- arch: "arm-6"
100
- },
101
- {
102
- platform: "freebsd",
103
- arch: "arm-7"
104
- },
105
- {
106
- platform: "freebsd",
107
- arch: "arm64"
108
- },
109
- {
110
- platform: "linux",
111
- arch: "amd64"
112
- },
113
- {
114
- platform: "linux",
115
- arch: "arm-5"
116
- },
117
- {
118
- platform: "linux",
119
- arch: "arm-6"
120
- },
121
- {
122
- platform: "linux",
123
- arch: "arm-7"
124
- },
125
- {
126
- platform: "linux",
127
- arch: "arm64"
128
- },
129
- {
130
- platform: "linux",
131
- arch: "mips"
132
- },
133
- {
134
- platform: "linux",
135
- arch: "mips64"
136
- },
137
- {
138
- platform: "linux",
139
- arch: "mips64le"
140
- },
141
- {
142
- platform: "linux",
143
- arch: "mipsle"
144
- },
145
- {
146
- platform: "linux",
147
- arch: "ppc64"
148
- },
149
- {
150
- platform: "linux",
151
- arch: "ppc64le"
152
- },
153
- {
154
- platform: "linux",
155
- arch: "s390x"
156
- },
157
- {
158
- platform: "darwin",
159
- arch: "amd64"
160
- },
161
- {
162
- platform: "darwin",
163
- arch: "arm64"
164
- },
165
- {
166
- platform: "openbsd",
167
- arch: "amd64"
168
- },
169
- {
170
- platform: "openbsd",
171
- arch: "arm-6"
172
- },
173
- {
174
- platform: "openbsd",
175
- arch: "arm-7"
176
- },
177
- {
178
- platform: "openbsd",
179
- arch: "arm64"
180
- },
181
- {
182
- platform: "windows",
183
- arch: "amd64"
184
- },
185
- {
186
- platform: "windows",
187
- arch: "arm-6"
188
- },
189
- {
190
- platform: "windows",
191
- arch: "arm-7"
192
- },
193
- {
194
- platform: "windows",
195
- arch: "arm64"
196
- }
197
- ];
198
-
199
- // src/caddy/utils.ts
200
- import { exec as exec2 } from "node:child_process";
201
- import { createServer } from "node:net";
202
- import ora from "ora";
203
- var spinner;
204
- function tryPort(port) {
205
- return new Promise((resolve, _reject) => {
206
- try {
207
- const server = createServer().listen(port);
208
- server.on("listening", () => {
209
- server.close();
210
- resolve(false);
211
- });
212
- server.on("error", (err) => {
213
- if (err.code === "EADDRINUSE")
214
- resolve(true);
215
- server.close();
216
- });
217
- } catch {
218
- resolve(true);
219
- }
220
- });
221
- }
222
- async function kill(port) {
223
- return new Promise((resolve, reject) => {
224
- exec2(`npx @maxbo/free-port ${port} -s`, (err, stdout, _stderr) => {
225
- if (err) {
226
- reject(err);
227
- } else {
228
- consola.log(stdout);
229
- resolve();
230
- }
231
- });
232
- });
233
- }
234
- function getNumber(number) {
235
- if (number <= 0)
236
- return "0%";
237
- else if (number < 100)
238
- return `${number.toFixed(2)}%`;
239
- else
240
- return "100%";
241
- }
242
- function logProgress(percent) {
243
- if (!spinner) {
244
- consola.log("");
245
- spinner = ora({
246
- text: "Start Download Caddy: 0%",
247
- indent: 2
248
- });
249
- spinner.start();
250
- } else {
251
- spinner.text = `Download Caddy: ${getNumber(Number(percent) * 100)}`;
252
- }
253
- }
254
- function logProgressOver() {
255
- if (!spinner) {
256
- spinner = ora({
257
- text: "Start Download Caddy: 100%",
258
- indent: 2
259
- });
260
- spinner.start();
261
- } else {
262
- spinner.succeed();
263
- consola.log("");
264
- }
265
- }
266
-
267
- // src/caddy/index.ts
268
- async function download() {
269
- if (await testCaddy())
270
- return caddyPath;
271
- return new Promise((resolve, reject) => {
272
- if (!existsSync(TEMP_DIR)) {
273
- mkdirSync(TEMP_DIR, { recursive: true });
274
- chmodSync2(TEMP_DIR, 511);
275
- }
276
- const file = createWriteStream(caddyPath);
277
- let _platform = platform().toString();
278
- _platform === "win32" && (_platform = "windows");
279
- let _arch = process3.arch.toString();
280
- _arch === "x64" && (_arch = "amd64");
281
- const support = supportList.find((item) => item.platform === _platform && item.arch === _arch);
282
- if (!support)
283
- return reject(new Error("not support"));
284
- const dowmloadLink = `https://caddyserver.com/api/download?os=${support.platform}&arch=${support.arch}&p=github.com%2Fcaddyserver%2Fforwardproxy`;
285
- existsSync(caddyPath) && unlinkSync(caddyPath);
286
- const httpProxy = process3.env.HTTP_PROXY || process3.env.http_proxy;
287
- const httpsProxy = process3.env.HTTPS_PROXY || process3.env.https_proxy;
288
- const httpAgent = httpProxy ? new HttpProxyAgent(httpProxy) : void 0;
289
- const httpsAgent = httpsProxy ? new HttpsProxyAgent(httpsProxy) : void 0;
290
- const chmodCaddyOnce = once(() => {
291
- chmodSync2(caddyPath, 511);
292
- });
293
- got.stream(dowmloadLink, {
294
- agent: {
295
- http: httpAgent,
296
- https: httpsAgent
297
- }
298
- }).on("downloadProgress", (progress) => {
299
- logProgress(progress.percent);
300
- chmodCaddyOnce();
301
- }).pipe(file).on("finish", () => {
302
- logProgressOver();
303
- if (process3.platform === "win32")
304
- return resolve(caddyPath);
305
- chmodSync2(caddyPath, 511);
306
- resolve(caddyPath);
307
- }).on("error", (err) => {
308
- reject(err);
309
- });
310
- });
311
- }
312
- function testCaddy() {
313
- return new Promise((resolve, reject) => {
314
- if (!existsSync(caddyPath))
315
- return resolve(false);
316
- chmodSync2(caddyPath, 511);
317
- const child = process3.platform === "win32" ? spawn(caddyPath, []) : spawn("sudo", ["-E", caddyPath]);
318
- child.on("close", () => {
319
- return resolve(false);
320
- });
321
- child.on("error", (err) => {
322
- return reject(err);
323
- });
324
- child.stdout.on("data", (_data) => {
325
- return resolve(true);
326
- });
327
- });
328
- }
329
- var CaddyInstant = class {
330
- constructor() {
331
- this.inited = false;
332
- this.stoped = false;
333
- /** has locked */
334
- this.locked = false;
335
- testCaddy().then(async () => {
336
- await this.getCaddyfile();
337
- this.inited = true;
338
- });
339
- this.locked = this.checkLock();
340
- }
341
- checkLock() {
342
- if (!existsSync(caddyLockFilePath))
343
- writeFileSync(caddyLockFilePath, "");
344
- return lockfile.checkSync(caddyLockFilePath);
345
- }
346
- async getCaddyfile() {
347
- if (!existsSync(caddyFilePath))
348
- await this.initCaddyfile();
349
- this.caddyfile = await readFile(caddyFilePath, "utf-8");
350
- return this.caddyfile;
351
- }
352
- async initCaddyfile() {
353
- const contet = `
354
- {
355
- debug
356
- auto_https disable_redirects
357
- }
358
-
359
- :7601 {
360
- root * "${join2(
361
- process3.platform === "win32" ? `${process3.env.AppData}/Caddy` : `${process3.env.HOME}/Library/Application Support/Caddy`,
362
- "./pki/authorities/local"
363
- )}"
364
- file_server browse
365
- }
366
-
367
- # \u6B63\u5411\u4EE3\u7406\u914D\u7F6E
368
- :7600 {
369
- bind 0.0.0.0
370
-
371
- forward_proxy {
372
- hide_ip
373
- hide_via
374
- acl {
375
- allow all
376
- }
377
- }
378
- }
379
- `;
380
- await writeFile(caddyFilePath, contet);
381
- this.caddyfile = contet;
382
- }
383
- async writeCaddyfile() {
384
- return await writeFile(caddyFilePath, this.caddyfile || "");
385
- }
386
- async deleteCaddyfile() {
387
- return await unlink(caddyFilePath);
388
- }
389
- async init() {
390
- await download();
391
- this.inited = true;
392
- }
393
- /**
394
- * @param source like `127.0.0.1:8080`
395
- * @param target like `test.abc.com`. And if you provide a port ,it will be ignore.
396
- */
397
- async run(source, target, options) {
398
- source = source.replace("0.0.0.0", "127.0.0.1");
399
- const {
400
- restore = true,
401
- base = "/",
402
- showCaddyLog = false,
403
- https = false
404
- } = options || {};
405
- this._source = source;
406
- this._target = target;
407
- if (!this.inited)
408
- await this.init();
409
- if (!await addHost(source.split(":")[0], target.split(":")[0]))
410
- throw new Error("update host failed");
411
- consola.success("update host success\n");
412
- await this.getCaddyfile();
413
- if (!(this.caddyfile || "").includes(`${target.split(":")[0]}${https ? "" : ":80"}`)) {
414
- this.caddyfile = `${this.caddyfile}
415
- ${target.split(":")[0]}${https ? "" : ":80"} {
416
- ${https ? "tls internal" : ""}
417
- reverse_proxy http://${source} {
418
- health_uri ${base}
419
- health_interval 2s
420
- health_timeout 5s
421
- fail_duration 2s
422
- unhealthy_status 502 503 504 404
423
- lb_try_duration 3s
424
- lb_try_interval 300ms
425
- health_headers {
426
- Accept text/html
427
- Accept-Encoding gzip, deflate, br
428
- User-Agent Caddy-Health-Check
429
- }
430
-
431
- @error status 502 503 504 404
432
- handle_response @error {
433
- respond * 503 {
434
- body "Service Unavailable"
435
- close
436
- }
437
- }
438
- }
439
- }
440
- `;
441
- await this.writeCaddyfile();
442
- }
443
- if (!existsSync(caddyLockFilePath))
444
- writeFileSync(caddyLockFilePath, "");
445
- if (!this.locked) {
446
- if (await tryPort(443))
447
- await kill(443);
448
- if ((process3.platform === "win32" || !https) && await tryPort(80))
449
- await kill(80);
450
- }
451
- return new Promise((resolve, reject) => {
452
- var _a, _b;
453
- const setupCleanup = () => {
454
- process3.on("SIGINT", async () => {
455
- if (this.stoped)
456
- return;
457
- process3.stdin.resume();
458
- try {
459
- await this.baseCleanup(restore);
460
- } finally {
461
- this.stoped = true;
462
- process3.nextTick(() => {
463
- process3.exit();
464
- });
465
- }
466
- });
467
- const originalExit = process3.exit.bind(process3);
468
- process3.exit = async (code) => {
469
- const port = Number(source.split(":")[1]);
470
- if (!Number.isNaN(port) && await tryPort(port))
471
- await kill(port);
472
- const pwd = process3.cwd();
473
- const viteCacheDir = `${pwd}/node_modules/.vite`;
474
- if (existsSync(viteCacheDir))
475
- await chmodRecursive(viteCacheDir, 511).catch(() => {
476
- });
477
- const nuxtCacheDir = `${pwd}/.nuxt`;
478
- if (existsSync(nuxtCacheDir))
479
- await chmodRecursive(nuxtCacheDir, 511).catch(() => {
480
- });
481
- const webpackCacheDir = `${pwd}/node_modules/.cache`;
482
- if (existsSync(webpackCacheDir))
483
- await chmodRecursive(webpackCacheDir, 511).catch(() => {
484
- });
485
- if (this.stoped)
486
- return originalExit(code);
487
- process3.stdin.resume();
488
- try {
489
- await this.baseCleanup();
490
- } finally {
491
- this.stoped = true;
492
- process3.nextTick(() => {
493
- originalExit(code);
494
- });
495
- }
496
- };
497
- };
498
- if (!this.locked) {
499
- this._caddyChild = process3.platform !== "win32" ? spawn("sudo", ["-E", caddyPath, "run", "--config", caddyFilePath, "--watch"]) : spawn(caddyPath, ["run", "--config", caddyFilePath, "--watch"]);
500
- lockfile.lockSync(caddyLockFilePath);
501
- this._caddyChild.on("error", (err) => {
502
- return reject(err);
503
- });
504
- (_a = this._caddyChild.stderr) == null ? void 0 : _a.on("data", async (data) => {
505
- const lines = data.toString().split("\n").map((line) => line.trim());
506
- for (const line of lines) {
507
- showCaddyLog && line && console.info(line);
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}
512
-
513
- ${line}
514
- `);
515
- await this.baseCleanup();
516
- process3.exit();
517
- } else {
518
- consola.error(`${line}
519
- `);
520
- return reject(line);
521
- }
522
- }
523
- } catch {
524
- }
525
- if (line.includes("config file changed"))
526
- consola.success("Detect added a new reverse proxy config, restarted.\n");
527
- if (line.includes("caddy proxying") || line.includes("serving initial"))
528
- return resolve();
529
- }
530
- });
531
- (_b = this._caddyChild.stdout) == null ? void 0 : _b.on("data", (_data) => {
532
- consola.info(_data.toString());
533
- resolve();
534
- });
535
- setupCleanup();
536
- } else {
537
- consola.info("Caddy is running in another process.");
538
- setupCleanup();
539
- return resolve();
540
- }
541
- });
542
- }
543
- async baseCleanup(restore = true) {
544
- var _a;
545
- try {
546
- if (restore && this._source && this._target) {
547
- if (await removeHost(this._source.split(":")[0], this._target.split(":")[0]))
548
- consola.success("Restore host success.\n");
549
- else
550
- consola.fail("Restore host failed.\n");
551
- }
552
- } catch (e) {
553
- consola.error(e);
554
- consola.fail("Restore host failed.\n");
555
- }
556
- if (!this.locked && !this.stoped) {
557
- (_a = this._caddyChild) == null ? void 0 : _a.kill();
558
- try {
559
- await lockfile.unlock(caddyLockFilePath).catch(() => {
560
- });
561
- await unlink(caddyFilePath).catch(() => {
562
- });
563
- await unlink(caddyLockFilePath).catch(() => {
564
- });
565
- } catch (e) {
566
- consola.error(e);
567
- }
568
- }
569
- }
570
- };
571
-
572
- // src/index.ts
573
- var config;
574
- var caddy;
575
- var cwd = process4.cwd();
576
- function colorUrl(url) {
577
- return c.green(url.replace(/:(\d+)\//, (_, port) => `:${c.bold(port)}/`));
578
- }
579
- async function printForwardProxy() {
580
- const ipv4List = getIpv4List();
581
- if (ipv4List.length) {
582
- const ips = ipv4List.map((ip) => c.cyan(ip)).join(", ");
583
- consola.info(`${c.bold("Mobile device proxy access")}:
584
- `);
585
- consola.info("1. Install certificate: scan the QR code and download the `root.crt` file,");
586
- consola.info(" then install it on your mobile device");
587
- const ipTable = await Promise.all(
588
- ipv4List.map(async (ip) => ({
589
- target: `http://${ip}:7601`,
590
- certificate: await generateQrcode(`http://${ip}:7601`)
591
- }))
592
- );
593
- const table = new Table({
594
- columns: [
595
- { name: "target", alignment: "left" },
596
- { name: "certificate", alignment: "center", minLen: 28 }
597
- ]
598
- });
599
- ipTable.forEach((ip) => {
600
- table.addRow(ip);
601
- });
602
- table.printTable();
603
- consola.info(`2. Set proxy on mobile device (Available IPs: ${ips}):${c.bold(7600)}
604
-
605
- `);
606
- }
607
- }
608
- var vitePrintUrls = once((options, source, target, base = "/", _printUrls) => {
609
- _printUrls == null ? void 0 : _printUrls();
610
- if (caddy)
611
- return;
612
- caddy = new CaddyInstant();
613
- caddy.run(source, target, {
614
- base,
615
- ...options
616
- }).then(async () => {
617
- await printForwardProxy();
618
- consola.success(` ${c.green("\u279C")} ${c.bold("run caddy reverse proxy success")}: ${colorUrl(`${options.https ? "https" : "http"}://${target}${base}`)}`);
619
- }).catch((e) => {
620
- throw e;
621
- });
622
- });
623
- var unpluginFactory = (options) => ({
624
- name: "unplugin-https-reverse-proxy",
625
- enforce: "pre",
626
- vite: {
627
- configResolved(_config) {
628
- config = _config;
629
- },
630
- configureServer(server) {
631
- var _a;
632
- if (config.command !== "serve")
633
- return;
634
- const {
635
- enable = true,
636
- target = ""
637
- } = options;
638
- if (!enable)
639
- return;
640
- if (!isAdmin()) {
641
- consola.warn("please run as administrator");
642
- return;
643
- }
644
- if (!target) {
645
- consola.fail("please provide target");
646
- return;
647
- }
648
- if (target.match(/^(?:https?)?:\/\//)) {
649
- consola.fail("target must be a domain");
650
- return;
651
- }
652
- const _printUrls = server.printUrls.bind(server);
653
- let source = `localhost:${config.server.port || 5173}`;
654
- const url = (_a = server.resolvedUrls) == null ? void 0 : _a.local[0];
655
- if (url) {
656
- const u = new URL(url);
657
- source = u.host;
658
- }
659
- const base = server.config.base || "/";
660
- server.printUrls = () => vitePrintUrls(options, source, target, base, _printUrls);
661
- }
662
- },
663
- webpack(compiler) {
664
- var _a, _b;
665
- if (process4.env.NODE_ENV !== "development")
666
- return;
667
- const {
668
- enable = true,
669
- target = ""
670
- } = options;
671
- if (!enable)
672
- return;
673
- if (!isAdmin()) {
674
- consola.warn("please run as administrator");
675
- return;
676
- }
677
- if (!target) {
678
- consola.fail("please provide target");
679
- return;
680
- }
681
- if (target.match(/^(?:https?)?:\/\//)) {
682
- consola.fail("target must be a domain");
683
- return;
684
- }
685
- const devServer = {
686
- host: "localhost",
687
- port: 8080,
688
- ...compiler.options.devServer,
689
- // @ts-expect-error vuecli
690
- ...(_a = process4.VUE_CLI_SERVICE) == null ? void 0 : _a.projectOptions.devServer
691
- };
692
- const source = `${devServer.host}:${devServer.port}`;
693
- if (caddy)
694
- return;
695
- const _close = (_b = compiler.close) == null ? void 0 : _b.bind(compiler);
696
- if (_close) {
697
- compiler.close = async (callback) => {
698
- process4.on("exit", () => {
699
- _close && _close(callback);
700
- });
701
- };
702
- } else {
703
- options.https = false;
704
- }
705
- caddy = new CaddyInstant();
706
- caddy.run(source, target, {
707
- ...options
708
- }).then(() => {
709
- compiler.hooks.done.tap("unplugin-https-reverse-proxy", async () => {
710
- await printForwardProxy();
711
- consola.success(` ${c.green("\u279C")} ${c.bold("run caddy reverse proxy success")}: ${colorUrl(`${options.https ? "https" : "http"}://${target}`)}`);
712
- });
713
- }).catch((e) => {
714
- throw e;
715
- });
716
- },
717
- async rspack(compiler) {
718
- var _a, _b, _c;
719
- if (process4.env.NODE_ENV !== "development")
720
- return;
721
- const {
722
- enable = true,
723
- target = ""
724
- } = options;
725
- if (!enable)
726
- return;
727
- if (!isAdmin()) {
728
- consola.warn("please run as administrator");
729
- return;
730
- }
731
- if (!target) {
732
- consola.fail("please provide target");
733
- return;
734
- }
735
- if (target.match(/^(?:https?)?:\/\//)) {
736
- consola.fail("target must be a domain");
737
- return;
738
- }
739
- const devServer = {
740
- host: "localhost",
741
- port: 8080,
742
- ...compiler.options.devServer,
743
- ...(_c = (_b = await ((_a = await import("@rsbuild/core")) == null ? void 0 : _a.loadConfig({
744
- cwd
745
- }))) == null ? void 0 : _b.content) == null ? void 0 : _c.server
746
- };
747
- const source = `${devServer.host}:${devServer.port}`;
748
- if (caddy)
749
- return;
750
- caddy = new CaddyInstant();
751
- caddy.run(source, target, {
752
- ...options
753
- }).then(async () => {
754
- await printForwardProxy();
755
- consola.success(` ${c.green("\u279C")} ${c.bold("run caddy reverse proxy success")}: ${colorUrl(`${options.https ? "https" : "http"}://${target}`)}`);
756
- }).catch((e) => {
757
- throw e;
758
- });
759
- }
760
- });
761
- var unplugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
762
- var src_default = unplugin;
763
-
764
- export {
765
- vitePrintUrls,
766
- unpluginFactory,
767
- unplugin,
768
- src_default
769
- };