feat: frpc uses WebSocket over port 443 for firewall compatibility

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-04-09 17:15:44 +08:00
parent c1c51843c4
commit d9f826f978

View File

@@ -144,16 +144,22 @@ function downloadFile(url, dest) {
}
function writeFrpcConfig(clawId, frpConfig) {
const { server, port, auth_token, dashboard_local_port = 18789 } = frpConfig;
const { auth_token, dashboard_local_port = 18789 } = frpConfig;
const ttyRemotePort = 10000 + Number(clawId);
// 固定使用 WebSocket over HTTPS (443),可穿透仅开放 443 的网络环境;
// 旧版 clawd 仍使用后端下发的 server:7000TCP两者并存互不影响。
const toml = `# 由 clawd 自动生成,请勿手动修改
serverAddr = "${server}"
serverPort = ${port}
serverAddr = "frp.claw.cutos.ai"
serverPort = 443
[auth]
method = "token"
token = "${auth_token}"
[transport]
protocol = "websocket"
tls.enable = true
[[proxies]]
name = "dashboard-${clawId}"
type = "http"