Compare commits

...

2 Commits

Author SHA1 Message Date
github-actions[bot] 55c70a499f chore: update vendor submodules to latest main 2026-03-16 18:26:26 +00:00
ruv 578d84c25e fix(ui): WebSocket protocol matches page protocol, not hostname (#272)
buildWsUrl() forced wss:// on non-localhost HTTP connections,
breaking LAN/Docker deployments at http://192.168.x.x:3000.
Now simply: https → wss, http → ws.

Closes #272

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-16 11:35:11 -04:00
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -113,11 +113,11 @@ export function buildApiUrl(endpoint, params = {}) {
// Helper function to build WebSocket URLs
export function buildWsUrl(endpoint, params = {}) {
// 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';
// Match WebSocket protocol to page protocol: https → wss, http → ws.
// Previous logic forced wss:// on non-localhost HTTP, breaking LAN/Docker
// deployments served over plain HTTP. See issue #272.
const isSecure = window.location.protocol === 'https:';
const protocol = (isSecure || !isLocalhost)
const protocol = isSecure
? API_CONFIG.WSS_PREFIX
: API_CONFIG.WS_PREFIX;