pub struct HttpConfig { /* private fields */ }Expand description
Security settings of the Streamable HTTP transport.
Implementations§
Source§impl HttpConfig
impl HttpConfig
Sourcepub fn oauth(self, oauth: OAuth) -> Self
pub fn oauth(self, oauth: OAuth) -> Self
Requires OAuth 2.1 access tokens on every request (the server acts
as a resource server). See OAuth.
Sourcepub fn allowed_origins(self, origins: AllowedOrigins) -> Self
pub fn allowed_origins(self, origins: AllowedOrigins) -> Self
Sets the accepted Origin values.
Sourcepub fn allowed_hosts(self, hosts: AllowedHosts) -> Self
pub fn allowed_hosts(self, hosts: AllowedHosts) -> Self
Sets the accepted Host values. Public deployments must list their
own host names (or use AllowedHosts::Any).
Sourcepub fn header_timeout(self, timeout: Duration) -> Self
pub fn header_timeout(self, timeout: Duration) -> Self
Time allowed, in serve, to receive a request’s headers, counted
from when the connection opens or becomes idle. Slower or idle
connections are closed (slow-loris protection). Default: 10 s.
Sourcepub fn body_timeout(self, timeout: Duration) -> Self
pub fn body_timeout(self, timeout: Duration) -> Self
Time allowed to receive a request body; slower clients get 408.
Default: 30 s.
Sourcepub fn max_in_flight(self, requests: usize) -> Self
pub fn max_in_flight(self, requests: usize) -> Self
Maximum number of requests being read or processed at once. Further
requests get 503. Default: 4096. Memory is bounded separately by
max_body_bytes_in_flight, so
requests that wait on other services can be numerous.
Sourcepub fn max_body_bytes_in_flight(self, bytes: usize) -> Self
pub fn max_body_bytes_in_flight(self, bytes: usize) -> Self
Maximum total size of the request bodies held at once (being read,
parsed or handled). A request reserves its Content-Length, or the
whole message limit when the length is unknown, and gets 503 when
the budget is spent. Values below the message limit are raised to it.
Default: 64 MiB.
Sourcepub fn max_connections(self, connections: usize) -> Self
pub fn max_connections(self, connections: usize) -> Self
Maximum number of open connections in serve; further connections
wait in the operating system’s accept queue. Default: 4096.