mirror of
https://github.com/QuentinFuxa/WhisperLiveKit.git
synced 2026-03-07 22:33:36 +00:00
Improve WebSocket fallback logic
Use window.location.hostname and port if available, otherwise fallback to localhost:8000. Co-authored-by: Chris Margach <hcagramc@gmail.com>
This commit is contained in:
@@ -315,7 +315,9 @@
|
||||
const linesTranscriptDiv = document.getElementById("linesTranscript");
|
||||
const timerElement = document.querySelector(".timer");
|
||||
|
||||
const defaultWebSocketUrl = `ws://${window.location.hostname}:${window.location.port}/asr`;
|
||||
const host = window.location.hostname || "localhost";
|
||||
const port = window.location.port || "8000";
|
||||
const defaultWebSocketUrl = `ws://${host}:${port}/asr`;
|
||||
websocketInput.value = defaultWebSocketUrl;
|
||||
websocketUrl = defaultWebSocketUrl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user