@skylandnpm/octopus-proxy 0.1.47 → 0.1.48
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.
|
@@ -4086,7 +4086,7 @@ var z = /* @__PURE__ */ Object.freeze({
|
|
|
4086
4086
|
});
|
|
4087
4087
|
|
|
4088
4088
|
// src/remote-protocol.ts
|
|
4089
|
-
var REMOTE_DEFAULTS = Object.freeze({ totalBitrate:
|
|
4089
|
+
var REMOTE_DEFAULTS = Object.freeze({ totalBitrate: 5e6, videoMaxBitrate: 4e6, clipboardBitrate: 5e4, maxWidth: 2560, maxHeight: 1440, maxFps: 30 });
|
|
4090
4090
|
var stunUrl = z.string().max(256).regex(/^stun:(?:\[[0-9a-fA-F:]+\]|[a-zA-Z0-9.-]+)(?::[0-9]{1,5})?$/, "\u4EC5\u5141\u8BB8 stun: \u4E3B\u673A[:\u7AEF\u53E3]\uFF0C\u7981\u6B62 TURN").refine((url) => {
|
|
4091
4091
|
const port = /:(\d+)$/.exec(url);
|
|
4092
4092
|
return !port || Number(port[1]) >= 1 && Number(port[1]) <= 65535;
|
|
@@ -4094,8 +4094,8 @@ var stunUrl = z.string().max(256).regex(/^stun:(?:\[[0-9a-fA-F:]+\]|[a-zA-Z0-9.-
|
|
|
4094
4094
|
var RemoteConfigSchema = z.object({
|
|
4095
4095
|
enabled: z.boolean().default(true),
|
|
4096
4096
|
stunUrls: z.array(stunUrl).min(1).max(4).optional(),
|
|
4097
|
-
totalBitrate: z.number().int().min(1e5).max(
|
|
4098
|
-
videoMaxBitrate: z.number().int().min(5e4).max(
|
|
4097
|
+
totalBitrate: z.number().int().min(1e5).max(5e6).default(REMOTE_DEFAULTS.totalBitrate),
|
|
4098
|
+
videoMaxBitrate: z.number().int().min(5e4).max(4e6).default(REMOTE_DEFAULTS.videoMaxBitrate),
|
|
4099
4099
|
ffmpeg: z.string().min(1).default("ffmpeg")
|
|
4100
4100
|
}).strict().refine((c) => c.videoMaxBitrate <= c.totalBitrate * 0.8, "\u89C6\u9891\u989D\u5EA6\u4E0D\u5F97\u8D85\u8FC7\u603B\u9884\u7B97\u7684 80%");
|
|
4101
4101
|
var SignalSchema = z.discriminatedUnion("kind", [
|
|
@@ -4120,7 +4120,7 @@ var InputSchema = z.discriminatedUnion("kind", [
|
|
|
4120
4120
|
z.object({ ...envelope, kind: z.literal("ping") }).strict()
|
|
4121
4121
|
]);
|
|
4122
4122
|
function capVideoSdp(sdp, bitrate) {
|
|
4123
|
-
const limit = Math.max(5e4, Math.min(
|
|
4123
|
+
const limit = Math.max(5e4, Math.min(4e6, Math.floor(bitrate)));
|
|
4124
4124
|
const lines = sdp.split(/\r?\n/), result = [];
|
|
4125
4125
|
let video = false;
|
|
4126
4126
|
for (const line of lines) {
|
package/dist/cli.js
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
supportedPlatform,
|
|
30
30
|
systemdUnitPath,
|
|
31
31
|
toolSearchDirs
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-DSAJ4SAH.js";
|
|
33
33
|
import {
|
|
34
34
|
DESKTOP_PERMISSION_GUIDANCE,
|
|
35
35
|
PlatformDesktop,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
checkDesktop,
|
|
38
38
|
ensureHostAuth,
|
|
39
39
|
requestDesktopPermission
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-KRNEKDBF.js";
|
|
41
41
|
|
|
42
42
|
// src/cli.ts
|
|
43
43
|
import { spawn as spawn2 } from "node:child_process";
|
package/dist/main.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ConfigError,
|
|
4
4
|
runDaemon
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-DSAJ4SAH.js";
|
|
6
|
+
import "./chunk-KRNEKDBF.js";
|
|
7
7
|
|
|
8
8
|
// src/main.ts
|
|
9
9
|
runDaemon(process.env.OCTOPUS_PROXY_CONFIG ?? "proxy.json").catch((error) => {
|
package/dist/remote-worker.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
nativeProcess,
|
|
11
11
|
parseXrandr,
|
|
12
12
|
terminateNative
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KRNEKDBF.js";
|
|
14
14
|
|
|
15
15
|
// src/remote-worker.ts
|
|
16
16
|
import rtc from "@roamhq/wrtc";
|
|
@@ -19,6 +19,7 @@ import { promisify } from "node:util";
|
|
|
19
19
|
import { timingSafeEqual } from "node:crypto";
|
|
20
20
|
|
|
21
21
|
// src/remote-budget.ts
|
|
22
|
+
var FRAME_RATES = [30, 20, 15, 12];
|
|
22
23
|
function transportBytes(stats) {
|
|
23
24
|
let bytes = 0, packets = 0, available, rtt = 0;
|
|
24
25
|
for (const row of stats) {
|
|
@@ -56,7 +57,7 @@ var RemoteBudget = class {
|
|
|
56
57
|
this.clipboardPaused = true;
|
|
57
58
|
this.quiet = 0;
|
|
58
59
|
this.videoBitrate = Math.max(5e4, Math.floor(Math.min(this.videoBitrate * 0.8, (available ?? this.total) * 0.7)));
|
|
59
|
-
if (this.fpsIndex <
|
|
60
|
+
if (this.fpsIndex < FRAME_RATES.length - 1) this.fpsIndex++;
|
|
60
61
|
else if (this.tier < 2) this.tier++;
|
|
61
62
|
} else {
|
|
62
63
|
if (this.bitrate < this.total * 0.75 && rtt < 0.2) this.clipboardPaused = false;
|
|
@@ -72,7 +73,7 @@ var RemoteBudget = class {
|
|
|
72
73
|
return before !== `${this.tier}:${this.fpsIndex}:${this.videoBitrate}`;
|
|
73
74
|
}
|
|
74
75
|
video(width, height) {
|
|
75
|
-
return { ...fitVideo(width, height, this.tier), fps: [
|
|
76
|
+
return { ...fitVideo(width, height, this.tier), fps: FRAME_RATES[this.fpsIndex], videoBitrate: this.videoBitrate };
|
|
76
77
|
}
|
|
77
78
|
};
|
|
78
79
|
var TokenBucket = class {
|
package/package.json
CHANGED