// modules/react/sockets/index.ts
import { io } from "socket.io-client";
var lolySocket = (namespace, opts) => {
  if (typeof window === "undefined") {
    throw new Error(
      "[loly:socket] lolySocket can only be called on the client side."
    );
  }
  const normalizedNamespace = namespace.startsWith("/") ? namespace : `/${namespace}`;
  const socket = io(normalizedNamespace, {
    path: "/wss",
    transports: ["websocket", "polling"],
    autoConnect: true,
    ...opts
  });
  return socket;
};
export {
  lolySocket
};
//# sourceMappingURL=sockets.js.map