openclaw - 💡(How to fix) Fix Browser tool 不支持配置代理 (proxy) [2 comments, 3 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#50973Fetched 2026-04-08 01:06:03
View on GitHub
Comments
2
Participants
3
Timeline
4
Reactions
0
Timeline (top)
commented ×2mentioned ×1subscribed ×1

Code Example

{
  browser: {
    enabled: true,
    proxy: {
      server: "http://proxy.example.com:8080",
      // 或者支持从代理服务商动态获取
      // dynamicProxy: {
      //   provider: "kuaidaili",
      //   secretId: "...",
      //   secretKey: "..."
      // }
    }
  }
}

---

openclaw browser set proxy http://proxy.example.com:8080

---

$env:HTTP_PROXY = "http://proxy.example.com:8080"
$env:HTTPS_PROXY = "http://proxy.example.com:8080"
RAW_BUFFERClick to expand / collapse

问题描述

OpenClaw 的 browser 工具目前不支持配置 HTTP/HTTPS 代理。

使用场景

用户在使用 OpenClaw 的浏览器自动化功能时,需要通过代理访问网站,常见场景包括:

  • 爬虫/数据采集
  • 绕过 IP 限制
  • 访问地区限制内容
  • 隐私保护

期望的功能

openclaw.json 的 browser 配置中添加代理支持,例如:

{
  browser: {
    enabled: true,
    proxy: {
      server: "http://proxy.example.com:8080",
      // 或者支持从代理服务商动态获取
      // dynamicProxy: {
      //   provider: "kuaidaili",
      //   secretId: "...",
      //   secretKey: "..."
      // }
    }
  }
}

或者在 CLI 中支持:

openclaw browser set proxy http://proxy.example.com:8080

当前的变通方案

目前只能通过系统级环境变量设置代理:

$env:HTTP_PROXY = "http://proxy.example.com:8080"
$env:HTTPS_PROXY = "http://proxy.example.com:8080"

但这会影响所有 HTTP 请求,不够灵活。

相关文档

版本信息

  • OpenClaw: 2026.3.11
  • OS: Windows 11

extent analysis

Fix Plan

To add HTTP/HTTPS proxy support to OpenClaw's browser tool, we will modify the openclaw.json configuration file and the CLI command.

Step 1: Modify openclaw.json Configuration

Add a proxy section to the browser configuration:

{
  "browser": {
    "enabled": true,
    "proxy": {
      "server": "http://proxy.example.com:8080"
    }
  }
}

Alternatively, support dynamic proxy configuration:

{
  "browser": {
    "enabled": true,
    "proxy": {
      "dynamicProxy": {
        "provider": "kuaidaili",
        "secretId": "...",
        "secretKey": "..."
      }
    }
  }
}

Step 2: Update CLI Command

Add a set proxy command to the OpenClaw CLI:

openclaw browser set proxy http://proxy.example.com:8080

Step 3: Implement Proxy Support in Code

Modify the browser launch code to use the proxy configuration:

const puppeteer = require('puppeteer');

// ...

const browser = await puppeteer.launch({
  // ...
  args: [
    `--proxy-server=${proxyServer}`,
    // ...
  ],
});

Verification

Verify that the proxy is working by checking the browser's network requests:

const page = await browser.newPage();
await page.goto('https://example.com');
const requests = await page.requests();
console.log(requests); // Check if requests are going through the proxy

Extra Tips

  • Make sure to handle proxy authentication and errors properly.
  • Consider adding support for multiple proxy providers and dynamic proxy rotation.
  • Update the documentation to reflect the new proxy configuration options.

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…

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 Browser tool 不支持配置代理 (proxy) [2 comments, 3 participants]