feat: xray support

This commit is contained in:
zhom
2026-07-31 01:04:58 +04:00
parent 064bf297dd
commit 0a7d7803f2
112 changed files with 10291 additions and 772 deletions
+15 -4
View File
@@ -1,7 +1,8 @@
import { execSync, execFileSync } from "node:child_process";
import { execFileSync, execSync } from "node:child_process";
import { copyFileSync, existsSync, mkdirSync } from "node:fs";
import { join, dirname } from "node:path";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { downloadXray } from "./download-xray.mjs";
const MANIFEST_DIR = dirname(fileURLToPath(import.meta.url));
const PROFILE =
@@ -35,9 +36,18 @@ const isWindows = TARGET.includes("windows");
// Determine source directory
let srcDir;
if (TARGET === HOST_TARGET || TARGET === "unknown") {
srcDir = join(MANIFEST_DIR, "target", PROFILE === "release" ? "release" : "debug");
srcDir = join(
MANIFEST_DIR,
"target",
PROFILE === "release" ? "release" : "debug",
);
} else {
srcDir = join(MANIFEST_DIR, "target", TARGET, PROFILE === "release" ? "release" : "debug");
srcDir = join(
MANIFEST_DIR,
"target",
TARGET,
PROFILE === "release" ? "release" : "debug",
);
}
const destDir = join(MANIFEST_DIR, "binaries");
@@ -70,3 +80,4 @@ function copyBinary(baseName) {
}
copyBinary("donut-proxy");
await downloadXray(TARGET);