feat: add ttyd terminal support, parallel startup in frpc.js
Made-with: Cursor
This commit is contained in:
@@ -4,7 +4,7 @@ const WebSocket = require('ws');
|
||||
const config = require('./config');
|
||||
const { getBoxId } = require('./fingerprint');
|
||||
const { collect } = require('./metrics');
|
||||
const { getDashboardInfo, FrpcManager } = require('./frpc');
|
||||
const { getDashboardInfo, startTtyd, FrpcManager } = require('./frpc');
|
||||
|
||||
const MAX_BACKOFF_MS = 60_000;
|
||||
|
||||
@@ -22,7 +22,12 @@ class ClawClient {
|
||||
|
||||
async start() {
|
||||
console.log(`[clawd] 启动中... 服务器 = ${this._cfg.server}`);
|
||||
this._dashInfo = await getDashboardInfo();
|
||||
// 并行:获取 openclaw dashboard 信息 + 启动 ttyd
|
||||
const [dashInfo] = await Promise.all([
|
||||
getDashboardInfo(),
|
||||
startTtyd().catch(e => console.warn('[ttyd] 启动失败:', e.message)),
|
||||
]);
|
||||
this._dashInfo = dashInfo || {};
|
||||
this._connect();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user