diff --git a/www/app/[domain]/transcripts/useWebSockets.ts b/www/app/[domain]/transcripts/useWebSockets.ts index 6bd7bf48..34f2b413 100644 --- a/www/app/[domain]/transcripts/useWebSockets.ts +++ b/www/app/[domain]/transcripts/useWebSockets.ts @@ -1,7 +1,8 @@ -import { useEffect, useState } from "react"; +import { useContext, useEffect, useState } from "react"; import { Topic, FinalSummary, Status } from "./webSocketTypes"; import { useError } from "../../(errors)/errorContext"; import { useRouter } from "next/navigation"; +import { DomainContext } from "../domainContext"; type UseWebSockets = { transcriptText: string; @@ -148,8 +149,8 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => { }; if (!transcriptId) return; - - const url = `${process.env.NEXT_PUBLIC_WEBSOCKET_URL}/v1/transcripts/${transcriptId}/events`; + const { websocket_url } = useContext(DomainContext); + const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`; const ws = new WebSocket(url); ws.onopen = () => { diff --git a/www/app/lib/edgeConfig.ts b/www/app/lib/edgeConfig.ts index 1fdf77b6..5527121a 100644 --- a/www/app/lib/edgeConfig.ts +++ b/www/app/lib/edgeConfig.ts @@ -8,6 +8,7 @@ const localConfig = { browse: true, }, api_url: "http://127.0.0.1:1250", + websocket_url: "ws://127.0.0.1:1250", auth_callback_url: "http://localhost:3000/auth-callback", }; @@ -17,6 +18,7 @@ type EdgeConfig = { [featureName in "requireLogin" | "privacy" | "browse"]: boolean; }; auth_callback_url: string; + websocket_url: string; api_url: string; }; };