Kalm

The Socket Optimizer

Simplify and optimize socket communication with multiplexing, congestion control, and support for all major protocols. Works seamlessly in browser and Node.js.

Quick Start Example

JavaScript
// Server
const Kalm = require('kalm');
const ws = require('@kalm/ws');

const server = Kalm.listen({
  port: 9001,
  transport: ws(),
});

server.on('connection', (client) => {
  client.subscribe('chat', (data) => {
    // Broadcast to all clients
    server.broadcast('chat', data);
  });
});

// Client
const client = Kalm.connect({
  host: '0.0.0.0',
  port: 9001,
  transport: ws(),
});

client.on('connect', () => {
  client.subscribe('chat', (data) => {
    console.log(data.user + ': ' + data.message);
  });

  client.write('chat', {
    user: 'User',
    message: 'Hello World!',
  });
});

⚡

Multiplexing

Handle multiple channels over a single connection

đŸŽ¯

Congestion Control

Smart throttling and backpressure handling

🔌

Protocol Agnostic

Works with TCP, UDP, WebSocket, IPC

🌐

Universal

Same API for browser and Node.js

Live Chat Demo

Disconnected
0 Users connected
â„šī¸

Messages are delivered in real-time and are not stored. This is a live demo showcasing Kalm's WebSocket capabilities.