Skip to content

chrome doesn't support --remote-debugging-address anymore #9710

@hi-ogawa

Description

@hi-ogawa

Describe the bug

Apparently Chrome now hard-codes 127.0.0.1 internally for security purpose and --remote-debugging-address is removed entirely. I noticed this while trying to use --remote-debugging-address=0.0.0.0 for docker playwright without network_mode: host in #9702

The logging here confused me, so this should be removed after confirming if any current chrome doesn't support this.

// NodeJS equivalent defaults: https://nodejs.org/en/learn/getting-started/debugging#enable-inspector
const port = inspector.port || 9229
const host = inspector.host || '127.0.0.1'
args.push(`--remote-debugging-port=${port}`)
args.push(`--remote-debugging-address=${host}`)
this.project.vitest.logger.log(`Debugger listening on ws://${host}:${port}`)

// NodeJS equivalent defaults: https://nodejs.org/en/learn/getting-started/debugging#enable-inspector
const port = inspector.port || 9229
const host = inspector.host || '127.0.0.1'
launchOptions.args ||= []
launchOptions.args.push(`--remote-debugging-port=${port}`)
launchOptions.args.push(`--remote-debugging-address=${host}`)
this.project.vitest.logger.log(`Debugger listening on ws://${host}:${port}`)

Reproduction

Did quite a digging locally. Some notes based on AI collaboration.

🤖 Chromium DevTools bind behavior (remote debugging)

Chromium DevTools bind behavior (remote debugging)

Scope

This note documents Chromium/Chrome behavior for DevTools HTTP remote debugging bind address.

This is intentionally about Chromium behavior itself, not Playwright run-server wrapper behavior.

Findings

  1. Chromium DevTools HTTP server is implemented to bind localhost by default in both major code paths:

  2. In both files, the socket factory tries:

    • 127.0.0.1
    • then ::1
  3. The headless implementation has no handling for --remote-debugging-address in this path.

  4. --remote-debugging-address was a real/legit Chromium flag historically, but support was intentionally removed in old headless:

  5. Practical runtime observation (container):

    • /proc/net/tcp showed 0100007F:240D while debugging (240D = 9229), i.e. listener bound to 127.0.0.1:9229.
    • curl http://127.0.0.1:9229/json/list worked inside container.
    • Host access via Docker bridge port publishing for 9229 failed/reset.

Conclusion

For this Chromium execution path, DevTools remote debugging endpoint is loopback-bound in practice.

As a result, bridge-mode Docker ports: "9229:9229" is not sufficient unless traffic can reach container loopback (which it normally cannot).

network_mode: host works because loopback binding becomes reachable from host namespace.

Historically, this was not a hallucination: the address flag existed, but Chromium tightened behavior and removed support in relevant headless paths.

Also, Chromium CLI parsing is generally permissive, so unsupported/ignored switches are often not hard-rejected by startup.

Evidence pointers

System Info

na

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions