Lumen.Core 1.0.1

Suggested Alternatives

Lumen.Core 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Lumen.Core --version 1.0.1
                    
NuGet\Install-Package Lumen.Core -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lumen.Core" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lumen.Core" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Lumen.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lumen.Core --version 1.0.1
                    
#r "nuget: Lumen.Core, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lumen.Core@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lumen.Core&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Lumen.Core&version=1.0.1
                    
Install as a Cake Tool

πŸ”ŒLumen β€” SSE for ASP.NET Core

NuGet Downloads NuGet Version

A lightweight, configurable Server-Sent Events (SSE) library for ASP.NET Core.
Easily add real-time, uni-directional server-to-client messaging without WebSockets.


✨ Features

  • βœ… Simple integration with minimal APIs
  • 🧩 Middleware-based connection handling
  • 🧠 Supports multiple clients & devices per user
  • πŸ”„ Built-in ping/keep-alive
  • πŸ”§ Fully configurable endpoints and connection logic
  • πŸ“¦ .NET 6/7/8 compatible

πŸ“¦ Installation

Install via NuGet:

dotnet add package Lumen.SSE

πŸš€ Usage

1. Configure services

To customize global SSE behavior (ping interval, connection limits, etc.), see
πŸ‘‰ AddSse Configuration Options

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSse();
2. Configure middleware

To customize middleware-level behavior such as connection path, user/device IDs, etc., see
πŸ‘‰ UseSse Configuration Options

var app = builder.Build();
app.UseSse();
3. Send events
app.MapPost("/send-message", async (
    Message message,
    ISsePublisher sse)
    => await sse.New()
        .SetEvent("new_message")
        .SetData(message)
        .SendToAllClientsAsync());

πŸ“‘ Client-Side (JavaScript)

const sseUrl = `https://localhost:7287/sse/connection`;
const eventSource = new EventSource(sseUrl);

eventSource.onopen = () => {
    console.log("βœ… Connected to SSE server");
};

eventSource.addEventListener("new_message", (event) => {
    const parsedData = JSON.parse(event.data);
    console.log("πŸ“¨ New Message:", parsedData);
});

eventSource.onerror = (err) => {
    console.error("🚨 SSE connection error:", err);
};

πŸ” SSE vs WebSockets

Feature SSE (Server-Sent Events) WebSockets
Direction Server ➜ Client (one-way) Bi-directional (Client ⬄ Server)
Protocol HTTP/1.1 (works with HTTP/2 partial support) Custom over TCP (upgrades from HTTP)
Browser Support Widely supported, except for IE/old Edge Widely supported
Complexity Simple to implement More complex (stateful, needs connection management)
Reconnection Built-in automatic reconnection Manual reconnection logic
Use Case Notifications, live feeds, updates Chat apps, multiplayer games, complex interaction
Proxy-Friendly Yes Sometimes blocked by firewalls/proxies

🟒 Use SSE when:

  • You only need server-to-client updates
  • You want a simple, scalable, and HTTP-friendly solution

🟑 Use WebSockets when:

  • You need real-time two-way communication
  • The client should also be able to push events to the server

πŸ’‘ Why choose Lumen (SSE)?

  • Zero dependencies
  • High performance for broadcasting updates
  • Great for lightweight, read-only real-time applications

πŸ’¬ Questions? Feedback?

Feel free to open an issue or contact the maintainer.


Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Lumen.Core:

Package Downloads
Lumen.SSE

A lightweight and flexible Server-Sent Events (SSE) library for ASP.NET Core. Easily stream real-time events from your server to browser clients using a simple, extensible API. Supports connection management, custom event types, client identification, and built-in heartbeat/keep-alive logic.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 196 4/28/2025
1.0.3 116 4/19/2025
1.0.1 127 4/19/2025 1.0.1 is deprecated because it has critical bugs.
1.0.0 180 4/9/2025