Skip to content

Commit

Permalink
Add Service<HttpProxy<T>> constructor for providing name
Browse files Browse the repository at this point in the history
Includes-commit: 8727b24
Replicated-from: #218
  • Loading branch information
jamesmunns authored and eaufavor committed May 10, 2024
1 parent 2625a1b commit 8804889
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .bleep
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b15d1f685f4842d5cf638286a37e80cf55c3aa58
6c5858ed364e54961a79110d08f8cece89bb9b04
14 changes: 14 additions & 0 deletions pingora-proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -636,3 +636,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()),
)
}

0 comments on commit 8804889

Please sign in to comment.