Deploy: Migrate to Gitea Actions, update paths for turbotrades.dev
Some checks failed
Deploy to Production / Deploy to turbotrades.dev (push) Has been cancelled
Some checks failed
Deploy to Production / Deploy to turbotrades.dev (push) Has been cancelled
This commit is contained in:
@@ -31,10 +31,19 @@ export const useWebSocketStore = defineStore("websocket", () => {
|
||||
|
||||
// Helper functions
|
||||
const getWebSocketUrl = () => {
|
||||
// Use environment variable or fallback to ws subdomain
|
||||
if (import.meta.env.VITE_WS_URL) {
|
||||
return import.meta.env.VITE_WS_URL;
|
||||
}
|
||||
|
||||
// In production, use dedicated WebSocket domain
|
||||
if (import.meta.env.PROD) {
|
||||
return "wss://ws.turbotrades.dev";
|
||||
}
|
||||
|
||||
// In development, use current host with ws path (for proxy)
|
||||
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
const host = window.location.host;
|
||||
|
||||
// Always use the current host (works with VS Code tunnels and proxies)
|
||||
return `${protocol}//${host}/ws`;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user