pub struct ProxyConfig {
pub path: String,
pub target: String,
pub strip_prefix: bool,
pub timeout: Duration,
pub preserve_host: bool,
pub follow_redirects: bool,
}Expand description
Proxy configuration
Fields§
§path: StringPath pattern to match (e.g., “/api”)
target: StringTarget URL (e.g., “http://localhost:3000”)
strip_prefix: boolStrip the matched path prefix before forwarding
timeout: DurationConnection timeout
preserve_host: boolPreserve Host header
follow_redirects: boolFollow redirects
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn new(path: impl Into<String>, target: impl Into<String>) -> Self
pub fn new(path: impl Into<String>, target: impl Into<String>) -> Self
Create a new proxy config
Sourcepub fn with_strip_prefix(self, strip: bool) -> Self
pub fn with_strip_prefix(self, strip: bool) -> Self
Set strip prefix
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set timeout
Sourcepub fn with_preserve_host(self, preserve: bool) -> Self
pub fn with_preserve_host(self, preserve: bool) -> Self
Set preserve host
Sourcepub fn with_follow_redirects(self, follow: bool) -> Self
pub fn with_follow_redirects(self, follow: bool) -> Self
Set follow redirects
Sourcepub fn build_target_url(&self, request_path: &str) -> String
pub fn build_target_url(&self, request_path: &str) -> String
Build target URL for a request path
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 · 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