Skip to content

Is it possible to use proxy? #4924

Closed
Closed

Description

@chetverovod

Question

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

Activity

  1. github-actions commented on Nov 30, 2025

    @github-actions
    Contributor

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

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

  2. self-assigned this
    on Dec 2, 2025
  3. rekram1-node commented on Dec 2, 2025

    @rekram1-node
    Collaborator

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

  4. khrore1 commented on Dec 2, 2025

    @khrore1

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

  5. anpic commented on Dec 3, 2025

    @anpic

    It works fine with HTTPS_PROXY

    socks proxy?

  6. anpic commented on Dec 3, 2025

    @anpic

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

  7. rekram1-node commented on Dec 3, 2025

    @rekram1-node
    Collaborator

    This isn't a go codebase my guy

  8. anpic commented on Dec 4, 2025

    @anpic

    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? 😉

  9. rekram1-node commented on Dec 8, 2025

    @rekram1-node
    Collaborator

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

    NO_PROXY=localhost,127.0.0.1

  10. anpic commented on Dec 8, 2025

    @anpic

    ill figure out

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

  11. Thesam1798 commented on Jan 27, 2026

    @Thesam1798

    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.

  12. anpic commented on Jan 28, 2026

    @anpic

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

    the sad fact 😕

  13. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions