pub struct ProxyHandler {
pub config: ProxyConfig,
}
Expand description
HTTP proxy request handler
Fields§
§config: ProxyConfig
Handler configuration
Implementations§
Source§impl ProxyHandler
impl ProxyHandler
Sourcepub fn new(config: ProxyConfig) -> Self
pub fn new(config: ProxyConfig) -> Self
Create a new proxy handler
Sourcepub async fn handle_request(
&self,
method: &str,
url: &str,
headers: &HashMap<String, String>,
body: Option<&[u8]>,
) -> Result<ProxyResponse>
pub async fn handle_request( &self, method: &str, url: &str, headers: &HashMap<String, String>, body: Option<&[u8]>, ) -> Result<ProxyResponse>
Handle an HTTP request by proxying it
Sourcepub async fn proxy_request(
&self,
method: &Method,
uri: &Uri,
headers: &HeaderMap,
body: Option<&[u8]>,
) -> Result<ProxyResponse>
pub async fn proxy_request( &self, method: &Method, uri: &Uri, headers: &HeaderMap, body: Option<&[u8]>, ) -> Result<ProxyResponse>
Proxy a request with full HTTP types
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<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