3

Soketi: Simple, Fast and Resilient open-source WebSockets server

 2 years ago
source link: https://soketi.app/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Soketi Serverless is now in Open Beta. Start deploying cheap real-time to Cloudflare. Register now for free →
blob1.8edb498.png
$ docker run -p 6001:6001 quay.io/soketi/soketi:latest-16-alpine

🕵️‍♂️ Initiating metrics endpoints...

🎉 Server is up and running!

📡 The Websockets server is available at 127.0.0.1:6001

🔗 The HTTP API server is available at http://127.0.0.1:6001

🎊 The /usage endpoint is available on port 9601.
                

Stop paying for €xpen$ive realtime.

Soketi is your simple, fast, and resilient open-source WebSockets server. 📣

Why soketi

Made with ❤ for developers.

It's cheaper, fast, and you can deploy it anywhere.

Cheaper than any competitor.

This is because you pay only for your infrastructure.
Whether it's your basement server or cloud, it fits and runs.
It can be as cheap as $5 on DigitalOcean

Blazing fast.

Guaranteed core message delivery in less than 100ms.
Written on top of C, ported to Node.js.
Built with one of the fastest available technologies.

Pusher compatible.

You don't need to replace your existing code.
It's using the Pusher Protocol v7.
This means you just connect to the server.

Ready for production

You can scale to hundreds of servers with Redis or NATS and you won't lose performance.
It is resilient enough so you can have a good night sleep.

Built-in app management

Just like Pusher, you can define your own app credentials.
You don't even need Pusher for it, and you can read from any database.

HTTP Webhooks

Trigger HTTP requests whenever a channel gets occupied.
Pair it with Lambda functions and soketi will invoke them for you.

COST EFFECTIVE

Cheaper than any competitor

This is because you pay only for the infrastructure.
The comparison was made to a $5 Droplet on DigitalOcean

Feature Pusher Ably Soketi Serverless (Cloudflare)
Price $49 $49 $5 ~$12*
Peak connections 500 500 Unlimited Unlimited
Max messages per mo. 30M 6M Unlimited Unlimited✝
Max message size 10 KiB 64 Kib Configurable Configurable
Max members per channel 100 200 Configurable Configurable
Max channels Unlimited Unlimited Unlimited Unlimited
Lambda Webhooks No Yes Yes Yes
Monitoring SaaS SaaS Full (Prometheus) Cloudflare
Protocol Pusher Ably/Pusher Pusher Pusher
On premise No No Yes N/A
Open source No No Yes No‡
* The price per app is ~$5-12/mo. The bundled offer includes one month of usage and 10M requests. See the pricing for Bundled workers.
✝ The max. messages per month are unlimited, but Cloudflare has a pay-as-you-go basis for Worker requests.
‡ While the code is closed source, we still allow you to deploy it through the Soketi Dashboard.

SPEED

You can't even catch up with it.

Written on top of C, ported to Node.js.
Built with one of the fastest available technologies.

average time to distribute a message to 1k users with just 200m CPU/200 MB RAM

~200k

virtual limit of connections on each allocated 1 CPU + 1 GB pair

COMPATIBILITY

Pusher compatible. Plug-and-play.

You don't need to replace your existing code.
You just change the connection details.

let client = new PusherJS('app-key', {
  wsHost: '127.0.0.1',
  wsPort: 6001,
  forceTLS: false,
  encrypted: true,
  disableStats: true,
  enabledTransports: ['ws', 'wss'],
});

let channel = client.subscribe('chat-room');

channel.bind('message', (message) => {
  //
});
            

PRODUCTION-READY

You can deploy it in production.

You can scale to hundreds of servers with the Redis or NATS adapter and you won't lose performance.

Resilient enough so you can have a good night sleep.

world.880e097.svg

AT SCALE, WITH CLOUDFLARE

cf-dark-gray.19b97c1.png

Ever dreamed about Serverless WebSockets?

Soketi can be deployed to Cloudflare Workers. All around the world, closer to your users. Same Pusher protocol.

APP MANAGEMENT

Built-in app management

Just like Pusher, you can define your own app credentials and have full control over the access.

You don't even need Pusher for it - and you can read from the most popular databases, like MySQL or DynamoDB.

dynamodb.07d8919.pngmysql.4fe76d0.pngpostgres.6c5d698.png

EXTRA

HTTP Webhooks

Trigger HTTP requests whenever a channel gets occupied.
Pair it with Lambda functions and soketi will invoke them for you.

import { createHmac } from 'crypto';

exports.handler = async ({ payload, headers }) => {
  let hmac = createHmac('sha256', process.env.SOKETI_SECRET)
    .update(JSON.stringify(payload))
    .digest('hex');

  let receivedSignature = headers['X-Pusher-Signature'] || null;

  if (receivedSignature !== hmac) {
    return;
  }

  payload.events.forEach(({ name, channel }) => {
    if (name === 'channel_occupied') {
      console.log(channel + ' is now occupied.');
    }
  });
};
          

TESTIMONIALS

People are already convinced.

Soketi is awesome! I replaced Pusher and it only took 5 minutes to deploy. It’s a great alternative for the expensive alternatives out there if you have the experience to manage your own infrastructure.

philo.227eaa5.jpg
Philo Hermans

Founder / Unlock

Soketi makes it a breeze to setup what is basically a on-premise Pusher server, including webhooks and multiple app support. Blazing fast and configurable to scale. 💪

stayallive.8381b41.jpg
Alex Bouma

Developer / @stayallive

Soketi powers all realtime communication behind Priopad. It's easy to run the official Docker images and scale fantastically with Redis.

martin.3316764.jpg
Martin Brüggemann

Co-Founder / t3n.de

We're big fans of Soketi 😁. We've got it scaling up to 200k connections at the moment which is brilliant.

dudley.96acdfb.jpg
Lawrence Dudley

Director / Parallax

Convinced? Real-time as it should be.

You can install it via NPM, Docker or Kubernetes, either it's cloud or on premises. The only limitation is your infrastructure.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK