[1.16] Adds Server-Sent Events docs (#4842)

* [1.16] Adds Server-Sent Events docs

Fixes https://github.com/dapr/docs/issues/4788

Signed-off-by: joshvanl <me@joshvanl.dev>

* Adds an example of using sse headers

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
Co-authored-by: Marc Duiker <marcduiker@users.noreply.github.com>
Co-authored-by: Mark Fussell <markfussell@gmail.com>
This commit is contained in:
Josh van Leeuwen 2025-09-05 18:56:46 -03:00 committed by GitHub
parent d6656a7c9c
commit 82878268e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 0 deletions

View File

@ -123,6 +123,24 @@ spec:
key: tls.key
```
### Server-Sent Events
SSE enables real-time communication with streaming servers and MCP servers.
HTTP endpoints support [Server-Sent Events (SSE)](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events).
To use SSE, set the `Accept` header to `text/event-stream` in the `HTTPEndpoint` resource or in the service invocation request.
```yaml
apiVersion: dapr.io/v1alpha1
kind: HTTPEndpoint
metadata:
name: "mcp-server"
spec:
baseUrl: https://my-mcp-server:443
headers:
- name: "Accept"
value: "test/event-stream"
```
## Related Links
- [HTTPEndpoint reference]({{% ref httpendpoints-schema %}})