Skip to content
v2.0.2 Active

A Binary Protocol Built for Extreme Speed

AfterLink provides persistent socket connections, native pub/sub routing, and automatic schema validation—all compressed into a 16-byte Protocol v2 header. Built with zero dependencies.

npm packages (v2.0.2+ ensures 0 vulnerabilities)

$ npm install @ajaymyth/core @ajaymyth/server @ajaymyth/client @ajaymyth/browser @ajaymyth/cli @ajaymyth/cluster
$ npm install afterlink@latest
npmjs.com/package/@ajaymyth/server ↗
$ pip install afterlink
$ pub add afterlink

or install modules individually

npm install @ajaymyth/server
npm install @ajaymyth/cluster
pip install afterlink
pub add afterlink

AI agent skill (skills.sh)

$ npx skills add AJAYMYTH/afterlink-skill

upgrade existing project to latest

$ npx afterlink upgrade
AfterLink 10-Byte Frame Layout
Total: 10B Header + Variable Payload
Payload (12 Bytes - UTF8: "Hello World!")
48 65 6C 6C 6F 20 57 6F 72 6C 64 21

Interactive Spec Explorer

Hover over or select any byte group in the frame above to inspect the specific role it plays within the 10-byte binary header protocol.

Features Matrix

Built for real-time. Ready for production.

Persistent Connections

TCP connections stay open — no handshake overhead per request. AfterLink maintains a single long-lived socket with automatic keepalive pings every 30 seconds.

Built-in Pub/Sub

Native channel-based publish/subscribe baked into the protocol layer. Subscribe, publish, and broadcast with one line of code across connected clients.

Auto Validation

Zod & Pydantic schema validation built into route handlers. Invalid payloads are rejected at the protocol level before your business logic runs — zero boilerplate.

16-Byte Protocol v2 Header

Protocol v2 introduces a 16-byte fixed layout header featuring version negotiation (v1/v2), priority queues (0-7), custom string routing keys (0-255 bytes), and MessagePack payload serialization.

Node Clustering

Scale horizontally with @ajaymyth/cluster. Features Redis-backed shared pub/sub routing, worker crash detection/restarts, Redis Cluster support, and SIGUSR2 zero-downtime rolling restarts.

Metrics & Observability

Production monitoring out of the box with Prometheus endpoints, pre-built Grafana dashboard templates, and OpenTelemetry-compliant TracingManager with AsyncLocalStorage context propagation.

Python SDK

First-class Python client and server via pip install afterlink. Includes async client/server APIs, synchronous wrapper, complete type hints, and native Pydantic payload validation.

Dart & Flutter SDK

Native Dart client via pub add afterlink for Flutter and server apps. Supports native TCP and Web WebSocket transports with conditional compilation loaders.

Browser Bridge

Use AfterLink from any browser via the built-in WebSocket bridge. The @ajaymyth/browser package gives you the same API — no TCP required on the client side.

TLS + JWT Auth

First-class TLS support with afterlinks:// URIs. JWT middleware included out of the box. Dev certs generated automatically with generateDevCerts().

Redis Cluster Support

Cluster-wide pub/sub and slot routing using Redis.Cluster. Seamlessly distribute real-time messages across multi-node Redis deployments (v2.0.1+).

Explore →

Offline AI Assistant

Ask technical questions about AfterLink in your terminal. 100% offline RAG pipeline. 100% accuracy. No API keys.

How It Works

From connection to message in microseconds

  • 1
    TCP Connect Establish a persistent, reusable socket handshake via afterlink:// that stays open forever.
  • 2
    Binary Header Packing Wrap every message in a 16-byte Protocol v2 header with native MessagePack serialization.
  • 3
    Route & Fan-out Trigger custom schema validations and broadcast immediate low-latency fan-out events to all subscribers.

Performance

Numbers that matter

Benchmarked on Node.js 20, Apple M2, localhost — single connection.

30,167

messages / sec

0.033ms

avg latency

76%

faster than WebSocket

16B

v2 fixed header size

Throughput Comparison (msg/sec)

AfterLink
30,167
WebSocket
~17,200
Socket.io
~12,000
HTTP/2
~9,400

* Benchmarks measured on local network pipes. Actual throughput speeds scale based on system hardware.

Designed for the Next Web