feat: SSH STCP key generation and frp tunnel registration

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
stswangzhiping
2026-05-02 18:07:33 +08:00
parent 7fe1ee64d8
commit 1a7e0a9738
3 changed files with 36 additions and 14 deletions

View File

@@ -370,15 +370,16 @@ class ClawClient {
_sendConnect() {
const msg = {
type: 'connect',
box_id: this._boxId,
claw_id: this._cfg.claw_id ?? null,
token: this._cfg.token ?? null,
version: CLAWD_VERSION,
type: 'connect',
box_id: this._boxId,
claw_id: this._cfg.claw_id ?? null,
token: this._cfg.token ?? null,
version: CLAWD_VERSION,
ssh_secret_key: this._cfg.ssh_secret_key ?? null,
local_ip: getLocalIps(),
local_networks: getLocalNetworks(),
external_ip: this._externalIp ?? null,
location: this._location ?? null,
location: this._location ?? null,
...this._dashInfo,
};
this._send(msg);
@@ -437,7 +438,7 @@ class ClawClient {
this._applyStatus(msg);
if (msg.frp && msg.frp.server && msg.frp.auth_token) {
this._frpc.start(msg.claw_id, msg.frp).catch(e => {
this._frpc.start(msg.claw_id, msg.frp, this._cfg.ssh_secret_key ?? null).catch(e => {
log.error('frpc', '启动失败:', e.message);
});
}