fix: Don't hardcode websocket path

This commit is contained in:
Joel Therrien 2024-12-26 18:55:48 -08:00
parent db5da6801b
commit 6114f69a50

View file

@ -125,7 +125,7 @@ export function Menu(): React.JSX.Element {
<button <button
disabled={!validSettings} disabled={!validSettings}
onClick={() => { onClick={() => {
let socket = new WebSocket(`ws://localhost:8000/room/${roomName}?player_name=${playerName}`); let socket = new WebSocket(`/room/${roomName}?player_name=${playerName}`);
socket.addEventListener("message", (event) => { socket.addEventListener("message", (event) => {
const input: ServerToClientMessage = JSON.parse(event.data); const input: ServerToClientMessage = JSON.parse(event.data);
if (input.type == "RoomChange") { if (input.type == "RoomChange") {