Soketi: Simple, Fast and Resilient open-source WebSockets server
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.
$ 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.
Blazing fast.
Pusher compatible.
Ready for production
Built-in app management
HTTP Webhooks
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‡ |
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.
AT SCALE, WITH CLOUDFLARE
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.
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 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. 💪
Alex Bouma
Developer / @stayallive
We're big fans of Soketi 😁. We've got it scaling up to 200k connections at the moment which is brilliant.
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.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK