Skip to content

[Bug]: Browser control fails when HTTP_PROXY / HTTPS_PROXY / ALL_PROXY is set (CDP probes routed through proxy) #31219

@BUGKillerKing

Description

@BUGKillerKing

Bug type

Regression (worked before, now fails)

Summary

When running OpenClaw in an environment where proxy environment variables are set (HTTP_PROXY, HTTPS_PROXY, or ALL_PROXY), browser control fails even though Chrome starts successfully.

Observed behavior:

  • Chrome/Brave/Edge launches and listens on 127.0.0.1:<cdpPort>
  • OpenClaw reports: Failed to start Chrome CDP on port 18800 for profile "openclaw"
  • isChromeReachable() returns false when probing http://127.0.0.1:<port>/json/version

Steps to reproduce

  1. export ALL_PROXY=http://proxy.example.com:8080
  2. openclaw gateway run then openclaw browser start
  3. Chrome launches; OpenClaw fails with "Error: gateway timeout after 15000ms
    Gateway target: ws://127.0.0.1:18789
    Source: local loopback
    Config: /home/xunye/.openclaw/openclaw.json
    Bind: loopback".

Configure browser in openclaw.json:

{
  "browser": {
    "enabled": true,
    "remoteCdpTimeoutMs": 1500,
    "remoteCdpHandshakeTimeoutMs": 3000,
    "color": "#FF4500",
    "executablePath": "/usr/bin/google-chrome",
    "headless": false,
    "noSandbox": true,
    "attachOnly": false,
    "defaultProfile": "openclaw",
    "profiles": {
      "openclaw": {
        "cdpPort": 18800,
        "color": "#FF4500"
      }
    }
  },
}

Expected behavior

When proxy environment variables (HTTP_PROXY, HTTPS_PROXY, or ALL_PROXY) are set, OpenClaw should:

  1. Automatically add loopback to no_proxy — Ensure 127.0.0.1, localhost, and ::1 are in no_proxy / NO_PROXY so CDP health checks to local Chrome bypass the proxy.

  2. Succeed at browser control — After Chrome starts, isChromeReachable() should succeed when probing http://127.0.0.1:<cdpPort>/json/version, and openclaw browser start should complete without error.

  3. Support all proxy env vars — Treat ALL_PROXY and all_proxy as active proxies (same as HTTP_PROXY / HTTPS_PROXY), since Node/undici uses them for http:// requests.

Actual behavior

  • Chrome starts and listens on 127.0.0.1:<cdpPort>.
  • OpenClaw’s CDP health checks to http://127.0.0.1:<port>/json/version are sent through the proxy instead of directly to localhost.
  • The probe fails or times out, so isChromeReachable() returns false.
  • OpenClaw reports: Failed to start Chrome CDP on port 18800 for profile "openclaw".
  • Browser control does not work until loopback is added to no_proxy manually.

OpenClaw version

2026.3.1

Operating system

Ubuntu 24.04

Install method

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

Root Cause

Node.js (via undici's EnvHttpProxyAgent) routes HTTP requests through the proxy when HTTP_PROXY, HTTPS_PROXY, or ALL_PROXY is set. CDP health checks to 127.0.0.1 are sent through the corporate proxy instead of directly to localhost, causing them to fail or time out.

If no_proxy / NO_PROXY uses CIDR notation (e.g. 127.0.0.0/8) or omits loopback entries, loopback requests may still be proxied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions