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);