parent
3a8e7dd766
commit
dcfc6b33da
@ -1,8 +1,8 @@
|
|||||||
import { processMessage } from "./messagesProcessor.js";
|
import { messageProcessor } from "@radioiceberg/message-processor";
|
||||||
|
|
||||||
const socketProtocol = location.protocol === "http:" ? "ws:" : "wss:";
|
const socketProtocol = location.protocol === "http:" ? "ws:" : "wss:";
|
||||||
|
|
||||||
export async function connectToServer() {
|
export async function connectToServer() {
|
||||||
const ws = new WebSocket(`${socketProtocol}//${location.host}/meta`);
|
const ws = new WebSocket(`${socketProtocol}//${location.host}/meta`);
|
||||||
ws.addEventListener("message", processMessage);
|
ws.addEventListener("message", messageProcessor.processMessage);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue