Changes to connection system to support docker

This commit is contained in:
Karmaa
2025-03-12 18:02:39 -05:00
parent f7cdeb94f7
commit bd79e1e5c3
4 changed files with 15 additions and 6 deletions

View File

@@ -2,15 +2,15 @@ import { useRef, forwardRef, useImperativeHandle } from "react";
import io from "socket.io-client";
import PropTypes from "prop-types";
let socket = null;
let socket;
if (socket === null) {
if (!socket) {
socket = io(
window.location.hostname === "localhost"
? "http://localhost:8082"
: "/",
{
path: window.location.hostname === "localhost" ? "/" : "/database-socket.io/",
path: "/database.io",
transports: ["websocket", "polling"],
}
);