diff --git a/src/App.tsx b/src/App.tsx index 9a300e5..f97339a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -36,11 +36,9 @@ import Footer from "./Footer"; import User from "./User"; function getWsUri(id: string) { - return ( - (window.location.origin.startsWith("https") ? "wss://" : "ws://") + - window.location.host + - `/api/socket/${id}` - ); + let url = new URL(`api/socket/${id}`, window.location.href); + url.protocol = (url.protocol == "https:") ? "wss:" : "ws:"; + return url.href; } function generateName() { diff --git a/vite.config.ts b/vite.config.ts index 62a0a9b..4dec1d7 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,6 +4,7 @@ import topLevelAwait from "vite-plugin-top-level-await"; import react from "@vitejs/plugin-react"; export default defineConfig({ + base: "", build: { chunkSizeWarningLimit: 1000, },