All Projects → kalm → Kalm.js

kalm / Kalm.js

Licence: other
The socket manager

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Kalm.js

socket
Dazzle Async Socket
Stars: ✭ 19 (-87.74%)
Mutual labels:  socket, tcp, udp, ipc
Pypacker
📦 The fastest and simplest packet manipulation lib for Python
Stars: ✭ 216 (+39.35%)
Mutual labels:  network, tcp, socket, udp
Ohsce
PHP HI-REL SOCKET TCP/UDP/ICMP/Serial .高可靠性PHP通信&控制框架SOCKET-TCP/UDP/ICMP/硬件Serial-RS232/RS422/RS485 AND MORE!
Stars: ✭ 206 (+32.9%)
Mutual labels:  tcp, socket, udp, ipc
Hp Socket
High Performance TCP/UDP/HTTP Communication Component
Stars: ✭ 4,420 (+2751.61%)
Mutual labels:  network, tcp, socket, udp
Blaze
⚡ File sharing progressive web app built using WebTorrent and WebSockets
Stars: ✭ 991 (+539.35%)
Mutual labels:  hacktoberfest, webrtc, websockets
Async Sockets Cpp
Simple thread-based asynchronous TCP & UDP Socket classes in C++.
Stars: ✭ 127 (-18.06%)
Mutual labels:  tcp, socket, udp
Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (-14.84%)
Mutual labels:  tcp, socket, ipc
Pytcp
PyTCP is an attempt to create fully functional TCP/IP stack in Python. It supports TCP stream based transport with reliable packet delivery based on sliding window mechanism and basic congestion control. It also supports IPv6/ICMPv6 protocols with SLAAC address configuration. It operates as user space program attached to Linux TAP interface. As of today stack is able to send and receive traffic over Internet using IPv4 and IPv6 default gateways for routing. Since goal of this project is purely educational (at least at this point) the clarity of code is preferred over its efficiency. For the same reason security features are not being implemented just yet unless they are integral part of TCP/IP suite protocols specification.
Stars: ✭ 65 (-58.06%)
Mutual labels:  network, tcp, udp
Elixir Socket
Socket wrapping for Elixir.
Stars: ✭ 642 (+314.19%)
Mutual labels:  tcp, socket, udp
Veza
IPC/TCP Networking Utility to connect several processes with great concurrency.
Stars: ✭ 45 (-70.97%)
Mutual labels:  tcp, socket, ipc
N2o
⭕ N2O: Distributed Application Server
Stars: ✭ 1,262 (+714.19%)
Mutual labels:  websockets, tcp, udp
Godsharp.socket
An easy-to-use .NET socket server and client.
Stars: ✭ 35 (-77.42%)
Mutual labels:  tcp, socket, udp
Tinytcpserver
A small tcp server working under Mono or .NET (4.0) and provides hooks for handling data exchange with clients (works under mono and .net). Behaviour/protocol/reaction could be specified via custom C# script.
Stars: ✭ 14 (-90.97%)
Mutual labels:  network, tcp, socket
Socket
Non-blocking socket and TLS functionality for PHP based on Amp.
Stars: ✭ 122 (-21.29%)
Mutual labels:  tcp, socket, udp
Bigq
Messaging platform in C# for TCP and Websockets, with or without SSL
Stars: ✭ 18 (-88.39%)
Mutual labels:  websockets, tcp, socket
Media Tutorial
流处理,TCP和UDP,WebRTC和Blob
Stars: ✭ 47 (-69.68%)
Mutual labels:  webrtc, tcp, udp
Deta cache
缓存cache服务器
Stars: ✭ 106 (-31.61%)
Mutual labels:  network, tcp, socket
Mud
Multipath UDP library
Stars: ✭ 100 (-35.48%)
Mutual labels:  hacktoberfest, network, udp
Reactor Netty
TCP/HTTP/UDP/QUIC client/server with Reactor over Netty
Stars: ✭ 1,743 (+1024.52%)
Mutual labels:  tcp, udp, ipc
Goproxy
🔥 Proxy is a high performance HTTP(S) proxies, SOCKS5 proxies,WEBSOCKET, TCP, UDP proxy server implemented by golang. Now, it supports chain-style proxies,nat forwarding in different lan,TCP/UDP port forwarding, SSH forwarding.Proxy是golang实现的高性能http,https,websocket,tcp,socks5代理服务器,支持内网穿透,链式代理,通讯加密,智能HTTP,SOCKS5代理,黑白名单,限速,限流量,限连接数,跨平台,KCP支持,认证API。
Stars: ✭ 11,334 (+7212.26%)
Mutual labels:  tcp, socket, udp

Kalm
Kalm

The Socket Optimizer


Kalm Build Status Snyk Vulnerabilities for GitHub Repo Financial Contributors on Open Collective Join the chat at https://gitter.im/KALM/home

  • Easy-to-use syntax unified across protocols
  • Flexible and extensible, load your own transports and routines
  • Can be used between servers or in the browser
  • Lower resource footprint and better throughtput than plain sockets
  • Zero dependencies and can be bundled down to ~5kb!

Performance

perf

The performance gain comes from buffering packets before sending them- eventually sending batches instead of individual packages. The more traffic getting processed, the better the improvement. Many strategies are offered as routines. You can read more about the packet buffering algorithm here

Install

Install the core package

npm install kalm

Install the transport layer ('tcp' for example)

npm install @kalm/tcp

Usage

Server

const kalm = require('kalm');
const ws = require('@kalm/ws');

const server = kalm.listen({
  port: 8800,
  transport: ws(),
  routine: kalm.routines.tick({ hz: 5 }), // Sends packets at a frequency of 5 Hz (200ms)
  host: '0.0.0.0',
});

server.on('connection', (client) => {
  client.subscribe('my-channel', (body, frame) => {
    // Handle messages here
  });

  server.broadcast('my-other-channel', 'some message');
});

Client

const kalm = require('kalm');
const ws = require('@kalm/ws');

const client = kalm.connect({
  host: '0.0.0.0',
  port: 8800,
  transport: ws(),
  routine: kalm.routines.realtime(),
});

client.on('connect', () => {
  client.subscribe('my-other-channel', (body, frame) => {
    // Handle messages here
  });

  client.write('my-channel', 'hello world');
});

To see working implementations, check out our examples folder.

Documentation

[Read more]

Logging

Kalm uses the NODE_DEBUG environment variable. Just include kalm in your value.

Example:

NODE_DEBUG=net,kalm node myApp.js

Events

Kalm offers events to track when packets are processed by routines or when a raw frame is received.

Event Payload Description
error Error (provider, client) Emits on errors.
ready void (provider) Indicates that the provider is now actively listeneing for new connections
connection Client (provider) Indicates that a client has successfuly connected
connect Client (client) Indicates that a client has successfuly connected
disconnect void (client) Indicates that a client has disconnected
frame RawFrame (client) Triggered when recieving a parsed full frame.
<channel>.queueAdd { frameId: number, packets: number} (client) Indicates that a packet was queued to a frame.
<channel>.queueRun { frameId: number, packets: number} (client) Indicates that a frame is being sent.

Testing

npm test

npm run bench

Contribute

If you think of something that you want, open an issue or file a pull request, we'll be more than happy to take a look!

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

Apache 2.0 (c) 2020 Frederic Charette

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].