@skylandnpm/octopus-proxy 0.1.27 → 0.1.30
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 +1 -1
- package/dist/{chunk-X2VENWTX.js → chunk-PYZSSOSD.js} +7 -1
- package/dist/cli.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ octopus-proxy onboard
|
|
|
15
15
|
|
|
16
16
|
向导默认使用 `https://octopus.wuyehao.com` 作为 Hub 地址;按需可输入其他地址,或用 `--hub-url` 指定。再次运行向导时会读取现有配置,直接回车即可保留各项设置;机器人 Secret 只提示已配置,不在终端显示原值。macOS 上选择编码工具时,向导优先显示已配置或探测到的命令路径,否则给出该工具的 macOS 路径示例;回车后会检查文件可执行性并运行版本命令,失败时要求重新输入。无交互环境可使用 `octopus-proxy onboard --non-interactive`,未提供 `--hub-url` 时也使用该默认地址;完整选项见 `octopus-proxy help`。安装服务后可运行 `octopus-proxy status` 和 `octopus-proxy doctor` 检查状态。
|
|
17
17
|
|
|
18
|
-
Proxy 始终使用独立的控制与文件 WebSocket;文件读取和上传不会回退到控制通道。两个通道会同时连接并各自重连,Hub 只会把文件命令发送到同一 Proxy
|
|
18
|
+
Proxy 始终使用独立的控制与文件 WebSocket;文件读取和上传不会回退到控制通道。两个通道会同时连接并各自重连,Hub 只会把文件命令发送到同一 Proxy 实例的已就绪文件通道。控制与文件连接在 `X-Octopus-Proxy-Instance-Id` 中分别使用 `:control`、`:files` 后缀;Hub 去除后缀再配对实例,因此即使反向代理把 `/ws/proxy-files` 重写为上游 `/ws/proxy`,也能正确识别文件通道。反向代理需转发 WebSocket Upgrade、Authorization、`X-Octopus-Bot-Id` 与 `X-Octopus-Proxy-Instance-Id`。同一套 bot ID 和 Secret 被另一台 Proxy 主机连接后,Hub 会让新实例接管,旧实例会同时关闭两个通道并停止自动重连;若要让旧实例重新接管,必须显式重启其服务。
|
|
19
19
|
|
|
20
20
|
添加授权项目时,填写项目 ID 后会询问是否继续添加;直接回车即可结束添加并继续保存配置。
|
|
21
21
|
|
|
@@ -16854,9 +16854,15 @@ async function runDaemon(configPath) {
|
|
|
16854
16854
|
}
|
|
16855
16855
|
function connect(files, attempt = 0) {
|
|
16856
16856
|
if (stopping || !binding.active) return;
|
|
16857
|
+
const current = files ? filesSocket : controlSocket;
|
|
16858
|
+
if (current && current.readyState !== WebSocket2.CLOSED) return;
|
|
16857
16859
|
const url = new URL(files ? "/ws/proxy-files" : "/ws/proxy", config.hubUrl);
|
|
16858
16860
|
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
|
16859
|
-
const headers = {
|
|
16861
|
+
const headers = {
|
|
16862
|
+
Authorization: `SecretKey ${config.secretKey}`,
|
|
16863
|
+
"X-Octopus-Bot-Id": config.botId,
|
|
16864
|
+
"X-Octopus-Proxy-Instance-Id": `${epoch}:${files ? "files" : "control"}`
|
|
16865
|
+
};
|
|
16860
16866
|
const socket = new WebSocket2(url, { headers, maxPayload: 3 * 1024 * 1024 });
|
|
16861
16867
|
sockets.add(socket);
|
|
16862
16868
|
if (files) {
|
package/dist/cli.js
CHANGED
package/dist/main.js
CHANGED