SemaBuzz.Protocol
1.0.2
dotnet add package SemaBuzz.Protocol --version 1.0.2
NuGet\Install-Package SemaBuzz.Protocol -Version 1.0.2
<PackageReference Include="SemaBuzz.Protocol" Version="1.0.2" />
<PackageVersion Include="SemaBuzz.Protocol" Version="1.0.2" />
<PackageReference Include="SemaBuzz.Protocol" />
paket add SemaBuzz.Protocol --version 1.0.2
#r "nuget: SemaBuzz.Protocol, 1.0.2"
#:package SemaBuzz.Protocol@1.0.2
#addin nuget:?package=SemaBuzz.Protocol&version=1.0.2
#tool nuget:?package=SemaBuzz.Protocol&version=1.0.2
β‘ SemaBuzz Protocol
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 | Versions 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. |
-
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.