ui: Add Websocket prefix settings (#449)

This commit is contained in:
yzx_28 authored and GitHub committed 2022-10-24 02:45:27 +08:00
1 parent 39e3d057fa
commit 0c587d1786
11 files changed
+14 -10

No files matched your search

@@ -37,7 +37,7 @@ const onmessage = (msg) => {
return true;
};
const url = new URL('/home/messages-conn', window.location.href);
const url = new URL(`${UiContext.ws_prefix}home/messages-conn`, window.location.href);
// TODO handle a better way for cookie
url.searchParams.append('sid', document.cookie);
const endpoint = url.toString().replace('http', 'ws');