News for hackers. Stuff that matters.
Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by btown on Monday March 18, 2024 @03:08PM (#39748579)
Is there a modern open-source solution for bridging a traditional stateless web application to real-time notifications - one that's implemented all the best practices from the OP? Something like pusher.com but on self-hosted infrastructure/k8s, where messages from clients are turned into webhooks to an arbitrary server, and the server can HTTP POST to a public/private channel that clients can subscribe to if they know the channel secret.

I've come across https://github.com/soketi/soketi and https://centrifugal.dev/ but not sure if there are more battle-tested solutions.

Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by roopakv on Monday March 18, 2024 @04:43PM (#39749768)
Another one to check out https://partykit.io

They are building on top of Cloudflare, and getting started is a breeze.

That being said they are also fairly new, but based on everything I have seen, I am a fan

Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by jkarneges on Monday March 18, 2024 @05:35PM (#39750339)
There's also Pushpin, if you want the API to blend with your existing app.

Disclosure: Pushpin lead dev.

Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by kdunglas on Tuesday March 19, 2024 @12:55AM (#39753061)
I maintain the Mercure protocol (built on SSE) and the reference implementation (written in Go, available as a standalone binary and a Caddy module) which does exactly that: https://mercure.rocks

In addition to the free and open source server, we also provide a cloud offering and on-premises versions that support clustering using Redis Streams, Kafka, Pulsar or Postgres LISTEN/NOTIFY as backends.

The solution is used by many big actors in production for years:

How Raven Controls uses Mercure to power big events such as Cop 21 and Euro 2020: https://api-platform.com/con/2022/conferences/real-time-and-...

Pushing 8 million Mercure notifications per day to run mail.tm: https://les-tilleuls.coop/en/blog/mail-tm-mercure-rocks-and-...

100,000 simultaneous Mercure users to power iGraal: https://speakerdeck.com/dunglas/mercure-real-time-for-php-ma...

Re:WebSockets vs. Server-Sent-Events vs. Long-Polling vs. We... by nchmy on Tuesday March 19, 2024 @11:13AM (#39756579)
NATS is another similar, very simple and powerful, option - particularly with their nats.ws library.

https://nats.io/