pub struct ProxyConfig {
pub listen: SocketAddr,
pub max_body_size: usize,
pub upstream_read_timeout: Duration,
pub upstream_connect_timeout: Duration,
pub proxy_api_key: Option<SecretString>,
pub proxy_token: Option<SecretString>,
pub proxy_auth_keys: HashMap<String, AuthKeyEntry>,
}Expand description
Core proxy configuration.
Fields§
§listen: SocketAddrAddress to listen on.
max_body_size: usizeMaximum request body size in bytes (default 16 MB).
upstream_read_timeout: DurationPer-read timeout for upstream HTTP responses.
This is the maximum idle time between successive socket reads, not the total request duration. A single read that takes longer than this will fail, but long-running streaming responses (SSE) are fine as long as the upstream sends data within this window.
upstream_connect_timeout: DurationTimeout for establishing upstream TCP connections.
proxy_api_key: Option<SecretString>Optional simple auth key (check Authorization: Bearer <key>).
proxy_token: Option<SecretString>Optional simple token auth (check X-Proxy-Token: <token>).
proxy_auth_keys: HashMap<String, AuthKeyEntry>Role-based auth: maps API keys to roles.
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn new(listen: SocketAddr) -> Self
pub fn new(listen: SocketAddr) -> Self
Creates a new ProxyConfig with the given listen address.
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProxyConfig
impl Debug for ProxyConfig
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnsafeUnpin for ProxyConfig
impl UnwindSafe for ProxyConfig
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
Mutably borrows from an owned value. Read more