pub struct ProxyConfig {
pub enabled: bool,
pub target_url: Option<String>,
pub timeout_seconds: u64,
pub follow_redirects: bool,
pub headers: HashMap<String, String>,
pub prefix: Option<String>,
pub passthrough_by_default: bool,
pub rules: Vec<ProxyRule>,
}
Expand description
Configuration for proxy behavior
Fields§
§enabled: bool
Whether the proxy is enabled
target_url: Option<String>
Target URL to proxy requests to
timeout_seconds: u64
Timeout for proxy requests in seconds
follow_redirects: bool
Whether to follow redirects
headers: HashMap<String, String>
Additional headers to add to proxied requests
prefix: Option<String>
Proxy prefix to strip from paths
passthrough_by_default: bool
Whether to proxy by default
rules: Vec<ProxyRule>
Proxy rules
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn should_proxy(&self, _method: &Method, path: &str) -> bool
pub fn should_proxy(&self, _method: &Method, path: &str) -> bool
Check if a request should be proxied
Sourcepub fn get_upstream_url(&self, path: &str) -> String
pub fn get_upstream_url(&self, path: &str) -> String
Get the upstream URL for a specific path
Sourcepub fn strip_prefix(&self, path: &str) -> String
pub fn strip_prefix(&self, path: &str) -> String
Strip the proxy prefix from a 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
Source§impl Default for ProxyConfig
impl Default for ProxyConfig
Source§impl<'de> Deserialize<'de> for ProxyConfig
impl<'de> Deserialize<'de> for ProxyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin 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