Struct kvarn_extensions::reverse_proxy::Manager
source · pub struct Manager { /* private fields */ }
Available on crate feature
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.
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
.