Feature Request
Summary
Add comprehensive HTTP proxy support for all network requests made by OpenClaw, configurable through standard environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY).
Motivation
Many enterprise and restricted network environments require HTTP/HTTPS proxies for external internet access. Currently, OpenClaw does not respect standard proxy environment variables, making it difficult to deploy in such environments without manual proxy configuration for each service.
Proposed Solution
Implement global proxy support that:
- Reads standard proxy environment variables (
HTTP_PROXY, HTTPS_PROXY, http_proxy, https_proxy)
- Supports
NO_PROXY bypass rules for local/internal services
- Uses undici's
ProxyAgent for consistent proxy handling across all HTTP requests
- Automatically applies to web fetch, web search, and all external API calls
- Validates proxy URL format and logs warnings for misconfigurations
Benefits
- Enterprise Compatibility: Works seamlessly in corporate proxy environments
- Zero Configuration: Respects existing environment variable conventions
- Consistent Behavior: All network operations honor proxy settings automatically
- Debugging Friendly: Clear logging for proxy configuration issues
- Standard Compliant: Follows Unix/Linux proxy environment variable conventions
Use Cases
- Corporate networks requiring HTTP proxy for internet access
- Deployments behind application-level proxies
- Testing and debugging through proxy tools (Burp, Charles, etc.)
- Geographically restricted content access
- Network monitoring and traffic analysis
Implementation Details
The implementation includes:
src/infra/net/proxy.ts: Core proxy resolution and agent creation
src/infra/net/bootstrap.ts: Bootstrap logic for global proxy setup
src/infra/net/proxy.test.ts: Comprehensive test coverage
- Integration with existing fetch infrastructure
- Support for multiple proxy protocols (http, https, socks4, socks5)
Configuration Example
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080
export NO_PROXY=localhost,127.0.0.1,.local,.internal
openclaw gateway run
Alternatives Considered
- Per-service proxy configuration: Rejected due to complexity
- Config file only: Rejected to maintain consistency with standard tools
- No proxy support: Not viable for enterprise deployments
Additional Context
This feature is particularly important for:
- Users in China/Great Firewall regions
- Enterprise environments with mandatory proxy requirements
- Educational institutions with network restrictions
- Any deployment requiring traffic monitoring/filtering
The implementation is backward compatible and only activates when proxy environment variables are explicitly set.
Feature Request
Summary
Add comprehensive HTTP proxy support for all network requests made by OpenClaw, configurable through standard environment variables (
HTTP_PROXY,HTTPS_PROXY,NO_PROXY).Motivation
Many enterprise and restricted network environments require HTTP/HTTPS proxies for external internet access. Currently, OpenClaw does not respect standard proxy environment variables, making it difficult to deploy in such environments without manual proxy configuration for each service.
Proposed Solution
Implement global proxy support that:
HTTP_PROXY,HTTPS_PROXY,http_proxy,https_proxy)NO_PROXYbypass rules for local/internal servicesProxyAgentfor consistent proxy handling across all HTTP requestsBenefits
Use Cases
Implementation Details
The implementation includes:
src/infra/net/proxy.ts: Core proxy resolution and agent creationsrc/infra/net/bootstrap.ts: Bootstrap logic for global proxy setupsrc/infra/net/proxy.test.ts: Comprehensive test coverageConfiguration Example
Alternatives Considered
Additional Context
This feature is particularly important for:
The implementation is backward compatible and only activates when proxy environment variables are explicitly set.