update
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
2025-10-07 21:26:54 +08:00
parent 389393b70d
commit 7938e02421
7 changed files with 14 additions and 15 deletions

1
src/env.d.ts vendored
View File

@@ -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 {

View File

@@ -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