Realtime Networking Engine for Games & Interactive Apps

Handle 1000 realtime players with <20ms latency. Replace Socket.IO with 70% less overhead.

Install via npm

npm install @painda/core

Binary Speed • Custom Schemas • Zero Polling Fallback

The Performance Battle

See how PaindaProtocol stacks up against traditional JSON-based WebSocket libraries like Socket.IO under heavy load (1000+ simulated users).

Socket.IO

HTTP Polling Fallback + JSON Payload + Engine.IO overhead

Avg Latency
45.0ms
Player Position Packet
124bytes
Msg Throughput
3.1K/sec

PaindaProtocol

Pure WebSockets + Custom Binary Schema (Zero Polling)

Avg Latency
14.0ms
Player Position Packet
18bytes
Msg Throughput
9.2K/sec

Why is PaindaProtocol faster?

Not magic—just an obsessively optimized architecture built from the ground up for low latency.

01

Binary, Not JSON

PaindaProtocol encodes state into heavily packed binary frames using a shared schema, resulting in 70-90% smaller payloads than JSON. Smaller payloads = faster transmission & less serialization overhead.

02

Zero Polling Fallback

Unlike traditional libraries that start with 3 RTT HTTP polling before upgrading, PaindaProtocol establishes a pure WebSocket connection immediately.

03

No Engine.IO Overhead

We cut out the generic transport wrapper. Painda routing is binary-native with a 16-byte custom header for lightning-fast routing and decoding.

04

Delta Sync (Gaming Mode)

Instead of sending the entire game state, PaindaProtocol automatically calculates state diffs (deltas) server-side and applies tight patches on the client.

Features

Binary-First

Zero-copy DataView framing. No JSON overhead on the wire.

Socket.io-style API

server.to("room").emit() • socket.emit() • once() — feels familiar, runs faster.

Plugin System

server.register(plugin) — lifecycle hooks, inter-plugin APIs, dependency management.

Typed Rooms @60fps

server.room<T>(id, state) — auto delta-synced, configurable diff algorithm, per-room auth.

Presence

Track who's online with metadata. Built-in diff-mode for minimal bandwidth.

Middleware Pipeline

Express-style server.use() for auth, validation, rate limiting — per namespace.

Connection Recovery

Missed messages + room memberships replayed automatically after reconnect.

Configurable Everything

Deep config: logger, compression, heartbeat, rate limits, reconnect strategies.

Graceful Shutdown

server.gracefulShutdown(5000) — notifies clients, drains, then closes cleanly.

Live Server Metrics

server.getStats() → clients, rooms, namespaces, plugins, presence, uptime.

Namespaces

Multiplex /chat, /admin, /game over a single WebSocket connection.

Delta Engine

State sync via binary diffs, not full objects. 100× smaller payloads for gaming.

Your Stack

One protocol. Install only what you need — everything runs through the same binary pipeline, fully typed.

@painda/corealways included

Binary engine, Server, Client, Plugins, Rooms, Presence, Middleware.

@painda/chat

Rooms, direct messages, broadcasting, and presence.

@painda/gaming

Delta Engine — state sync via binary diffs at 60 FPS.

@painda/video

WebRTC signaling for low-latency P2P calls.

@painda/auth

Token-based authentication middleware with timeouts and guest mode.

@painda/persistence

Auto-persist messages to your DB with batch writes and metrics.

@painda/testingdev

createTestEnv(), waitForMessage(), collectMessages() — test your PP apps.

npm install @painda/core @painda/gaming @painda/chat

Why PP?

Every Socket.io feature, plus binary speed and gaming tools they don't have.

Speed / Latency

Socket.ioMedium (~100ms+)
uWS/BunExtremely high (<20ms)
PPExtremely high (<20ms)

DX / Comfort

Socket.ioHigh
uWS/BunLow (raw / complex)
PPHigh (Socket.io-like)

Binary Protocol

Socket.io❌ JSON-first
uWS/Bun⚠️ Manual
PP✅ Zero-Copy Native

Type Safety

Socket.ioPlugin-based
uWS/BunBarely existent
PPNative Typed Contracts

Namespaces

Socket.io✅ Built-in
uWS/Bun❌ None
PP✅ server.of()

Middleware

Socket.io✅ io.use()
uWS/Bun❌ Manual
PP✅ server.use()

Plugin System

Socket.io❌ None
uWS/Bun❌ None
PP✅ Lifecycle Hooks

Typed Rooms

Socket.io❌ Untyped
uWS/Bun❌ None
PP✅ Delta @60fps

Presence

Socket.io❌ None
uWS/Bun❌ None
PP✅ Built-in

Recovery

Socket.io✅ Since v4.6
uWS/Bun❌ None
PP✅ Full Replay

Configurable

Socket.io⚠️ Partial
uWS/Bun⚠️ Minimal
PP✅ Deep Config

Metrics API

Socket.io❌ None
uWS/Bun❌ None
PP✅ getStats()

Graceful Shutdown

Socket.io⚠️ Manual
uWS/Bun❌ None
PP✅ Built-in

Gaming Tools

Socket.io❌ None
uWS/Bun❌ None
PP✅ Delta Engine

Hardcore Dev Questions

No marketing fluff. Just technical answers.

PaindaProtocol has built-in smart reconnects with Exponential, Linear, or Fibonacci backoff strategies and auto-jitter out of the box. Simply set `reconnect: true` on the client. Offline messages are buffered in a local queue (up to a max size) and instantly flushed when the socket reopens.

Roadmap

Hard facts before empty promises. Each phase ships measurable results.

The Proofdone
  • No-BS benchmarks vs uWS, Bun, Socket.io
  • Interactive live demo (mini-game)
  • Core MVP: WebSocket wrapper + binary framing
Binary Framing & Typed Contractsdone
  • Wire format v2: 16-byte header with type IDs
  • Schema registry + built-in serializers
  • Full TS-interface integration for all modules
Socket.io Feature Paritydone
  • Namespaces, Middleware, Acknowledgements
  • Connection recovery + message replay
  • Adapter interface for horizontal scaling
  • HTTP long-polling fallback transport
Production-Readydone
  • Plugin System with lifecycle hooks
  • Typed Rooms with Delta Sync @60fps
  • Presence with diff-mode
  • Deep config: Logger, Rate Limiting, Reconnect
  • Graceful shutdown + server.getStats()
4Ecosystemcurrent
  • Redis adapter for horizontal scaling
  • Admin Dashboard (live stats, room inspector)
  • Community plugin registry via npm
5Future Transport
  • WebTransport & QUIC (<50ms latency)
  • Adaptive compression with Zstandard
  • Kubernetes adapter for auto-scaling