internal/mcp: provide a customizable http.Client to client transports
Allow customizing the http.Client used for HTTP MCP client transports, by adding client options structs. Change-Id: I2297acb136f8d0f7fa70d58cd244a6a81cc89751 Reviewed-on: https://go-review.googlesource.com/c/tools/+/682756 Reviewed-by: Jonathan Amsterdam <jba@google.com> Auto-Submit: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
4012cc3d2e
commit
e228d78d19
1 changed files with 89 additions and 14 deletions
|
|
@ -33,7 +33,7 @@ func ExampleSSEHandler() {
|
|||
defer httpServer.Close()
|
||||
|
||||
ctx := context.Background()
|
||||
transport := mcp.NewSSEClientTransport(httpServer.URL)
|
||||
transport := mcp.NewSSEClientTransport(httpServer.URL, nil)
|
||||
client := mcp.NewClient("test", "v1.0.0", nil)
|
||||
cs, err := client.Connect(ctx, transport)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue