Stuff & things.
This commit is contained in:
@@ -28,7 +28,13 @@ import { renderChat } from "./render.js";
|
||||
* @returns {{ socket: WebSocket, sendMessage: (content: string) => void }}
|
||||
*/
|
||||
export function initWebSocket(username, chatEl, inputContainer, usersListEl) {
|
||||
const socket = new WebSocket("ws://localhost:8080", "coms");
|
||||
const socket = new WebSocket(
|
||||
(location.protocol === "https:" ? "wss" : "ws") +
|
||||
"://" +
|
||||
location.host +
|
||||
"/ws",
|
||||
"coms",
|
||||
);
|
||||
|
||||
socket.onopen = () => {
|
||||
// Announce join.
|
||||
|
||||
Reference in New Issue
Block a user