From 24a3bf04d70cf91bb00878a725945ef666a0ebf3 Mon Sep 17 00:00:00 2001 From: tra4less Date: Mon, 2 Jun 2025 15:47:17 +0000 Subject: [PATCH] [streamable-http] Add ability to override the http.Client --- client/transport/streamable_http.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/transport/streamable_http.go b/client/transport/streamable_http.go index b798a1297..277d02ba5 100644 --- a/client/transport/streamable_http.go +++ b/client/transport/streamable_http.go @@ -21,6 +21,13 @@ import ( type StreamableHTTPCOption func(*StreamableHTTP) +// WithHTTPClient sets a custom HTTP client on the StreamableHTTP transport. +func WithHTTPBasicClient(client *http.Client) StreamableHTTPCOption { + return func(sc *StreamableHTTP) { + sc.httpClient = client + } +} + func WithHTTPHeaders(headers map[string]string) StreamableHTTPCOption { return func(sc *StreamableHTTP) { sc.headers = headers