Function warp_reverse_proxy::extract_request_data_filter
source · Expand description
Warp filter that extracts the relative request path, method, headers map and body of a request.
Examples found in repository?
src/lib.rs (line 98)
92 93 94 95 96 97 98 99 100 101 102 103 104 105
pub fn reverse_proxy_filter(
base_path: String,
proxy_address: String,
) -> impl Filter<Extract = (http::Response<Body>,), Error = Rejection> + Clone {
let proxy_address = warp::any().map(move || proxy_address.clone());
let base_path = warp::any().map(move || base_path.clone());
let data_filter = extract_request_data_filter();
proxy_address
.and(base_path)
.and(data_filter)
.and_then(proxy_to_and_forward_response)
.boxed()
}