运行自动修复脚本:
bash
bash /home/admind/.openclaw/workspace/skills/whatsapp-428-fix/scripts/fix-whatsapp-428.sh
bash
openclaw status --deep
openclaw channels status
bash
LOCAL_IP=$(hostname -I | awk '{print $1}')
echo "本地IP: $LOCAL_IP"
编辑 ~/.config/systemd/user/openclaw-gateway.service,添加代理环境变量:
ini
[Service]
Environment=HTTP_PROXY=http://LOCAL_IP:10808
Environment=HTTPS_PROXY=http://LOCAL_IP:10808
Environment=ALL_PROXY=http://LOCAL_IP:10808
bash
systemctl --user daemon-reload
openclaw gateway restart
bash
openclaw logs --follow | grep -i whatsapp
需要修改 OpenClaw 源码以支持 proxy,按以下步骤修改:
在 auth-profiles-*.js 的 WhatsAppSharedSchema 中添加:
javascript
proxy: z.string().url().optional()
添加 HttpsProxyAgent 支持:
javascript
import { HttpsProxyAgent } from "https-proxy-agent";
// 在 makeWASocket 调用中添加 agent
const agent = new HttpsProxyAgent(opts.proxy);
在 channel-web-*.js 中传入 proxy 参数:
javascript
const sock = await createWaSocket(false, options.verbose, {
authDir: options.authDir,
proxy: options.proxy
});
javascript
proxy: account.proxy