Http Client

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 #

NameTypeDescription
keymap[string]HTTPClientConfigEach key represents a named HTTP client configuration. For example, default or custom.
defaultHTTPClientConfigThe default configuration used as a fallback when no specific configuration is specified.

HTTP Client Config: HTTPClientConfig #

NameTypeDescription
proxyProxyConfigConfiguration for proxy usage, including domain rules and proxy settings.
timeoutstringThe overall timeout for HTTP requests.
dial_timeoutstringThe timeout for establishing connections.
read_timeoutstringThe timeout for reading data from the connection.
write_timeoutstringThe timeout for writing data to the connection.
read_buffer_sizeintThe size of the read buffer.
write_buffer_sizeintThe size of the write buffer.
tls_configTLSConfigConfiguration for TLS settings.
max_connection_per_hostintThe maximum number of connections per host.

Proxy Configuration: ProxyConfig #

NameTypeDescription
enabledbooleanEnables or disables the use of a proxy.
default_configProxyDetailsDefault proxy settings, including HTTP and SOCKS5 proxies.
override_system_proxy_envbooleanWhether to override system-wide proxy environment variables.
permittedlistList of domains allowed to use the proxy.
deniedlistList of domains denied from using the proxy.
domainsmapProxy settings per domain.

Proxy Details: ProxyDetails #

NameTypeDescription
http_proxystringURL of the HTTP proxy.
socket5_proxystringURL of the SOCKS5 proxy.
using_proxy_envbooleanWhether to use system environment proxy settings (e.g., HTTP_PROXY).
Edit Edit this page