Skip to content

fix: expose browser CDP on the compose network (9223) - #99

Merged
andrasbacsai merged 1 commit into
mainfrom
cursor/browser-cdp-listen-d6fd
Oct 19, 2026
Merged

andrasbacsai merged 1 commit into
mainfrom
cursor/browser-cdp-listen-d6fd

Conversation

@andrasbacsai

Copy link
Copy Markdown
Member

Fixes #45

Chromium in coollabsio/openclaw-browser ignores --remote-debugging-address and binds the DevTools port to 127.0.0.1:9222. Other containers cannot open http://browser:9222/json/version, so the browser tool stays cdpReady=false.

The image already tried to work around that with a second nginx on 9223. That process does not stay up: Selkies' svc-nginx kills every nginx it finds, and both masters use /run/nginx.pid.

This change adds a server to the existing nginx. It listens on 0.0.0.0:9223 inside the container and proxies to 127.0.0.1:9222, rewriting Host to localhost so Chrome accepts the request. Compose does not publish 9222 or 9223, so CDP stays on the compose network. The image also passes --remote-debugging-port=9222 itself; CHROME_CLI can still override it.

SSRF policy for private hostnames (#64) is unchanged.

Test

Built openclaw-browser:local from Dockerfile.browser and started it with the compose environment (CHROME_CLI=--remote-debugging-port=9222, shm_size=2g) on a user-defined network, with no published ports.

From a second container on that network:

  • curl http://browser:9223/json/version returned HTTP 200 and Chrome/155.0.8059.39 JSON (Browser, Protocol-Version, webSocketDebuggerUrl).
  • curl http://browser:9222/json/version was connection refused.

Inside the browser container, ss showed 127.0.0.1:9222 (Chromium) and 0.0.0.0:9223 (the same nginx that also serves the desktop on 3000). curl http://127.0.0.1:9222/json/version succeeded. docker port was empty.

Open in Web Open in Cursor 

Chromium binds DevTools to 127.0.0.1:9222 and ignores
--remote-debugging-address. Proxy that port through the existing
Selkies nginx on 0.0.0.0:9223 so other containers can call
/json/version without publishing CDP on the host.

Co-authored-by: Andras Bacsai <andrasbacsai@users.noreply.github.com>
@andrasbacsai
andrasbacsai merged commit 1de9875 into main Oct 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⁠ openclaw-browser: Chromium remote debugging stays bound to 127.0.0.1 even with --remote-debugging-address=0.0.0.0 ⁠

2 participants