Skip to content

[Feature Request] Add proxy configuration option for browser tool #8079

Closed

Description

@skaas777

Feature Request

Description

Add a configuration option to specify a proxy server for the browser tool. Currently, when OpenClaw starts Chrome/Chromium, there's no way to configure it to use a proxy server.

Use Case

  • Users behind corporate firewalls need proxy access
  • Users in regions with restricted internet access need to route browser traffic through a proxy
  • Server deployments where the server IP is blocked by certain websites

Proposed Solution

Add a proxy option under the browser configuration section:

{
  "browser": {
    "headless": true,
    "noSandbox": true,
    "proxy": "http://127.0.0.1:7890"
  }
}

This would translate to Chrome's --proxy-server launch argument.

Current Workaround

None available. Setting system environment variables (HTTP_PROXY, etc.) doesn't affect the browser launched by OpenClaw.

Additional Context

  • Platform: Linux (Ubuntu 24.04)
  • OpenClaw Version: 2026.2.1

Submitted by XiaoDi 🐱

Activity

  1. nehaksharma11 commented on Feb 3, 2026

    @nehaksharma11

    Hi, I’m interested in contributing to this issue.
    Could you please point me to the browser launch code path?
    I’d like to understand where Chrome args are constructed.

  2. skaas777 commented on Feb 3, 2026

    @skaas777
    Author

    Hi @nehaksharma11, thanks for your interest in contributing! 🎉

    The browser launch code is in:

    src/browser/chrome.ts

    Specifically, look at the spawnOnce() function (around line 124-150 in the compiled dist/browser/chrome.js). This is where Chrome args are constructed:

    const args = [
        `--remote-debugging-port=${profile.cdpPort}`,
        `--user-data-dir=${userDataDir}`,
        "--no-first-run",
        // ... more args
    ];
    
    if (resolved.headless) {
        args.push("--headless=new");
        args.push("--disable-gpu");
    }
    
    if (resolved.noSandbox) {
        args.push("--no-sandbox");
        args.push("--disable-setuid-sandbox");
    }

    For the proxy feature, you would:

    1. Add a proxy?: string option in src/browser/config.ts (browser config schema)
    2. In chrome.ts, add something like:
      if (resolved.proxy) {
          args.push(`--proxy-server=${resolved.proxy}`);
      }

    Related files:

    • src/browser/config.ts - Browser configuration schema
    • src/browser/chrome.ts - Chrome launch logic

    Let me know if you need any more guidance! 🐱

  3. added
    enhancement
    on Feb 4, 2026
  4. nehaksharma11 commented on Feb 4, 2026

    @nehaksharma11

    Thanks for the guidance!
    I’ll work on adding the proxy option to the browser config and Chrome args and submit a PR shortly.

  5. illusivejosiah commented on Mar 2, 2026

    @illusivejosiah

    This is implemented in #20578. Adds browser.proxy config with HTTP/HTTPS/SOCKS5 support, authenticated proxies via CDP Fetch.authRequired, per-profile overrides, and credential isolation. Awaiting maintainer review.

  6. nehaksharma11 commented on Mar 3, 2026

    @nehaksharma11

    Thanks for the update!
    Glad to see it implemented.
    Looking forward to contributing to another issue 😊

  7. steipete commented on Apr 24, 2026

    @steipete
    Contributor

    Closing this as implemented after Codex review.

    Current main already supports the requested browser proxy routing via browser.extraArgs, which accepts Chromium flags like --proxy-server=..., carries them through resolved browser config, and appends them to Chrome launch args. The same implementation is present in release v2026.4.22.

    What I checked:

    • Browser config surface exposes extra launch args: BrowserConfig includes extraArgs?: string[] as additional Chrome launch arguments. (src/config/types.browser.ts:63, cec34821754a)
    • Resolved browser config preserves extraArgs: ResolvedBrowserConfig includes extraArgs, and resolveBrowserConfig() filters and returns cfg.extraArgs. (extensions/browser/src/browser/config.ts:72, cec34821754a)
    • Chrome launch args include configured proxy flag: buildOpenClawChromeLaunchArgs() appends resolved.extraArgs directly to Chromium's startup arguments, so --proxy-server=... is passed through. (extensions/browser/src/browser/chrome.ts:135, cec34821754a)
    • Tests explicitly cover proxy-server usage: Schema regression test accepts browser.extraArgs: ["--proxy-server=http://127.0.0.1:7890"], and the browser launch-args test asserts that --proxy-server=http://localhost:3128 is propagated. (src/config/config.schema-regressions.test.ts:208, cec34821754a)
    • Released tag already contains the same support: The v2026.4.22 tag contains the same extraArgs handling in browser config, Chrome launch, and proxy regression coverage; diffing those files against HEAD showed no change in the implementation path. (00bd2cf7a376)

    So I’m closing this as already implemented rather than keeping a duplicate issue open.

    Review notes: reviewed against cec34821754a; fix evidence: release v2026.4.22, commit 00bd2cf7a376.

  8. locked as resolved and limited conversation to collaborators on Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions