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, which
bounds the memory used for request bodies (each up to the message
limit). Further requests get 503. Default: 256.
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: 1024.