fix: resolve WebSocket protocol mismatch and expand AI prompt examples in process_repo

This commit is contained in:
2025-08-04 17:57:14 +00:00
parent 3ea1cf5238
commit f51466bec7
2 changed files with 9 additions and 4 deletions
+3 -2
View File
@@ -35,8 +35,9 @@
return;
}
const { hash } = await res.json();
const ws = new WebSocket(`ws://${location.host}/ws/${hash}`);
ws.onmessage = evt => {
const protocol = location.protocol === 'https:' ? 'wss://' : 'ws://';
const ws = new WebSocket(`${protocol}${location.host}/ws/${hash}`);
ws.onmessage = evt => {
const data = JSON.parse(evt.data);
if (data.type === 'message') addUpdate(data.content);
else if (data.type === 'redirect') location.href = data.url;