openclaw - 💡(How to fix) Fix [Bug]: WhatsApp login times out over ambient proxy-agent, while explicit HttpsProxyAgent can open the same WSS endpoint [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70149Fetched 2026-04-23 07:28:42
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

When using the WhatsApp channel behind an HTTP proxy, openclaw channels login --verbose fails with:

status=408 Request Time-out WebSocket Error (Opening handshake has timed out) However, the proxy itself appears to work:

curl -I https://web.whatsapp.com/ works through the proxy a minimal Node.js ws script can successfully open wss://web.whatsapp.com/ws/chat when using an explicit HttpsProxyAgent the same minimal script times out when using proxy-agent with ambient proxy env vars This suggests the issue is not general connectivity, nor the proxy server itself, but specifically the proxy implementation/path used by OpenClaw for the WhatsApp WebSocket connection.

Error Message

WebSocket Error (Opening handshake has timed out) WhatsApp Web connection ended before fully opening. status=408 Request Time-out WebSocket Error (Opening handshake has timed out) Channel login failed: Error: status=408 Request Time-out WebSocket Error (Opening handshake has timed out)

Root Cause

When using the WhatsApp channel behind an HTTP proxy, openclaw channels login --verbose fails with:

status=408 Request Time-out WebSocket Error (Opening handshake has timed out) However, the proxy itself appears to work:

curl -I https://web.whatsapp.com/ works through the proxy a minimal Node.js ws script can successfully open wss://web.whatsapp.com/ws/chat when using an explicit HttpsProxyAgent the same minimal script times out when using proxy-agent with ambient proxy env vars This suggests the issue is not general connectivity, nor the proxy server itself, but specifically the proxy implementation/path used by OpenClaw for the WhatsApp WebSocket connection.

RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

When using the WhatsApp channel behind an HTTP proxy, openclaw channels login --verbose fails with:

status=408 Request Time-out WebSocket Error (Opening handshake has timed out) However, the proxy itself appears to work:

curl -I https://web.whatsapp.com/ works through the proxy a minimal Node.js ws script can successfully open wss://web.whatsapp.com/ws/chat when using an explicit HttpsProxyAgent the same minimal script times out when using proxy-agent with ambient proxy env vars This suggests the issue is not general connectivity, nor the proxy server itself, but specifically the proxy implementation/path used by OpenClaw for the WhatsApp WebSocket connection.

Steps to reproduce

Configure ambient proxy env vars, e.g.: HTTP_PROXY=http://127.0.0.1:10808 HTTPS_PROXY=http://127.0.0.1:10808 Enable WhatsApp channel Run: openclaw channels login --verbose Observe login failure with WebSocket handshake timeout

Expected behavior

If the configured proxy can successfully reach https://web.whatsapp.com/ and can open wss://web.whatsapp.com/ws/chat, WhatsApp login should proceed instead of timing out during the WebSocket opening handshake.

Actual behavior

openclaw channels login --verbose fails with:

Waiting for WhatsApp connection... WhatsApp Web connection ended before fully opening. status=408 Request Time-out WebSocket Error (Opening handshake has timed out) Channel login failed: Error: status=408 Request Time-out WebSocket Error (Opening handshake has timed out) OpenClaw logs also show:

Using ambient env proxy for WhatsApp WebSocket connection

OpenClaw version

2026.4.21

Operating system

wsl2

Install method

No response

Model

gpt5.4

Provider / routing chain

openclaw proxy openai

Additional provider/model setup details

I traced the WhatsApp connection path in OpenClaw:

OpenClaw resolves the WS proxy via resolveAmbientNodeProxyAgent() this returns a proxy-agent instance Baileys ultimately passes that agent into ws for the WhatsApp WebSocket I then compared two minimal Node.js tests against the same target and same proxy:

ProxyAgent(env) → fails with Opening handshake has timed out HttpsProxyAgent(explicit) → succeeds with WS_OPEN So the issue appears to be specifically related to using ambient proxy-agent for this WS path, not to the proxy endpoint itself.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can likely be fixed by using an explicit HttpsProxyAgent instead of relying on ambient proxy environment variables for the WhatsApp WebSocket connection in OpenClaw.

Guidance

  • Verify that the HttpsProxyAgent works with the WhatsApp WebSocket connection by creating a minimal Node.js test script that uses HttpsProxyAgent to connect to wss://web.whatsapp.com/ws/chat.
  • Investigate the resolveAmbientNodeProxyAgent() function in OpenClaw to understand why it returns a proxy-agent instance that fails to establish a WebSocket connection.
  • Consider modifying OpenClaw to use HttpsProxyAgent explicitly for the WhatsApp WebSocket connection, or to handle ambient proxy environment variables differently.
  • Test the WhatsApp channel login with the modified OpenClaw configuration to ensure that the issue is resolved.

Example

const { HttpsProxyAgent } = require('https-proxy-agent');
const WebSocket = require('ws');

const proxyUrl = 'http://127.0.0.1:10808';
const targetUrl = 'wss://web.whatsapp.com/ws/chat';

const agent = new HttpsProxyAgent(proxyUrl);
const ws = new WebSocket(targetUrl, { agent });

ws.on('open', () => {
  console.log('WS_OPEN');
});

ws.on('error', (error) => {
  console.error('Error:', error);
});

Notes

The issue appears to be specific to the use of ambient proxy environment variables with the proxy-agent library in OpenClaw. Using an explicit HttpsProxyAgent may resolve the issue, but further investigation is needed to understand the root cause of the problem.

Recommendation

Apply workaround: Use an explicit HttpsProxyAgent for the WhatsApp WebSocket connection in OpenClaw, as it has been shown to work in minimal test scripts.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If the configured proxy can successfully reach https://web.whatsapp.com/ and can open wss://web.whatsapp.com/ws/chat, WhatsApp login should proceed instead of timing out during the WebSocket opening handshake.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: WhatsApp login times out over ambient proxy-agent, while explicit HttpsProxyAgent can open the same WSS endpoint [1 participants]