pub struct ProxyHandler { /* private fields */ }Implementations§
Source§impl ProxyHandler
impl ProxyHandler
pub fn new(proxy_config: ProxyConfig) -> Self
Sourcepub fn find_proxy_route(&self, path: &str) -> Option<&ProxyRoute>
pub fn find_proxy_route(&self, path: &str) -> Option<&ProxyRoute>
Find the appropriate proxy route for a given path
Sourcepub fn select_upstream(&self, upstream_name: &str) -> Result<&UpstreamConfig>
pub fn select_upstream(&self, upstream_name: &str) -> Result<&UpstreamConfig>
Select an upstream server for a given upstream name
Sourcepub fn get_upstream_url(&self, upstream: &UpstreamConfig) -> Result<Url>
pub fn get_upstream_url(&self, upstream: &UpstreamConfig) -> Result<Url>
Create HTTP peer for upstream server (simplified)
Sourcepub fn transform_path(&self, route: &ProxyRoute, original_path: &str) -> String
pub fn transform_path(&self, route: &ProxyRoute, original_path: &str) -> String
Transform request path according to route configuration
Sourcepub fn add_proxy_headers(
&self,
req: &mut RequestHeader,
session: &Session,
original_host: &str,
)
pub fn add_proxy_headers( &self, req: &mut RequestHeader, session: &Session, original_host: &str, )
Add proxy headers to upstream request
Sourcepub async fn handle_proxy_request(
&self,
session: &mut Session,
_site: &SiteConfig,
path: &str,
) -> Result<bool>
pub async fn handle_proxy_request( &self, session: &mut Session, _site: &SiteConfig, path: &str, ) -> Result<bool>
Handle a proxy request for a specific site and path
Auto Trait Implementations§
impl Freeze for ProxyHandler
impl RefUnwindSafe for ProxyHandler
impl Send for ProxyHandler
impl Sync for ProxyHandler
impl Unpin for ProxyHandler
impl UnwindSafe for ProxyHandler
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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