Server handles join packets nicely.

This commit is contained in:
2026-02-21 11:28:00 -05:00
parent e81b5e5b48
commit 226c4a8b52
7 changed files with 180 additions and 174 deletions

View File

@@ -29,13 +29,13 @@ import { renderChat } from "./render.js";
* @returns {{ socket: WebSocket, sendMessage: (content: string) => void }}
*/
export function initWebSocket(username, chatEl, inputContainer, usersListEl) {
const socket = new WebSocket(
(location.protocol === "https:" ? "wss" : "ws") +
const socket = new WebSocket("ws://localhost:8080");
/*(location.protocol === "https:" ? "wss" : "ws") +
"://" +
location.host +
"/ws",
"coms",
);
);*/
socket.onopen = () => {
// Announce join.