We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b41b24 commit 723c899Copy full SHA for 723c899
apps/frontend/src/state/epics/wsEpics.ts
@@ -26,8 +26,14 @@ import {
26
27
let socket$: WebSocketSubject<PayloadAction> | null = null
28
29
+const isElectron = window.location.protocol === "file:"
30
+const isHttps = window.location.protocol === "https:"
31
+
32
const url =
- process.env.VALKEY_ADMIN_WS_URL || `ws://${window.location.hostname || "localhost"}:${window.location.port || "8080"}`
33
+ process.env.VALKEY_ADMIN_WS_URL ||
34
+ (isElectron
35
+ ? "ws://localhost:8080"
36
+ : `${isHttps ? "wss" : "ws"}://${window.location.host}`)
37
38
const connect = (store: Store) =>
39
action$.pipe(
0 commit comments