System.Net.ServerSentEvents 11.0.0-preview.4.26230.115

About

System.Net.ServerSentEvents provides the SseParser type, which exposes factory methods for creating parsers for the events in a stream of server-sent events (SSE).

Key Features

  • Parser for server-sent events (SSE)

How to Use

Asynchronously parsing event contents as strings

using HttpClient client = new();
using Stream stream = await client.GetStreamAsync("https://localhost:12345/sse");
await foreach (SseItem<string> item in SseParser.Create(stream).EnumerateAsync())
{
    Console.WriteLine(item.Data);
}

Synchronously parsing event contents as JSON

MemoryStream stream = new(data);
foreach (SseItem<Book> item in SseParser.Create(stream, (eventType, bytes) => JsonSerializer.Deserialize<Book>(bytes)).Enumerate())
{
    Console.WriteLine(item.Data.Author);
}

Main Types

The main types provided by this library are:

  • System.Net.ServerSentEvents.SseParser
  • System.Net.ServerSentEvents.SseParser<T>
  • System.Net.ServerSentEvents.SseItem<T>

Feedback & Contributing

System.Net.ServerSentEvents is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on System.Net.ServerSentEvents.

Packages Downloads
OpenAI
The official .NET library for the OpenAI service API.
40
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/d5dc8a13cc618b9cbdc1e5744b4806c594d49553
32
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/dotnet/tree/89c8f6a112d37d2ea8b77821e56d170a1bccdc5a
30
OpenAI
The official .NET library for the OpenAI service API.
29
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/d3aba8fe1a0d0f5c145506f292b72ea9d28406fc
29
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/dotnet/tree/b0f34d51fccc69fd334253924abd8d6853fad7aa
28
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/f6b3a5da75eb405046889a5447ec9b14cc29d285
26
OpenAI
The official .NET library for the OpenAI service API.
26
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/ed74665e773dd1ebea3289c5662d71c590305932
25
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/af22effae4069a5dfb9b0735859de48820104f5b
24
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/dotnet/tree/75972a5ba730bdaf7cf3a34f528ab0f5c7f05183
24
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/dotnet/tree/ddf39a1b4690fbe23aea79c78da67004a5c31094
23
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/763b4ef31ca4df6dae07c7ee8f39ea259b6980fa
23
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/dotnet/tree/fad253f51b461736dfd3cd9c15977bb7493becef
22
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/379bfc7b2559e7cc9f42f997a497b2f2dd8e12d2
21
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/b225d30209cf027c80b741d04efe1c54f2431b3c
21
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/704f7cb1d2cea33afb00c2097731216f121c2c73
21
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/ff66c263be7ed395794bdaf616322977b8ec897c
21
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/dotnet/tree/30000d883e06c122311a66894579bc12329a09d4
21
Microsoft.AspNetCore.Http.Connections.Client
Client for ASP.NET Core Connection Handlers This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/280c613963a1768b810d09f32c998fe4490855e9
20

.NET 10.0

  • No dependencies.

.NET 11.0

  • No dependencies.

.NET Framework 4.6.2

.NET Standard 2.0

Version Downloads Last updated
11.0.0-preview.4.26230.115 4 5/15/2026
11.0.0-preview.3.26207.106 7 5/4/2026
11.0.0-preview.2.26159.112 10 3/12/2026
11.0.0-preview.1.26104.118 11 2/17/2026
10.0.8 5 5/15/2026
10.0.7 6 5/4/2026
10.0.6 8 5/4/2026
10.0.5 13 3/13/2026
10.0.4 12 3/12/2026
10.0.3 11 2/19/2026
10.0.2 16 1/14/2026
10.0.1 24 12/11/2025
10.0.0 22 12/11/2025
10.0.0-rc.2.25502.107 21 12/11/2025
10.0.0-rc.1.25451.107 21 12/11/2025
10.0.0-preview.7.25380.108 23 12/11/2025
10.0.0-preview.6.25358.103 22 12/11/2025
10.0.0-preview.5.25277.114 22 12/11/2025
10.0.0-preview.4.25258.110 19 12/11/2025
10.0.0-preview.3.25171.5 20 12/11/2025
10.0.0-preview.2.25163.2 19 12/11/2025
10.0.0-preview.1.25080.5 23 12/11/2025
9.0.16 5 5/15/2026
9.0.15 9 5/4/2026
9.0.14 11 3/12/2026
9.0.13 11 2/19/2026
9.0.12 13 1/14/2026
9.0.11 20 12/11/2025
9.0.10 24 12/11/2025
9.0.9 22 12/11/2025
9.0.8 26 12/11/2025
9.0.7 19 12/11/2025
9.0.6 19 12/11/2025
9.0.5 21 12/11/2025
9.0.4 24 12/11/2025
9.0.3 21 12/11/2025
9.0.2 21 12/11/2025
9.0.1 24 12/11/2025
9.0.0 17 12/11/2025
9.0.0-rc.2.24473.5 21 12/11/2025
9.0.0-rc.1.24431.7 20 12/11/2025
9.0.0-preview.7.24405.7 21 12/11/2025
9.0.0-preview.6.24327.7 20 12/11/2025