Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/foxytp/stelar-time-real/llms.txt

Use this file to discover all available pages before exploring further.

stelar-time-real is a real-time communication library built entirely from Node.js built-in modules. It runs its own WebSocket server (RFC 6455, implemented without any external library) and a custom binary TCP protocol on a separate port — no ws, no engine.io, no bloat. Every byte on the wire is owned by the library.

Quickstart

Install and run your first real-time server in minutes.

Architecture

Understand the dual-protocol design and binary frame format.

Server API

Full reference for StelarServer methods, options, and lifecycle.

Client API

Full reference for StelarClient methods, events, and connection state.

Why stelar-time-real?

Most real-time libraries wrap third-party packages, adding dependency chains, vulnerability surface, and breaking change risk. stelar-time-real has exactly zero runtime dependencies — it uses only http, net, crypto, and tls from Node.js core.

Zero Dependencies

No ws, no engine.io. Nothing in node_modules except your own code.

Dual Protocol

WebSocket for browsers, custom binary TCP for Node.js microservices — same API, same rooms.

Production Ready

Rate limiting, TLS, graceful shutdown, health check, origin validation — built in from day one.

Full TypeScript

Written in TypeScript. Bundled .d.ts definitions — no @types package needed.

Runtime Config

Change server and client configuration on the fly with updateConfig() and updateOptions().

Extensible

Replace the rate limiter, IP tracker, and client ID generator with your own implementations.

Get started

1

Install the package

npm install stelar-time-real
2

Create your server

server.js
import { StelarServer } from 'stelar-time-real';

const stelar = new StelarServer({ port: 3000 });

stelar.onConnection((client) => {
  client.emit('welcome', { message: 'Hello!' });
});

stelar.on('chat', (ctx) => {
  ctx.broadcast('chat', ctx.data, ctx.id);
});

await stelar.start();
console.log('Listening on port', stelar.getPort());
3

Connect a client

client.js
import { StelarClient } from 'stelar-time-real';

const client = new StelarClient('localhost:3000');
client.on('connect', () => client.emit('chat', { text: 'Hello world!' }));
client.connect();

Explore the docs

Middleware

Authenticate connections and validate requests before they reach your handlers.

Rooms

Group clients into channels for targeted broadcasts.

ACK / Request-Response

Build reliable request-response patterns over the real-time protocol.

Rate Limiting

Token-bucket rate limiting with per-client and per-event overrides.

TLS / SSL

Secure WebSocket (wss://) and TCP connections with native TLS.

Horizontal Scaling

Bridge multiple instances with Redis Pub/Sub for horizontal scaling.

Build docs developers (and LLMs) love