System.Net.ServerSentEvents 10.0.11

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
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/4442a188f9200a57635373dcd640893c0e8dcc78
14
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
14
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
14
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
12
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/c70204ae3c91d2b48fa6d9b92b62265f368421b4
11
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
11
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
11
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/b96167fbfe8bd45d94e4dcda42c7d09eb5745459
11
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
11
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
10
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/215a587e52efa710de84138b0a3374b860b924d8
10
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
10
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
9
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/c22dcd0c7a78d095a94d20e59ec0271b9924c82c
8
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/5bae930797f60d2d04f3b1df6a33eaca85fc5f28
8
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/f736effe82a61eb6f5eba46e4173eae3b7d3dffd
8
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/44525024595742ebe09023abe709df51de65009b
8
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/de35e2b0a0d8d5d1e307907983a6838da1092898
7
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
7
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/abc2c7226ff616316cd1e05d76e6c36b49ce06a1
7

.NET Framework 4.6.2

.NET 8.0

  • No dependencies.

.NET 9.0

  • No dependencies.

.NET 10.0

  • No dependencies.

.NET Standard 2.0

Version Downloads Last updated
11.0.0-rc.1.26425.128 1 09/20/2026
11.0.0-preview.7.26381.103 1 09/20/2026
11.0.0-preview.6.26359.118 2 07/23/2026
11.0.0-preview.5.26302.115 4 06/15/2026
11.0.0-preview.4.26230.115 4 05/19/2026
11.0.0-preview.3.26207.106 5 04/26/2026
11.0.0-preview.2.26159.112 7 03/13/2026
11.0.0-preview.1.26104.118 7 02/22/2026
10.0.12 1 09/19/2026
10.0.11 1 09/19/2026
10.0.10 2 07/22/2026
10.0.9 4 06/15/2026
10.0.8 4 05/19/2026
10.0.7 6 04/26/2026
10.0.6 6 04/26/2026
10.0.5 7 03/13/2026
10.0.4 7 03/13/2026
10.0.3 7 02/22/2026
10.0.2 8 01/16/2026
10.0.1 8 01/17/2026
10.0.0 8 01/16/2026
10.0.0-rc.2.25502.107 9 11/09/2025
10.0.0-rc.1.25451.107 10 09/12/2025
10.0.0-preview.7.25380.108 10 09/13/2025
10.0.0-preview.6.25358.103 10 09/13/2025
10.0.0-preview.5.25277.114 11 06/23/2025
10.0.0-preview.4.25258.110 11 05/24/2025
10.0.0-preview.3.25171.5 11 05/24/2025
10.0.0-preview.2.25163.2 13 03/22/2025
10.0.0-preview.1.25080.5 13 03/22/2025
9.0.20 1 09/20/2026
9.0.19 1 09/20/2026
9.0.18 2 07/23/2026
9.0.17 4 06/15/2026
9.0.16 4 05/19/2026
9.0.15 6 04/26/2026
9.0.14 7 03/13/2026
9.0.13 7 02/22/2026
9.0.12 8 01/16/2026
9.0.11 8 01/17/2026
9.0.10 9 11/09/2025
9.0.9 10 09/12/2025
9.0.8 10 09/12/2025
9.0.7 10 09/12/2025
9.0.6 11 06/23/2025
9.0.5 11 05/24/2025
9.0.4 11 05/24/2025
9.0.3 12 03/22/2025
9.0.2 12 03/22/2025
9.0.1 12 03/22/2025
9.0.0 12 03/22/2025
9.0.0-rc.2.24473.5 13 03/22/2025
9.0.0-rc.1.24431.7 13 03/22/2025
9.0.0-preview.7.24405.7 13 03/22/2025
9.0.0-preview.6.24327.7 13 03/22/2025