SemaBuzz.Protocol 1.0.2

dotnet add package SemaBuzz.Protocol --version 1.0.2
                    
NuGet\Install-Package SemaBuzz.Protocol -Version 1.0.2
                    
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="SemaBuzz.Protocol" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SemaBuzz.Protocol" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SemaBuzz.Protocol" />
                    
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 SemaBuzz.Protocol --version 1.0.2
                    
#r "nuget: SemaBuzz.Protocol, 1.0.2"
                    
#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 SemaBuzz.Protocol@1.0.2
                    
#: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=SemaBuzz.Protocol&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=SemaBuzz.Protocol&version=1.0.2
                    
Install as a Cake Tool

⚑ SemaBuzz Protocol

License: AGPL v3 .NET 9.0 Contributions Welcome

Encrypted. Direct. Alive.
A pure .NET 9 library that gives your app a real-time, end-to-end encrypted communication wire β€” complete with live keystroke streaming, NAT hole-punching, file transfers, and a shared whiteboard. No servers required beyond a lightweight relay for matchmaking.

✨ What it does

  • πŸ”’ End-to-end encryption β€” ephemeral ECDH P-256 key exchange + AES-256-GCM on every packet. The relay never sees plaintext. Ever.
  • ⚑ Goes direct when it can β€” built-in STUN (RFC 5389) + concurrent UDP hole-punching punches through most NATs for the lowest possible latency.
  • ⌨️ Streams keystrokes, not messages β€” characters fly across the wire one at a time with a calculated typing intensity (0–255), so the other side can render a live, tactile response as you type.
  • πŸ›œ Relay fallback β€” when UDP is completely blocked, the connection falls back gracefully to WebSocket relay mode. Transparent to your app.
  • πŸ“¦ Rich data sync out of the box:
    • 🎨 Real-time whiteboard strokes (SemaBuzzDraw)
    • πŸ“ File transfers up to 10 MB (SHA-256 verified on receipt)
    • πŸ‘€ Profile metadata β€” handles, avatars, statuses
    • πŸ”— URL card pushing

πŸ“– Two things worth knowing first

1. The connection lifecycle

Every connection moves through four states (SemaBuzzWireState):

State What's happening
Cold Initialized, ready to dial
Warming STUN + hole-punch probes flying, relay negotiation in progress
Secured Keys exchanged, AES context live β€” encrypted streaming begins
Dead Connection closed or timed out

2. Intensity β€” not "user is typing…"

SemaBuzz doesn't send typing indicators. It streams every individual keystroke. The SemaBuzzStreamer measures the velocity of each keypress and stamps an Intensity byte (0–255) onto the wire packet. Your UI can use that number to drive a glowing filament, a vibrating bar, or anything else β€” purely from how fast the other person is hammering their keyboard.

πŸ“¦ Install

dotnet add package SemaBuzz.Protocol

or via the NuGet Package Manager:

Install-Package SemaBuzz.Protocol

⚑ Quick start

Two classes. One connection. Let's go.

You'll need a relay running locally first β€” grab SemaBuzz Relay and run it on port 7171.

The Host (waits for someone to join)

using var listener = new SemaBuzzListener();

// Auto-accept all incoming connection requests
listener.ConnectionApprovalCallback = (peer) => Task.FromResult(true);

// Bind to event before listening
listener.PacketReceived += (s, e) => Console.Write(e.Packet.Character);

// Start listening passively in a relay room "HELLO"
_ = listener.ListenViaRelayAsync("ws://localhost:7171/relay", "HELLO");

The Client (dials in)

using var client = new SemaBuzzClient();

// Connect out to the room "HELLO"
_ = client.ConnectViaRelayAsync("ws://localhost:7171/relay", "HELLO");

// Wait for state to become Secured (event: WireStateChanged)

Send data (works on both sides once Secured)

var streamer = new SemaBuzzStreamer();

// Every keystroke generates an encrypted packet on the wire
streamer.PacketReady += async (s, e) => 
{
    if (client.State == SemaBuzzWireState.Secured)
    {
        await client.SendAsync(e.Packet);
    }
};

// Feed raw characters as the user types
streamer.Feed('h');
streamer.Feed('e');
streamer.Feed('l');

πŸ—οΈ Architecture

Zero UI dependencies. Zero framework lock-in. The library wraps base .NET networking and crypto primitives β€” no NuGet bloat. Drop it into WPF, MAUI, a headless bot, or a terminal app and it just works.

Key classes

Class Role
SemaBuzzClient / SemaBuzzListener Outbound dialer and inbound listener
SemaBuzzShield ECDH key generation, HKDF-SHA256 derivation, per-packet AES-256-GCM
SemaBuzzStreamer Converts keystrokes into intensity-stamped wire packets
SemaBuzzPunchThrough Orchestrates concurrent UDP hole-punch probes

πŸš€ Build it yourself

git clone https://github.com/skynrlabs/SemaBuzz-Protocol.git
cd SemaBuzz-Protocol
dotnet build
dotnet test

Then fire up examples/SemaBuzz.ConsoleDemo to see live keystroke streaming in action between two local processes.

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for the branch model, coding standards, and PR process.

βš–οΈ License

SemaBuzz Protocol is licensed under the GNU Affero General Public License v3.0. You are free to use, modify, and distribute it under those terms. Any application or service that uses this library must also be released under the AGPL-3.0.

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.
  • net9.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 91 5/15/2026
1.0.1 87 5/14/2026
1.0.0 160 5/13/2026