GeezerVison is showing github.com — [FEATURE]: Support explicit proxy configuration in opencode config · Issue #24981 · anomalyco/opencode
[FEATURE]: Support explicit proxy configuration in opencode config #24981DescriptionFeature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
OpenCode currently supports proxy configuration through standard environment variables such as HTTPS_PROXY,
HTTP_PROXY, and NO_PROXY. This works for simple terminal usage, but it is hard to scope safely when different
developer tools on the same machine need different proxy routes.
In my setup, OpenCode needs a dedicated proxy entrypoint, while other tools use another proxy. Using global
environment variables affects unrelated tools, and using shell wrapper scripts is awkward for Windows, desktop app,
IDE, and corporate VPN setups.
I would like OpenCode to support explicit proxy configuration in opencode.json / opencode.jsonc, for example:
{
"$schema": "https://opencode.ai/config.json",
"network": {
"proxy": {
"http": "http://127.0.0.1:7890",
"https": "http://127.0.0.1:7890",
"all": "socks5://127.0.0.1:7890",
"noProxy": ["localhost", "127.0.0.1", "::1"]
}
}
}
Expected behavior:
- Keep existing environment variable support.
- Define clear precedence between config-based proxy settings and proxy environment variables.
- Apply the resolved proxy settings consistently to provider requests, plugin installs, MCP/network requests, and
other OpenCode-managed HTTP clients.
- Show resolved proxy settings in opencode debug config, with credentials redacted.
- Support existing config variable substitution, so credentials can be kept in env vars or files instead of hardcoded.
This would make OpenCode easier to use in enterprise/VPN environments and would avoid relying on global environment
variables or per-shell wrapper scripts.
Related but different issue: #21098 reports a plugin install failure when proxy environment variables are present.
This request is about adding first-class, scoped proxy configuration in OpenCode config.Reacted by Matthew Kern, Григорий Алексанян, nkabargin2gis, Alberto Camporredondo, Jeff K, chrischarland, erikdemarco, Igor Chakrygin, Zverev Konstantin, askazakov and 1 more Activityadded coreAnything pertaining to core functionality of the application (opencode server stuff) on Apr 29, 2026github-actions commented on Apr 29, 2026 This issue might be a duplicate of existing issues. Please check:
If your request is distinct from these (e.g., scoped specifically to config-file-based proxy with per-tool precedence), please clarify the difference so maintainers can evaluate accordingly. removed discussionUsed for feature requests, proposals, ideas, etc. Open discussion coreAnything pertaining to core functionality of the application (opencode server stuff) on May 3, 2026github-actions commented on Jul 5, 2026 To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one. erikdemarco commented on Oct 18, 2026 rekram1-node commented on Oct 18, 2026 not a bad idea, ill take a look opencodejr commented on Oct 29, 2026 Thanks for the detailed request! To summarize: you'd like proxy settings (http/https/all, including socks5, and noProxy) to be configurable in opencode.json, with clear precedence over the HTTP(S)_PROXY/NO_PROXY environment variables, applied to every outbound request OpenCode makes, and shown with credentials redacted in opencode debug config. That would let you scope a proxy to OpenCode alone instead of setting global env vars or using wrapper scripts.
Right now OpenCode only reads the standard proxy environment variables (see the network docs), so this is a new feature. Maintainers will consider it.
Related issues:
itsarunkj commented on Oct 29, 2026 mosinnik commented on Nov 13, 2026 rodi4eg commented on Nov 18, 2026 Would be useful to have proxy at the provider level, the way settings.tls already scopes a client certificate to one provider's requests only.
"providers": {
"upstream-a": {
"package": "@opencode/ai/providers/openai-compatible",
"settings": {
"baseURL": "https://api.example.com/v1",
"proxy": "http://127.0.0.1:1080"
}
}
}
Env vars can't express this. They apply to the whole process, so my own tools, webfetch and remote MCP servers get routed too, and a long-lived serve --service keeps whatever environment it started with. A provider-level proxy (http/https/socks5, winning over env for that provider only, userinfo redacted in opencode debug config) would let one provider use a tunnel while everything else connects directly.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|