Http Client Configuration

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
  gitlab_p12:
    tls:
      enabled: true
      cert_file: /fullpath/test-client.p12
      cert_password: "12345"

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.
tlsTLSConfigConfiguration 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).

TLS Configuration: TLSConfig #

NameTypeDescription
enabledbooleanEnables or disables TLS/SSL for the connection.
cert_filestringPath to the TLS certificate file. Support PKCS#12 and PEM file.
cert_passwordstringPassword for the TLS certificate file (if encrypted).
key_filestringPath to the TLS private key file.
ca_filestringPath to the Certificate Authority (CA) certificate file.
skip_insecure_verifybooleanSkip TLS certificate verification (insecure - use with caution).
default_domainstringDefault domain for TLS certificate generation.
skip_domain_verifybooleanSkip domain verification for AutoIssue certificates.
client_session_cache_sizeintSize of the client TLS session cache.
Edit Edit this page