fix: use the vite proxy for plugin sockets on any dev port

This commit is contained in:
LukeGus committed 2026-10-15 22:05:08 -05:00
1 parent 3a851ad189
commit e166994ec4
3 files changed
+21 -5

No files matched your search

+3 -4
View File
@@ -175,11 +175,10 @@ export async function pluginWsUrl(
const protocols = websocketAuthProtocols(token);
// Dev without a configured API host goes through Vite's proxy, which is
// reached on the page's own origin rather than the backend port.
// reached on the page's own origin rather than the backend port. Vite moves
// to another port when 5173 is taken, so the port says nothing here.
const devProxy =
process.env.NODE_ENV === "development" &&
!import.meta.env.VITE_API_HOST &&
(window.location.port === "3000" || window.location.port === "5173");
process.env.NODE_ENV === "development" && !import.meta.env.VITE_API_HOST;
const wsProtocol = window.location.protocol === "https:" ? "wss" : "ws";