From 39e99e8d72b15a70bc9d0102b0569a762e5ee7c4 Mon Sep 17 00:00:00 2001 From: "shunfeng.zhou" Date: Sun, 13 Apr 2025 14:24:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8ws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webview/src/store/chat.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/webview/src/store/chat.ts b/webview/src/store/chat.ts index 4845d5c..e727086 100644 --- a/webview/src/store/chat.ts +++ b/webview/src/store/chat.ts @@ -76,14 +76,14 @@ export class WebSocketService { } // 检查环境和协议 - const isVsCodeWebview = typeof window !== 'undefined' && 'acquireVsCodeApi' in window; + // const isVsCodeWebview = typeof window !== 'undefined' && 'acquireVsCodeApi' in window; const isLocalhost = wsUrl.includes('localhost') || wsUrl.includes('127.0.0.1'); // VS Code WebView环境下可能需要wss - if (isVsCodeWebview && wsUrl.startsWith('ws://')) { - this.logger('[WebSocketService] 在VS Code WebView中,尝试使用安全WebSocket连接'); - wsUrl = wsUrl.replace('ws://', 'wss://'); - } + // if (isVsCodeWebview && wsUrl.startsWith('ws://')) { + // this.logger('[WebSocketService] 在VS Code WebView中,尝试使用安全WebSocket连接'); + // wsUrl = wsUrl.replace('ws://', 'wss://'); + // } this.logger(`[WebSocketService] 最终WebSocket URL: ${wsUrl}`); this.socket = new WebSocket(wsUrl);