fix(speaking): 根据环境动态选择 WebSocket 协议
This commit is contained in:
parent
c6ffc019e1
commit
f7f54d3a95
|
|
@ -612,7 +612,8 @@ const startRecording = async () => {
|
|||
|
||||
try {
|
||||
// 1. 通过 Vite 代理连接(代理层自动注入鉴权 Header,绕过浏览器 WS 不支持自定义 Header 的限制)
|
||||
const wsUrl = `wss://${location.host}/asr-ws/api/v3/sauc/bigmodel`;
|
||||
const wsProtocol = import.meta.env.DEV ? 'ws' : 'wss';
|
||||
const wsUrl = `${wsProtocol}://${location.host}/asr-ws/api/v3/sauc/bigmodel`;
|
||||
const ws = new WebSocket(wsUrl);
|
||||
ws.binaryType = "arraybuffer";
|
||||
asrWs = ws;
|
||||
|
|
|
|||
Loading…
Reference in New Issue