1
src/env.d.ts
vendored
1
src/env.d.ts
vendored
@@ -8,6 +8,7 @@ interface ImportMetaEnv {
|
||||
readonly PUBLIC_JUDGE0_URL: string
|
||||
readonly PUBLIC_ICONIFY_URL: string
|
||||
readonly PUBLIC_SIGNALING_URL: string
|
||||
readonly PUBLIC_WS_URL: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
|
||||
@@ -62,9 +62,7 @@ export class BaseWebSocket<T extends WebSocketMessage = WebSocketMessage> {
|
||||
public status: Ref<ConnectionStatus> = ref<ConnectionStatus>("disconnected")
|
||||
|
||||
constructor(config: WebSocketConfig) {
|
||||
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:"
|
||||
const host = window.location.host
|
||||
this.url = `${protocol}//${host}/ws/${config.path}/`
|
||||
this.url = import.meta.env.PUBLIC_WS_URL
|
||||
|
||||
this.maxReconnectAttempts = config.maxReconnectAttempts ?? 5
|
||||
this.reconnectDelay = config.reconnectDelay ?? 1000
|
||||
|
||||
Reference in New Issue
Block a user