This commit is contained in:
Rizky 2024-02-02 18:49:04 +07:00
parent 178533d435
commit dea1b48c7f
1 changed files with 3 additions and 1 deletions

View File

@ -154,7 +154,9 @@ const connect = (
url.pathname = "/sync";
url.protocol = url.protocol === "http:" ? "ws:" : "wss:";
const ws = new WebSocket(url.toString());
const ws = new WebSocket(
`${url.protocol}//${url.hostname}${url.pathname}`
);
ws.onopen = () => {
sendWs(ws, { type: SyncType.UserID, user_id, site_id, page_id });