HTTP Client Configuration
#
The http_client
section defines configurations for HTTP clients, where each key represents a unique client profile. The default
key is a special profile that serves as the fallback configuration when no specific profile is specified. Additional profiles can be added and accessed dynamically.
Sample Configuration
#
http_client:
default:
proxy:
enabled: true
default_config:
http_proxy: http://127.0.0.1:7890
socket5_proxy: socks5://127.0.0.1:7890
override_system_proxy_env: true # Override system proxy environment settings
permitted:
- "google.com"
denied:
- "localhost"
- "infinilabs.com"
- "api.coco.rs"
domains:
"github.com":
http_proxy: http://127.0.0.1:7890
socket5_proxy: socks5://127.0.0.1:7890
custom_profile:
proxy:
enabled: false
Parameters
#
HTTP Client Configuration: http_client
#
Name | Type | Description |
---|
key | map[string]HTTPClientConfig | Each key represents a named HTTP client configuration. For example, default or custom . |
default | HTTPClientConfig | The default configuration used as a fallback when no specific configuration is specified. |
HTTP Client Config: HTTPClientConfig
#
Name | Type | Description |
---|
proxy | ProxyConfig | Configuration for proxy usage, including domain rules and proxy settings. |
timeout | string | The overall timeout for HTTP requests. |
dial_timeout | string | The timeout for establishing connections. |
read_timeout | string | The timeout for reading data from the connection. |
write_timeout | string | The timeout for writing data to the connection. |
read_buffer_size | int | The size of the read buffer. |
write_buffer_size | int | The size of the write buffer. |
tls_config | TLSConfig | Configuration for TLS settings. |
max_connection_per_host | int | The maximum number of connections per host. |
Proxy Configuration: ProxyConfig
#
Name | Type | Description |
---|
enabled | boolean | Enables or disables the use of a proxy. |
default_config | ProxyDetails | Default proxy settings, including HTTP and SOCKS5 proxies. |
override_system_proxy_env | boolean | Whether to override system-wide proxy environment variables. |
permitted | list | List of domains allowed to use the proxy. |
denied | list | List of domains denied from using the proxy. |
domains | map | Proxy settings per domain. |
Proxy Details: ProxyDetails
#
Name | Type | Description |
---|
http_proxy | string | URL of the HTTP proxy. |
socket5_proxy | string | URL of the SOCKS5 proxy. |
using_proxy_env | boolean | Whether to use system environment proxy settings (e.g., HTTP_PROXY ). |