generated from tailored/router-template
"feat: 更新ASR服务连接配置,优化录音流处理及模型路径"
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const isBrowser = process?.env?.BROWSER === 'true';
|
||||
const isBrowser = process?.env?.BROWSER === 'true' || typeof window !== 'undefined' && typeof window.document !== 'undefined';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
type WebSocketOptions = {
|
||||
@@ -17,7 +17,7 @@ export const initWs = async (url: string, options?: WebSocketOptions) => {
|
||||
const WebSocket = await import('ws').then((module) => module.default);
|
||||
const { rejectUnauthorized, headers, ...rest } = options || {};
|
||||
ws = new WebSocket(url, {
|
||||
rejectUnauthorized: rejectUnauthorized || true,
|
||||
rejectUnauthorized: rejectUnauthorized ?? true,
|
||||
headers: headers,
|
||||
...rest,
|
||||
}) as any;
|
||||
|
||||
Reference in New Issue
Block a user