Skip to main content

Module http

Module http 

Source
Expand description

HTTP client with circuit breaker pattern.

Wraps reqwest::Client with automatic failure tracking per host. After repeated failures, requests fail fast to prevent cascade failures.

Structs§

CircuitBreakerClient
HTTP client with circuit breaker pattern.
CircuitBreakerConfig
Configuration for the circuit breaker.
CircuitBreakerOpen
Error returned when circuit breaker is open.
CircuitState
Circuit breaker state for a single host.
HttpClient
HTTP client facade that routes requests through a circuit breaker and can apply a default timeout to requests that do not set one explicitly.
HttpRequestBuilder
Request builder paired with a circuit-breaker-backed HTTP client.

Enums§

CircuitBreakerError
Error type for circuit breaker operations.
CircuitStatus
Circuit breaker status.

Functions§

build_ssrf_safe_client
Build a reqwest client with SSRF-safe DNS resolution. Hostnames that resolve to private/loopback/link-local IPs are rejected at the DNS layer.
is_private_ip
Returns true when the given IP is in a loopback, private (RFC 1918 / ULA), link-local, broadcast, unspecified, or documentation range. Also handles IPv4-mapped IPv6 addresses (::ffff:x.x.x.x).