multiclaws 0.4.11 → 0.4.12
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/infra/frp.js +5 -1
- package/package.json +1 -1
package/dist/infra/frp.js
CHANGED
|
@@ -244,8 +244,10 @@ class FrpTunnelManager {
|
|
|
244
244
|
const res = await fetch(url, { signal: AbortSignal.timeout(3_000) });
|
|
245
245
|
if (!res.ok)
|
|
246
246
|
continue;
|
|
247
|
+
// frpc 0.61.x admin API returns a flat array: [{name, status, ...}]
|
|
247
248
|
const data = (await res.json());
|
|
248
|
-
const
|
|
249
|
+
const proxies = Array.isArray(data) ? data : data.proxies;
|
|
250
|
+
const proxy = proxies?.find((p) => p.name === proxyName);
|
|
249
251
|
if (!proxy)
|
|
250
252
|
continue;
|
|
251
253
|
if (proxy.status === "running") {
|
|
@@ -275,10 +277,12 @@ class FrpTunnelManager {
|
|
|
275
277
|
const res = await fetch(`http://127.0.0.1:${this.adminPort}/api/proxy/tcp`, { signal: AbortSignal.timeout(5_000) });
|
|
276
278
|
if (!res.ok) {
|
|
277
279
|
this.logger.warn("[frp] health check: admin API returned non-OK");
|
|
280
|
+
this._status = { status: "error", reason: "admin API returned non-OK status" };
|
|
278
281
|
}
|
|
279
282
|
}
|
|
280
283
|
catch {
|
|
281
284
|
this.logger.warn("[frp] health check: failed to reach admin API");
|
|
285
|
+
this._status = { status: "error", reason: "admin API unreachable" };
|
|
282
286
|
}
|
|
283
287
|
}, HEALTH_CHECK_INTERVAL_MS);
|
|
284
288
|
// Don't prevent Node from exiting
|