mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
fix: use the vite proxy for plugin sockets on any dev port
This commit is contained in:
1 parent
3a851ad189
commit
e166994ec4
3 files changed
+21
-5
No files matched your search
@@ -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";
|
||||
|
||||
|
||||
Reference in new issue
Block a user