Documentation · Samples · Benchmarks · Contributing
Nalix is a modular, high-performance networking framework for .NET 10. It provides a complete stack for building real-time server applications — from low-level transport (TCP/UDP) to middleware pipelines, packet routing, and client SDKs — with a focus on zero-allocation hot paths, pluggable protocols, and enterprise-grade security.
- Features
- Architecture
- Requirements
- Benchmarks
- Packages
- Quick Start
- Installation
- Contributing
- Security
- License
| Category | Highlights |
|---|---|
| Cross-Platform | Runs on Windows, Linux, and macOS with .NET 10+. |
| High Performance | Zero-allocation serialization, shard-aware dispatch, and buffer pooling for thousands of concurrent connections. |
| Security-First | AEAD encryption (ChaCha20-Poly1305), Static-Ephemeral X25519 (Noise Protocol) with server identity pinning, and zero-RTT session resumption. |
| Pluggable Protocols | Swap network, serialization, or security protocols without modifying core logic. |
| Middleware Pipeline | Built-in authentication, rate limiting, traffic shaping, and audit logging — or write your own. |
| Real-Time Updates | Instant messaging, state synchronization, and live event broadcasting. |
| Extensible | Attribute-based packet routing, auto-discovered controllers, and fluent builder APIs. |
| Modern C# | Leverages C# 14 features — Span<T>, ref struct, pattern matching, and more. |
Nalix is a layered stack — each package depends only on lower levels, so you install just the layers you need. There are no circular references.
Level 4 Nalix.Hosting Host & builder APIs, bootstrap
Level 3 Nalix.Runtime Dispatch, middleware, throttling
Nalix.Network TCP/UDP transport, sessions
Nalix.SDK Client-side sessions & requests
Level 2 Nalix.Codec Framing, crypto, serialization
Nalix.Framework Identity, DI, task orchestration
Level 1 Nalix.Environment IO primitives, buffer leasing
Level 0 Nalix.Abstractions Contracts, enums (zero deps)
| Requirement | Version |
|---|---|
| .NET SDK | 10.0+ |
| C# Language | 14+ |
| IDE | Visual Studio 2026 / VS Code / Rider |
All benchmarks run on .NET 10.0, Windows 11, using BenchmarkDotNet v0.15.8.
- CPU: 13th Gen Intel Core i7-13620H (10C/16T)
- Runtime: .NET
10.0.5(X64 RyuJIT, Server GC) - SDK: .NET SDK
10.0.201 - Job config:
IterationCount=20,LaunchCount=3,WarmupCount=10,RunStrategy=Throughput
| Serializer | Serialize | Deserialize | Allocated |
|---|---|---|---|
| LiteSerializer | 149.9 ns | 142.9 ns | 664–856 B |
| MemoryPack | 121.6 ns | 145.0 ns | 664–888 B |
| MessagePack | 422.5 ns | 1,095.2 ns | 504–888 B |
| System.Text.Json | 897.7 ns | 2,548.2 ns | 1,976–7,200 B |
More details: See the
docs/benchmarksfolder for full data and additional test cases.
Nalix is composed of several modular packages — install only what you need.
| Package | Description |
|---|---|
| Nalix.Abstractions | Base abstractions, enums, and shared contracts for the Nalix ecosystem. |
| Nalix.Codec | High-performance framing, cryptography, and serialization. |
| Nalix.Environment | Low-level IO primitives, buffer leasing, and configuration loading. |
| Nalix.Framework | High-performance core: cryptography, identity, DI, serialization, and task orchestration. |
| Nalix.Runtime | Packet dispatching, middleware pipelines, protection primitives, and throttling. |
| Package | Description |
|---|---|
| Nalix.Network | High-performance TCP/UDP transport, connection management, and session persistence. |
| Nalix.Hosting | Microsoft-style host and builder APIs for quick bootstrapping. |
| Package | Description |
|---|---|
| Nalix.SDK | Client-side SDK: transport sessions, request/response patterns, and encryption. |
| Nalix.Analyzers | Roslyn analyzers, code fixes, and source generators — packed into Nalix.Abstractions. |
Build a high-performance network application in minutes:
using Nalix.Hosting;
using Nalix.Network.Options;
using Nalix.Runtime.Handlers;
using Nalix.Hosting.Protocols;
// Initialize and configure the application host
using var host = NetworkApplication.CreateBuilder()
.MapTcp<DefaultProtocol>().OnPort(8080).Bind()
.MapHandlers<HandshakeHandlers>()
.Configure<NetworkSocketOptions>(opt => opt.NoDelay = true)
.Build();
// Run the server
await host.RunAsync();Runnable end-to-end projects, from beginner to production-grade:
| Sample | Demonstrates |
|---|---|
| HelloWorld | Minimal TCP client/server — request/response packets, [PacketHandler], graceful shutdown. Start here. |
| ChatRoom | Server push — broadcasting to all clients via IConnectionBroadcaster, session.On<T>() on the client. |
| SecureMultiTransportHelloWorld | TCP + UDP + WebSocket under one secure session — X25519 handshake, AEAD encryption, authenticated UDP. |
# Core server setup
dotnet add package Nalix.Hosting
# Optional: client SDK
dotnet add package Nalix.SDK
# Optional: Roslyn analyzers + source generators (packed into Abstractions)
dotnet add package Nalix.AbstractionsPlease read CONTRIBUTING.md for the development workflow, commit conventions, and pull request guidelines. Follow our Code of Conduct and submit PRs with proper documentation and tests.
Please review our Security Policy for supported versions and vulnerability reporting procedures.
Nalix is copyright © PhcNguyen — provided under the Apache License, Version 2.0.
For questions, suggestions, or support, open an issue on GitHub Issues or start a GitHub Discussion.