Is it possible to use proxy? #3214

Open
opened 2026-02-16 17:39:09 -05:00 by yindo · 11 comments
Owner

Originally created by @chetverovod on GitHub (Nov 30, 2025).

Originally assigned to: @rekram1-node on GitHub.

Question

Is it possible to use proxy server as gasket between opencode and Internet?

Originally created by @chetverovod on GitHub (Nov 30, 2025). Originally assigned to: @rekram1-node on GitHub. ### Question Is it possible to use proxy server as gasket between opencode and Internet?
Author
Owner

@github-actions[bot] commented on GitHub (Nov 30, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #531: Support HTTP_PROXY & HTTPS_PROXY for millions of users who are behind fire walls in some regions and some organizations
  • #4823: v1.0.119: nothing to see in an environment with a proxy
  • #3989: acp-command unhandled rejection (proxy-related crashes in v1.0.35)
  • #4284: socket connection error with ProxyChains from v1.0.0
  • #1711: Different proxies for different providers?
  • #2446: AWS Bedrock Provider doesn't seem to respect proxy
  • #1694: Use local SSL trust store (proxy with self-signed SSL certs)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 30, 2025): This issue might be a duplicate of existing issues. Please check: - #531: Support HTTP_PROXY & HTTPS_PROXY for millions of users who are behind fire walls in some regions and some organizations - #4823: v1.0.119: nothing to see in an environment with a proxy - #3989: acp-command unhandled rejection (proxy-related crashes in v1.0.35) - #4284: socket connection error with ProxyChains from v1.0.0 - #1711: Different proxies for different providers? - #2446: AWS Bedrock Provider doesn't seem to respect proxy - #1694: Use local SSL trust store (proxy with self-signed SSL certs) Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Dec 1, 2025):

I think there is a bug w/ HTTP_PROXY and HTTPS_PROXY, looking into them

@rekram1-node commented on GitHub (Dec 1, 2025): I think there is a bug w/ HTTP_PROXY and HTTPS_PROXY, looking into them
Author
Owner

@khrore commented on GitHub (Dec 2, 2025):

It works fine with HTTPS_PROXY, but if you provide HTTPS_PROXY and HTTP_PROXY it will crash, at list on my NixOS machine.

@khrore commented on GitHub (Dec 2, 2025): It works fine with HTTPS_PROXY, but if you provide HTTPS_PROXY and HTTP_PROXY it will crash, at list on my NixOS machine.
Author
Owner

@anpic commented on GitHub (Dec 3, 2025):

It works fine with HTTPS_PROXY

socks proxy?

@anpic commented on GitHub (Dec 3, 2025): > It works fine with HTTPS_PROXY socks proxy?
Author
Owner

@anpic commented on GitHub (Dec 3, 2025):

why not just add proxy support via golang.org/x/net/proxy?

@anpic commented on GitHub (Dec 3, 2025): why not just add proxy support via `golang.org/x/net/proxy`?
Author
Owner

@rekram1-node commented on GitHub (Dec 3, 2025):

This isn't a go codebase my guy

@rekram1-node commented on GitHub (Dec 3, 2025): This isn't a go codebase my guy
Author
Owner

@anpic commented on GitHub (Dec 4, 2025):

This isn't a go codebase my guy

ok 😄
but in other languages too there are stable libraries for proxying everywhere
and what about your fork? 😉

@anpic commented on GitHub (Dec 4, 2025): > This isn't a go codebase my guy ok :smile: but in other languages too there are stable libraries for proxying everywhere and what about your fork? :wink:
Author
Owner

@rekram1-node commented on GitHub (Dec 8, 2025):

ill figure out what the problem is but for now set:

NO_PROXY=localhost,127.0.0.1

@rekram1-node commented on GitHub (Dec 8, 2025): ill figure out what the problem is but for now set: `NO_PROXY=localhost,127.0.0.1 `
Author
Owner

@anpic commented on GitHub (Dec 8, 2025):

ill figure out

but is it possible to use socks5 and socks5h proxies as ALL_PROXY?

@anpic commented on GitHub (Dec 8, 2025): > ill figure out but is it possible to use `socks5` and `socks5h` proxies as `ALL_PROXY`?
Author
Owner

@Thesam1798 commented on GitHub (Jan 27, 2026):

Fix available in PR #10856

Yes, proxy support is now implemented in PR #10856!

Quick setup:

export HTTPS_PROXY=http://your-proxy:8080
export NO_PROXY=localhost,127.0.0.1
opencode

Important: Always set NO_PROXY=localhost,127.0.0.1 to prevent internal server communication from being routed through the proxy.

For corporate proxies with custom certificates:

// opencode.json
{
  "proxy": {
    "https": "http://proxy:8080",
    "tls": {
      "ca": "/path/to/corporate-ca.pem"
    }
  }
}

Note on SOCKS5: Not supported yet (Bun limitation). Use a SOCKS-to-HTTP bridge as workaround.

The fix replaces all fetch() calls with a proxyFetch() wrapper that properly handles proxy configuration and NO_PROXY patterns.

@Thesam1798 commented on GitHub (Jan 27, 2026): ## Fix available in PR #10856 Yes, proxy support is now implemented in PR #10856! **Quick setup:** ```bash export HTTPS_PROXY=http://your-proxy:8080 export NO_PROXY=localhost,127.0.0.1 opencode ``` **Important:** Always set `NO_PROXY=localhost,127.0.0.1` to prevent internal server communication from being routed through the proxy. **For corporate proxies with custom certificates:** ```json // opencode.json { "proxy": { "https": "http://proxy:8080", "tls": { "ca": "/path/to/corporate-ca.pem" } } } ``` **Note on SOCKS5:** Not supported yet (Bun limitation). Use a SOCKS-to-HTTP bridge as workaround. The fix replaces all `fetch()` calls with a `proxyFetch()` wrapper that properly handles proxy configuration and `NO_PROXY` patterns.
Author
Owner

@anpic commented on GitHub (Jan 28, 2026):

Note on SOCKS5: Not supported yet (Bun limitation). Use a SOCKS-to-HTTP bridge as workaround.

the sad fact 😕

@anpic commented on GitHub (Jan 28, 2026): > **Note on SOCKS5:** Not supported yet (Bun limitation). Use a SOCKS-to-HTTP bridge as workaround. the sad fact :confused:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3214