Skip to content
v1.2.4 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 10-byte binary header. Built with zero dependencies.

npm packages (v1.2.4+ ensures 0 vulnerabilities)

$ npm install @afterlink/core @afterlink/server @afterlink/client @afterlink/browser @afterlink/cli
$ npm install afterlink@latest
npmjs.com/package/@afterlink/server ↗

or install modules individually

npm install @afterlink/server
npm install @afterlink/client
npm install @afterlink/browser
npm install @afterlink/cli

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. No Redis, no extra broker. Subscribe, publish, and broadcast with one line of code.

Auto Validation

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

10-Byte Binary Frame

Every message starts with a fixed 10-byte header containing magic bytes, version, message type, sequence number, and payload length. MessagePack serialization for the payload — compact and fast.

TLS + JWT Auth

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

Browser Bridge

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

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 lightweight 10-byte binary 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

10B

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