Skip to content

Commit 1f5efb5

Browse files
committed
add doc
1 parent 4313aa1 commit 1f5efb5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

examples/simple_client/main.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ func main() {
7676
fmt.Println("Initializing HTTP client...")
7777
// Create HTTP transport
7878
httpTransport, err := transport.NewStreamableHTTP(*httpURL)
79+
// NOTE: the default streamableHTTP transport is not 100% identical to the stdio client.
80+
// By default, it could not receive global notifications (e.g. toolListChanged).
81+
// You need to enable the `WithContinuousListening()` option to establish a long-live connection,
82+
// and receive the notifications any time the server sends them.
83+
//
84+
// httpTransport, err := transport.NewStreamableHTTP(*httpURL, transport.WithContinuousListening())
7985
if err != nil {
8086
log.Fatalf("Failed to create HTTP transport: %v", err)
8187
}

0 commit comments

Comments
 (0)