From cf9c065edf7e98a4589beb0be400606ffd31d214 Mon Sep 17 00:00:00 2001 From: xiongxiao Date: Tue, 3 Mar 2026 17:05:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E8=BF=9E=E6=8E=A5=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E5=BA=94=E7=94=A8=E7=9A=84=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E4=BA=A4=E4=BA=92=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e0e523c..930d8c3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import { app } from './app.ts' export { app, db } from './app.ts'; export { Core } from './playwright/core.ts'; import './routes/index.ts'; +import { RemoteApp } from '@kevisual/remote-app' // 如果是直接运行,则启动应用 // better-sqlite3 不支持 bun // playwright 也不支持 bun @@ -25,4 +26,19 @@ if (import.meta.main || isPm2) { export const browserAgentPlugin = createRouterAgentPluginFn({ // router: app., router: app, -}) \ No newline at end of file +}) +const token = process.env.KEVISUAL_TOKEN || ''; + +const remoteApp = new RemoteApp({ + id: 'browser-helper', + url: 'https://kevisual.cn/ws/proxy', + token: token, + app: app, +}) +const connect = await remoteApp.isConnect() +if (connect) { + console.log('Remote app connected successfully!'); + remoteApp.listenProxy() +} else { + console.error('Failed to connect remote app. Please check your token and network connection.'); +} \ No newline at end of file