mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add upstream proxy support to aiproxy for passthrough requests (#21512)
## Description Adds upstream proxy support for AI Bridge Proxy passthrough requests. This allows aiproxy to forward non-allowlisted requests through an upstream proxy. Currently, the only supported configuration is when aiproxy is the first proxy in the chain (client → aiproxy → upstream proxy). ## Changes * Add `--aibridge-proxy-upstream` option to configure an upstream HTTP/HTTPS proxy URL for passthrough requests * Add `--aibridge-proxy-upstream-ca` option to trust custom CA certificates for HTTPS upstream proxies * Passthrough requests (non-allowlisted domains) are forwarded through the upstream proxy * MITM'd requests (allowlisted domains) continue to go directly to aibridge, not through the upstream proxy * Add tests for upstream proxy configuration and request routing Closes: https://github.com/coder/internal/issues/1204
This commit is contained in:
@@ -23,6 +23,8 @@ func newAIBridgeProxyDaemon(coderAPI *coderd.API) (*aibridgeproxyd.Server, error
|
||||
CertFile: coderAPI.DeploymentValues.AI.BridgeProxyConfig.CertFile.String(),
|
||||
KeyFile: coderAPI.DeploymentValues.AI.BridgeProxyConfig.KeyFile.String(),
|
||||
DomainAllowlist: coderAPI.DeploymentValues.AI.BridgeProxyConfig.DomainAllowlist.Value(),
|
||||
UpstreamProxy: coderAPI.DeploymentValues.AI.BridgeProxyConfig.UpstreamProxy.String(),
|
||||
UpstreamProxyCA: coderAPI.DeploymentValues.AI.BridgeProxyConfig.UpstreamProxyCA.String(),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("failed to start in-memory aibridgeproxy daemon: %w", err)
|
||||
|
||||
@@ -166,6 +166,17 @@ AI BRIDGE PROXY OPTIONS:
|
||||
--aibridge-proxy-listen-addr string, $CODER_AIBRIDGE_PROXY_LISTEN_ADDR (default: :8888)
|
||||
The address the AI Bridge Proxy will listen on.
|
||||
|
||||
--aibridge-proxy-upstream string, $CODER_AIBRIDGE_PROXY_UPSTREAM
|
||||
URL of an upstream HTTP proxy to chain passthrough (non-allowlisted)
|
||||
requests through. Format: http://[user:pass@]host:port or
|
||||
https://[user:pass@]host:port.
|
||||
|
||||
--aibridge-proxy-upstream-ca string, $CODER_AIBRIDGE_PROXY_UPSTREAM_CA
|
||||
Path to a PEM-encoded CA certificate to trust for the upstream proxy's
|
||||
TLS connection. Only needed for HTTPS upstream proxies with
|
||||
certificates not trusted by the system. If not provided, the system
|
||||
certificate pool is used.
|
||||
|
||||
CLIENT OPTIONS:
|
||||
These options change the behavior of how clients interact with the Coder.
|
||||
Clients include the Coder CLI, Coder Desktop, IDE extensions, and the web UI.
|
||||
|
||||
Reference in New Issue
Block a user