fix: resolve WebSocket protocol mismatch and expand AI prompt examples in process_repo
This commit is contained in:
+3
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user