mirror of
https://github.com/cloudflare/pingora.git
synced 2024-09-20 02:31:35 +02:00
Add Service<HttpProxy<T>>
constructor for providing name
This commit is contained in:
parent
7ce6f4ac1c
commit
8727b2466f
1 changed files with 14 additions and 0 deletions
|
@ -626,3 +626,17 @@ pub fn http_proxy_service<SV>(conf: &Arc<ServerConf>, inner: SV) -> Service<Http
|
|||
HttpProxy::new(inner, conf.clone()),
|
||||
)
|
||||
}
|
||||
|
||||
/// Create a [Service] from the user implemented [ProxyHttp].
|
||||
///
|
||||
/// The returned [Service] can be hosted by a [pingora_core::server::Server] directly.
|
||||
pub fn http_proxy_service_with_name<SV>(
|
||||
conf: &Arc<ServerConf>,
|
||||
inner: SV,
|
||||
name: &str,
|
||||
) -> Service<HttpProxy<SV>> {
|
||||
Service::new(
|
||||
name.to_string(),
|
||||
HttpProxy::new(inner, conf.clone()),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue