openclaw - 💡(How to fix) Fix [Feature]: Per-provider proxy configuration for web search (like Telegram's proxy setting) [1 comments, 2 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#75562Fetched 2026-05-02 05:33:11
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
2
Author
Timeline (top)
mentioned ×2subscribed ×2commented ×1

Fix Action

Fix / Workaround

  • Global HTTP_PROXY/HTTPS_PROXY env vars affect all 10 web search providers and the entire web tools stack — too broad
  • OPENCLAW_PROXY_URL / proxy.proxyUrl is also global
  • The only workaround is a local patch that bypasses the SSRF guard entirely (unsafe)

Current Workaround

Local patch in wy-local-patch branch that uses fetchWithRuntimeDispatcher + createHttp1ProxyAgent to route only Brave requests through a specified proxy. Functional but bypasses SSRF guard.

Code Example

channels:
  telegram:
    proxy: "http://localhost:1085"

---

tools:
  web:
    search:
      brave:
        mode: web
        proxy: "http://localhost:1085"    # ← new field
      perplexity:
        proxy: "http://localhost:1085"    # ← works for any provider

---

BRAVE_PROXY_URL=http://localhost:1085
PERPLEXITY_PROXY_URL=http://localhost:1085
RAW_BUFFERClick to expand / collapse

Problem

In regions where certain web search APIs are blocked (e.g., Brave Search from China), a per-provider HTTP proxy is needed. Currently:

  • Global HTTP_PROXY/HTTPS_PROXY env vars affect all 10 web search providers and the entire web tools stack — too broad
  • OPENCLAW_PROXY_URL / proxy.proxyUrl is also global
  • The only workaround is a local patch that bypasses the SSRF guard entirely (unsafe)

Proposal

Add a per-provider proxy config field for web search providers, similar to how channels.telegram.proxy works today.

Telegram already has this pattern:

channels:
  telegram:
    proxy: "http://localhost:1085"

The proposed config would look like:

tools:
  web:
    search:
      brave:
        mode: web
        proxy: "http://localhost:1085"    # ← new field
      perplexity:
        proxy: "http://localhost:1085"    # ← works for any provider

Or via environment variable per provider:

BRAVE_PROXY_URL=http://localhost:1085
PERPLEXITY_PROXY_URL=http://localhost:1085

Implementation Notes

  • The Brave provider currently uses withTrustedWebToolsEndpoint() which reads global env proxy vars
  • A per-provider proxy could be passed down through SearchConfigRecord and used in the provider runtime
  • Telegram's pattern (account.config.proxymakeProxyFetch(proxy)) is a clean reference implementation
  • The proxy should only apply to that specific provider's API calls, not to all web tools

Current Workaround

Local patch in wy-local-patch branch that uses fetchWithRuntimeDispatcher + createHttp1ProxyAgent to route only Brave requests through a specified proxy. Functional but bypasses SSRF guard.

Related

  • #19075 — baseUrl option for Brave (alternative approach: self-hosted reverse proxy)
  • #74357 — SSRF policy scope issue
  • #27405 — Original proxy support (global only)
  • Commit d8e2030d47fix(web-search): honor HTTP_PROXY (global env var approach)

Environment

  • OpenClaw running in China behind a local HTTP forward proxy
  • Need Brave Search specifically, other providers may not need proxy

extent analysis

TL;DR

Implement a per-provider proxy configuration for web search providers to allow specific proxies for each provider, such as Brave Search, without affecting the entire web tools stack.

Guidance

  • Introduce a proxy config field for each web search provider in the configuration, similar to the existing pattern for Telegram.
  • Update the provider runtime to accept and use the per-provider proxy configuration, ensuring it only applies to the specific provider's API calls.
  • Consider using environment variables per provider (e.g., BRAVE_PROXY_URL) as an alternative configuration method.
  • Review the implementation of the withTrustedWebToolsEndpoint() function to ensure it respects the per-provider proxy settings.

Example

tools:
  web:
    search:
      brave:
        mode: web
        proxy: "http://localhost:1085"

Notes

The proposed solution aims to provide a more targeted and secure approach to proxy configuration, avoiding the need for a global proxy setting or unsafe workarounds that bypass SSRF guards.

Recommendation

Apply the proposed per-provider proxy configuration workaround to allow for more fine-grained control over proxy settings for each web search provider, such as Brave Search.

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 [Feature]: Per-provider proxy configuration for web search (like Telegram's proxy setting) [1 comments, 2 participants]