vite-plugin-rpx 0.11.30 → 0.11.32
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/index.js +29 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -21775,7 +21775,8 @@ __export(exports_utils, {
|
|
|
21775
21775
|
getPrimaryDomain: () => getPrimaryDomain,
|
|
21776
21776
|
extractHostname: () => extractHostname,
|
|
21777
21777
|
execSudoSync: () => execSudoSync,
|
|
21778
|
-
debugLog: () => debugLog
|
|
21778
|
+
debugLog: () => debugLog,
|
|
21779
|
+
authorizeSystemAccess: () => authorizeSystemAccess
|
|
21779
21780
|
});
|
|
21780
21781
|
import { execSync } from "node:child_process";
|
|
21781
21782
|
import * as fs from "node:fs/promises";
|
|
@@ -21791,6 +21792,26 @@ function isProcessElevated() {
|
|
|
21791
21792
|
return false;
|
|
21792
21793
|
}
|
|
21793
21794
|
}
|
|
21795
|
+
function authorizeSystemAccess(options = {}) {
|
|
21796
|
+
if (process.platform === "win32")
|
|
21797
|
+
return true;
|
|
21798
|
+
if (isProcessElevated() || !!getSudoPassword())
|
|
21799
|
+
return true;
|
|
21800
|
+
const run = options.exec ?? execSync;
|
|
21801
|
+
try {
|
|
21802
|
+
run("sudo -n true", { stdio: "ignore" });
|
|
21803
|
+
return true;
|
|
21804
|
+
} catch {
|
|
21805
|
+
if (!options.interactive)
|
|
21806
|
+
return false;
|
|
21807
|
+
}
|
|
21808
|
+
try {
|
|
21809
|
+
run("sudo -v", { stdio: "inherit" });
|
|
21810
|
+
return true;
|
|
21811
|
+
} catch {
|
|
21812
|
+
return false;
|
|
21813
|
+
}
|
|
21814
|
+
}
|
|
21794
21815
|
function execSudoSync(command) {
|
|
21795
21816
|
if (isProcessElevated()) {
|
|
21796
21817
|
return execSync(command, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
|
|
@@ -24086,6 +24107,11 @@ var init_host_routes = () => {};
|
|
|
24086
24107
|
// ../rpx/src/sni.ts
|
|
24087
24108
|
import * as fsp from "node:fs/promises";
|
|
24088
24109
|
import * as path4 from "node:path";
|
|
24110
|
+
function withLowMemoryTls(tls) {
|
|
24111
|
+
if (Array.isArray(tls))
|
|
24112
|
+
return tls.map((entry) => ({ ...entry, lowMemoryMode: true }));
|
|
24113
|
+
return { ...tls, lowMemoryMode: true };
|
|
24114
|
+
}
|
|
24089
24115
|
function serverNameFromCertFilename(filename) {
|
|
24090
24116
|
if (!filename.endsWith(".crt"))
|
|
24091
24117
|
return null;
|
|
@@ -26959,7 +26985,7 @@ function createSharedProxyServer(opts) {
|
|
|
26959
26985
|
hostname: "0.0.0.0",
|
|
26960
26986
|
reusePort: shouldReusePort(),
|
|
26961
26987
|
...sslConfig ? {
|
|
26962
|
-
tls: Array.isArray(sslConfig) ? sslConfig.map((entry) => ({
|
|
26988
|
+
tls: withLowMemoryTls(Array.isArray(sslConfig) ? sslConfig.map((entry) => ({
|
|
26963
26989
|
serverName: entry.serverName,
|
|
26964
26990
|
key: entry.key,
|
|
26965
26991
|
cert: entry.cert
|
|
@@ -26969,7 +26995,7 @@ function createSharedProxyServer(opts) {
|
|
|
26969
26995
|
ca: sslConfig.ca,
|
|
26970
26996
|
requestCert: false,
|
|
26971
26997
|
rejectUnauthorized: false
|
|
26972
|
-
}
|
|
26998
|
+
})
|
|
26973
26999
|
} : {},
|
|
26974
27000
|
fetch(req, server) {
|
|
26975
27001
|
return sharedFetchHandler(req, server);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-rpx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.32",
|
|
5
5
|
"description": "A modern and smart reverse proxy. Vite plugin.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"typecheck": "bunx tsc --noEmit"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@stacksjs/rpx": "0.11.
|
|
50
|
+
"@stacksjs/rpx": "0.11.32",
|
|
51
51
|
"@stacksjs/tlsx": "^0.13.13"
|
|
52
52
|
},
|
|
53
53
|
"simple-git-hooks": {
|