-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
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 probinghttp://127.0.0.1:<port>/json/version
Steps to reproduce
export ALL_PROXY=http://proxy.example.com:8080openclaw gateway runthenopenclaw browser start- 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:
-
Automatically add loopback to
no_proxy— Ensure127.0.0.1,localhost, and::1are inno_proxy/NO_PROXYso CDP health checks to local Chrome bypass the proxy. -
Succeed at browser control — After Chrome starts,
isChromeReachable()should succeed when probinghttp://127.0.0.1:<cdpPort>/json/version, andopenclaw browser startshould complete without error. -
Support all proxy env vars — Treat
ALL_PROXYandall_proxyas active proxies (same asHTTP_PROXY/HTTPS_PROXY), since Node/undici uses them forhttp://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/versionare 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_proxymanually.
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.