Skip to content

Commit 2948106

Browse files
committed
add with_client option
1 parent 26f0b44 commit 2948106

File tree

1 file changed

+11
-0
lines changed
  • crates/rmcp/src/transport

1 file changed

+11
-0
lines changed

crates/rmcp/src/transport/sse.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ impl ReqwestSseClient {
108108
sse_url: url,
109109
})
110110
}
111+
112+
pub async fn new_with_client<U>(url: U, client: HttpClient) -> Result<Self, SseTransportError>
113+
where
114+
U: IntoUrl,
115+
{
116+
let url = url.into_url()?;
117+
Ok(Self {
118+
http_client: client,
119+
sse_url: url,
120+
})
121+
}
111122
}
112123

113124
impl SseClient for ReqwestSseClient {

0 commit comments

Comments
 (0)