From 495535eb3741bd25bdda6fb7347f513dba50862d Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Mon, 1 Jun 2026 11:37:06 +0200 Subject: [PATCH] :bug: Fix problem with shadow-cljs websocket connection --- docker/devenv/files/nginx.conf | 7 +++++++ frontend/shadow-cljs.edn | 6 ++++-- manage.sh | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docker/devenv/files/nginx.conf b/docker/devenv/files/nginx.conf index 5847e6551a..ce5566079f 100644 --- a/docker/devenv/files/nginx.conf +++ b/docker/devenv/files/nginx.conf @@ -136,6 +136,13 @@ http { proxy_http_version 1.1; } + location /api/remote-relay { + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_pass http://127.0.0.1:3448; + proxy_http_version 1.1; + } + location /mcp/ws { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; diff --git a/frontend/shadow-cljs.edn b/frontend/shadow-cljs.edn index fadcb4131f..f596a34e19 100644 --- a/frontend/shadow-cljs.edn +++ b/frontend/shadow-cljs.edn @@ -10,7 +10,8 @@ :output-dir "resources/public/js/" :asset-path "/js" :devtools {:watch-dir "resources/public" - :reload-strategy :full} + :reload-strategy :full + :server-url #shadow/env ["SHADOW_SERVER_URL" :default ""]} :build-options {:manifest-name "manifest.json"} :modules {:shared @@ -86,7 +87,8 @@ {:target :browser :output-dir "resources/public/js/worker/" :asset-path "/js/worker" - :devtools {:browser-inject :main + :devtools {:server-url #shadow/env ["SHADOW_SERVER_URL" :default ""] + :browser-inject :main :watch-dir "resources/public" :reload-strategy :full} :build-options {:manifest-name "manifest.json"} diff --git a/manage.sh b/manage.sh index f062914035..b29c266943 100755 --- a/manage.sh +++ b/manage.sh @@ -331,6 +331,10 @@ SERENA_DASHBOARD_EXTERNAL_PORT=${serena_dash} # to a single Valkey Pub/Sub. See mem:devenv/core. PENPOT_BACKEND_WORKER=false +# shadow-cljs relay proxied through nginx so the browser can reach it without +# a separate published port. URL must match the instance's public HTTPS port. +SHADOW_SERVER_URL=wss://localhost:${public} + # Workspace bind mount (computed in manage.sh too, but recorded here for # clarity when inspecting the env file). PENPOT_SOURCE_PATH=${workspace}