mirror of
https://github.com/ruvnet/RuView.git
synced 2026-04-28 14:09:33 +00:00
fix: Remove process.env reference from browser ES module
process.env does not exist in vanilla browser ES modules (no bundler). Use window.location.protocol check only for WSS detection. Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
parent
ab2e7b49ad
commit
e320bc95f0
1 changed files with 4 additions and 4 deletions
|
|
@ -107,12 +107,12 @@ export function buildApiUrl(endpoint, params = {}) {
|
|||
|
||||
// Helper function to build WebSocket URLs
|
||||
export function buildWsUrl(endpoint, params = {}) {
|
||||
// Always use secure WebSocket (wss://) in production or when using HTTPS
|
||||
// Use secure WebSocket (wss://) when serving over HTTPS or on non-localhost
|
||||
// Use ws:// only for localhost development
|
||||
const isLocalhost = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
|
||||
const isProduction = window.location.protocol === 'https:' || process.env.NODE_ENV === 'production';
|
||||
const protocol = (isProduction || !isLocalhost)
|
||||
? API_CONFIG.WSS_PREFIX
|
||||
const isSecure = window.location.protocol === 'https:';
|
||||
const protocol = (isSecure || !isLocalhost)
|
||||
? API_CONFIG.WSS_PREFIX
|
||||
: API_CONFIG.WS_PREFIX;
|
||||
|
||||
// Use localhost:8000 for WebSocket connections to match FastAPI backend
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue