pub struct ProxyOptions {
pub upstream_proxy: ProxyConfig,
pub max_body_bytes: usize,
pub max_concurrent_requests: usize,
pub upstream_timeout: Duration,
pub header_timeout: Duration,
pub body_timeout: Duration,
pub idle_timeout: Duration,
pub logger: Option<BodyLogger>,
}std only.Expand description
Transport, resource limits, and optional logging for a Proxy.
Fields§
§upstream_proxy: ProxyConfigHow to connect upstream; defaults to shared environment/native discovery.
max_body_bytes: usizeMaximum buffered request body size; defaults to 16 MiB.
max_concurrent_requests: usizeMaximum requests in progress, including streaming responses; defaults to 32. Further requests receive HTTP 503 immediately.
upstream_timeout: DurationDeadline for upstream response headers; defaults to 120 seconds.
Includes connection establishment, but does not limit response streaming. Each connection, including one Hyper finishes in the background for its pool, is also limited separately to this duration.
header_timeout: DurationDeadline for receiving HTTP/1 request headers in Proxy::serve;
defaults to 30 seconds. Slower clients are disconnected.
body_timeout: DurationDeadline for receiving the complete request body; defaults to 60 seconds. Slower uploads receive HTTP 408 without reaching upstream.
idle_timeout: DurationLongest wait for each upstream response chunk; defaults to 120 seconds.
A stalled stream is aborted on expiry, so that it cannot delay graceful shutdown indefinitely. Total streaming time remains unlimited.
logger: Option<BodyLogger>Optional request and response body log; disabled by default.
Trait Implementations§
Source§impl Clone for ProxyOptions
impl Clone for ProxyOptions
Auto Trait Implementations§
impl Forget for ProxyOptions
impl Freeze for ProxyOptions
impl Move for ProxyOptions
impl RefUnwindSafe for ProxyOptions
impl Send for ProxyOptions
impl Sync for ProxyOptions
impl Unpin for ProxyOptions
impl UnsafeUnpin for ProxyOptions
impl UnwindSafe for ProxyOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more