pub struct Manager { /* private fields */ }
reverse-proxy
only.Implementations§
Source§impl Manager
impl Manager
Sourcepub fn new(when: If, connection: GetConnectionFn, timeout: Duration) -> Self
pub fn new(when: If, connection: GetConnectionFn, timeout: Duration) -> Self
Consider using static_connection
if your connection type is not dependent of the request.
Sourcepub fn disable_url_rewrite(self) -> Self
pub fn disable_url_rewrite(self) -> Self
Disables the built-in feature of rewriting the relative URLs so they point to the forwarded site.
NOTE that rewrite doesn’t work when the response body is streamed.
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Set the priority of the extension. The default is -128
.
Sourcepub fn add_modify_fn(self, modify: ModifyRequestFn) -> Self
pub fn add_modify_fn(self, modify: ModifyRequestFn) -> Self
Add a function to run before the request is sent. These are ran in the order they are added in.
Sourcepub fn with_x_real_ip(self) -> Self
pub fn with_x_real_ip(self) -> Self
Add a modify fn which adds the IP of the request as the header
x-real-ip
.
Sourcepub fn base(
base_path: &str,
connection: GetConnectionFn,
timeout: Duration,
) -> Self
pub fn base( base_path: &str, connection: GetConnectionFn, timeout: Duration, ) -> Self
Consider using static_connection
if your connection type is not dependent of the request.
Sourcepub fn mount(self, extensions: &mut Extensions)
pub fn mount(self, extensions: &mut Extensions)
Attach this reverse proxy to extensions
.
!!Please!! use a crate::force_cache
extension on the paths where the reverse proxy
acts, with comprash::ClientCachePreference::Ignore
.
ALSO, disable server cache!