unplugin-https-reverse-proxy 4.0.4 → 4.1.0-beta.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/README.md +30 -6
- package/dist/{chunk-5R33PUJP.js → chunk-7CA3EIIX.js} +681 -223
- package/dist/{chunk-2P7SUCQ3.js → chunk-EY3HXBJ4.js} +0 -26
- package/dist/chunk-RKHJN6KY.js +53 -0
- package/dist/esbuild.cjs +781 -300
- package/dist/esbuild.js +3 -2
- package/dist/index.cjs +781 -300
- package/dist/index.js +3 -2
- package/dist/nuxt.cjs +779 -290
- package/dist/nuxt.js +5 -9
- package/dist/privileged-helper.cjs +668 -0
- package/dist/privileged-helper.d.cts +2 -0
- package/dist/privileged-helper.d.ts +2 -0
- package/dist/privileged-helper.js +641 -0
- package/dist/rollup.cjs +781 -300
- package/dist/rollup.js +3 -2
- package/dist/rspack.cjs +781 -300
- package/dist/rspack.js +3 -2
- package/dist/utils.cjs +0 -28
- package/dist/utils.d.cts +1 -3
- package/dist/utils.d.ts +1 -3
- package/dist/utils.js +1 -5
- package/dist/vite.cjs +781 -300
- package/dist/vite.js +3 -2
- package/dist/webpack.cjs +781 -300
- package/dist/webpack.js +3 -2
- package/package.json +1 -4
- package/src/caddy/caddyfile.ts +1 -0
- package/src/caddy/index.ts +183 -110
- package/src/caddy/privileged.ts +118 -0
- package/src/caddy/utils.ts +0 -43
- package/src/index.ts +1 -15
- package/src/nuxt.ts +1 -6
- package/src/privileged/bootstrap.ts +174 -0
- package/src/privileged/client.ts +287 -0
- package/src/privileged/entry.ts +45 -0
- package/src/privileged/hosts-file.ts +142 -0
- package/src/privileged/launch.ts +193 -0
- package/src/privileged/ports.ts +45 -0
- package/src/privileged/protocol.ts +111 -0
- package/src/privileged/server.ts +465 -0
- package/src/privileged/session.ts +114 -0
- package/src/privileged/validation.ts +38 -0
- package/src/privileged/windows-elevation.ts +80 -0
- package/src/privileged-helper.ts +109 -0
- package/src/utils.ts +0 -28
- package/src/host/index.ts +0 -52
package/README.md
CHANGED
|
@@ -314,15 +314,39 @@ Please check [caddy path](https://github.com/zcf0508/unplugin-https-reverse-prox
|
|
|
314
314
|
## Usage
|
|
315
315
|
|
|
316
316
|
```bash
|
|
317
|
-
# macOS
|
|
318
|
-
sudo -E npm run dev # your dev script
|
|
319
|
-
# ^ `-E` is important
|
|
320
|
-
|
|
321
|
-
# windows
|
|
322
|
-
# use powershell as administrator
|
|
317
|
+
# macOS / Linux / Windows
|
|
323
318
|
npm run dev # your dev script
|
|
324
319
|
```
|
|
325
320
|
|
|
321
|
+
Run it as your normal user. The plugin starts a small privileged helper that
|
|
322
|
+
runs as administrator, and only that helper touches `/etc/hosts` and ports
|
|
323
|
+
80/443. Your dev server, its caches and `node_modules` stay owned by you.
|
|
324
|
+
|
|
325
|
+
On macOS and Linux the plugin asks for your password once when the dev server
|
|
326
|
+
starts, then reuses the sudo credential for the rest of the session. If you
|
|
327
|
+
already ran `sudo -v` in the same terminal, no prompt is shown.
|
|
328
|
+
|
|
329
|
+
The helper restores the hosts entries by itself when the dev server exits,
|
|
330
|
+
including when it is killed or crashes.
|
|
331
|
+
|
|
332
|
+
### Granting the permission once (optional)
|
|
333
|
+
|
|
334
|
+
To skip the password prompt entirely, allow the plugin's helper in
|
|
335
|
+
`/etc/sudoers.d/` (edit with `sudo visudo -f /etc/sudoers.d/uhrp`):
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
yourname ALL=(root) NOPASSWD: /usr/bin/killall -HUP mDNSResponder
|
|
339
|
+
yourname ALL=(root) NOPASSWD: /usr/bin/install -m 644 -o root -g wheel /tmp/uhrp-hosts.* /etc/hosts
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
The second rule only matters when the helper rewrites `/etc/hosts` through
|
|
343
|
+
`install`; adjust the paths to your platform.
|
|
344
|
+
|
|
345
|
+
### Windows
|
|
346
|
+
|
|
347
|
+
Run `npm run dev` normally. Windows raises a UAC prompt once, when the helper
|
|
348
|
+
is started through `Start-Process -Verb RunAs`.
|
|
349
|
+
|
|
326
350
|
If your broswer shows a not trusted certificate warning, please check the keychain.
|
|
327
351
|
|
|
328
352
|

|