Problem
When running OpenClaw on cloud platforms (Fly.io, Railway, AWS, etc.), WhatsApp linking fails because WhatsApp detects and blocks datacenter IP addresses. The connection succeeds initially but immediately gets logged out:
WhatsApp QR received.
WhatsApp session logged out. Run: openclaw channels login
[default] channel exited: {"error":{"data":{"reason":"401","location":"atn"}...}
This is a known WhatsApp security measure - they block connections from datacenter IPs to prevent automation abuse.
Proposed Solution
Baileys already supports proxy configuration via the agent and fetchAgent options:
import { SocksProxyAgent } from 'socks-proxy-agent';
const wa = makeWASocket({
agent: new SocksProxyAgent('socks5://user:pass@host:port'),
fetchAgent: new SocksProxyAgent('socks5://user:pass@host:port'),
});
Request: Expose this configuration in OpenClaw, either via:
Config file - channels.whatsapp.proxy field:
{
"channels": {
"whatsapp": {
"proxy": "socks5://user:pass@host:port"
}
}
}
Environment variable - WHATSAPP_PROXY or OPENCLAW_WHATSAPP_PROXY
Use Case
Users running OpenClaw on cloud platforms can configure a residential proxy (like Smartproxy, Bright Data, or similar) to route WhatsApp traffic through non-datacenter IPs, allowing successful WhatsApp linking.
Workaround Attempted
Setting system-level env vars (ALL_PROXY, HTTPS_PROXY) does not work because Baileys uses WebSocket connections directly and doesn't respect these environment variables.
Environment
OpenClaw version: 2026.2.3
Platform: Fly.io
Node.js: (from Docker image)
Problem
When running OpenClaw on cloud platforms (Fly.io, Railway, AWS, etc.), WhatsApp linking fails because WhatsApp detects and blocks datacenter IP addresses. The connection succeeds initially but immediately gets logged out:
This is a known WhatsApp security measure - they block connections from datacenter IPs to prevent automation abuse.
Proposed Solution
Baileys already supports proxy configuration via the agent and fetchAgent options:
Request: Expose this configuration in OpenClaw, either via:
Config file -
channels.whatsapp.proxyfield:Environment variable -
WHATSAPP_PROXYorOPENCLAW_WHATSAPP_PROXYUse Case
Users running OpenClaw on cloud platforms can configure a residential proxy (like Smartproxy, Bright Data, or similar) to route WhatsApp traffic through non-datacenter IPs, allowing successful WhatsApp linking.
Workaround Attempted
Setting system-level env vars (ALL_PROXY, HTTPS_PROXY) does not work because Baileys uses WebSocket connections directly and doesn't respect these environment variables.
Environment
OpenClaw version: 2026.2.3
Platform: Fly.io
Node.js: (from Docker image)