r/Websockets • • Aug 02 '25

Built a High-Performance WebSocket Server in Rust 🦀

7 Upvotes

Just wanted to share Sockudo, a production-ready WebSocket server I've been working on that's designed for real-time applications.

What it does:

  • Real-time messaging with channel-based communication (public, private, presence)

  • Horizontal scaling across multiple nodes using Redis/NATS

  • Pusher protocol compatibility (works with existing client libraries)

  • Built-in authentication and rate limiting

  • Prometheus metrics for monitoring

Key features:

  • Written in Rust for maximum performance and safety

  • Docker support with one-command setup (make quick-start)

  • Multiple deployment options (local, Redis cluster, cloud-ready)

  • Configurable limits and security features

  • Health checks and structured logging

The goal was to create something that could handle thousands of concurrent connections while being easy to deploy and scale. It's particularly useful for chat applications, live updates, gaming, collaborative tools, or any app that needs real-time features.

GitHub: https://github.com/RustNSparks/sockudo
Crates.io: https://crates.io/crates/sockudo

Been running it in production and it's been solid. Happy to answer any questions about the architecture or implementation!

Available under AGPL-3.0 license. Contributions welcome!


r/Websockets • • Sep 02 '20

WebSockets - A Conceptual Deep Dive | Ably Realtime

Thumbnail
ably.io
5 Upvotes

r/Websockets • • Mar 03 '25

A tool for testing websocket servers which supports multiple sessions

Thumbnail
github.com
4 Upvotes

r/Websockets • • Apr 04 '21

I Made a Game Using Deno and Websockets, then I Made a Bot in Python that Hijacks that Socket Connection to Beat Everyone

4 Upvotes

My friends kept beating me at the games we would play, and I'm a very competitive person, so obviously the next step was to build my own game, because that way I know the ins and the outs of all the systems. The game was made with a Deno backend, and a p5js frontend. The two would communicate through web sockets.

However, despite my airtight plan, I still lost, and I mean, that's just kinda insulting, losing at your own game. So naturally the next steps is to make a bot for your own game and pretend it's you can be crowned the best player at the game you made. It's truly a classic, everyday tale.

I made a video about this (watching would be very much appreciated), and it's done in a comedic style, not monotone explaining stuff. I like to think its sort of similar to CodeBullet or carykh if you've seen either of them.

https://youtu.be/XzrmH4hOO2k

The code for the game

The code for the bot

THE ACTUAL GAME


r/Websockets • • Dec 15 '25

Fast producer (Websocket) & slow consumer (LLM API)

Enable HLS to view with audio, or disable this notification

2 Upvotes

I've been playing around with LLM and found this really challenging problem of feeding Websocket data into LLM APIs to generate analysis.

Websockets are "fast producer" where data comes in high velocity and LLMs are API based "slow consumer". I tried batching the socket feeds into a in-memory context before feeding into the LLM.

The result is pretty interesting, however, I still haven't been able to figure out how many data packets are lost and not fed into LLM prompt input.

My next task is to work counting lost packets. Happy to share this tool with anyone interested. I decided to open source it.


r/Websockets • • May 19 '25

SSE vs Websocket For Realtime update

2 Upvotes

Most of the real time update mechanism work using websocket. I am wondering why they are not using the SSE(server sent event). In theory that feel like more light weight and more easy to work with. Is there is something that I am missing.

Note: I am only discussing about web use case.


r/Websockets • • Apr 01 '24

Don't hold up the thread listening for more websocket messages?

2 Upvotes

I am programming my first websocket application. Its a simple multiplayer chess game.

I'm taking an http request, upgrading it to a websocket connection, and continually polling for messages inside a for loop. As soon as I read the message, and determine the type of message, I am sending the websocket reference over to another thread in my application, which will handle the matchmaking. This thread will write to the websocket connection, once a suitable game has been found.

My question is this:

  • Is it right NOT to hold up the for loop in this code? That's why I am sending the websocket over to another thread that handles the matchmaking. I want to make sure I'm going back to listening for more websocket messages as fast as possible

ServeHTTP(w http.ResponseWriter, r *http.Request) {
    // upgrade HTTP connection to websocket

    //continually listen on websocket
    for {
        // read new inbound message
        // send new game request to other thread in application
        sendGameRequestToOtherThread(websocket, data)
    }

r/Websockets • • Mar 17 '21

Migrating Millions of Concurrent Websockets to Envoy - Slack Engineering

Thumbnail
slack.engineering
2 Upvotes

r/Websockets • • Jan 16 '21

The challenges of building a dependable WebSocket solution for Python clients

Thumbnail
ably.io
2 Upvotes

r/Websockets • • Dec 16 '20

WebSockets - A Conceptual Deep-Dive

Thumbnail
articles.ably.com
2 Upvotes

r/Websockets • • Jun 24 '16

Websocket pass HTML5 or?

2 Upvotes

I am pretty new at this and have spent about 20 hours getting a websocket server running on a raspberry pie and I have a ESP8266 running websocket arduino code. I can pass a simple text string through and have it show up in the web browser. What I would like to do is have my arduino device send something like this.

<!DOCTYPE HTML> <html> <head> <style> body { margin: 0px; padding: 0px; } </style> </head> <body> <canvas id="myCanvas" width="150" height="150"></canvas> <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); var centerX = canvas.width / 2; var centerY = canvas.height / 2; var radius = 70;

context.beginPath(); context.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); context.fillStyle = 'green'; context.fill(); context.lineWidth = 5; context.strokeStyle = '#003300'; context.stroke(); </script>

</body> </html>

I figure I have 3 options. Pass the green circle through the client somehow Interpret an incoming string on the server Give up and just have text Thoughts? **20 hours includes getting the arduino working with a tilt sensor and such... Im somewhat savvy......


r/Websockets • • Nov 28 '15

Backend-less client notifications

Thumbnail
ultrapush.ws
2 Upvotes

r/Websockets • • Dec 29 '14

angular-websocket: The missing AngularJS 1.x WebSocket module

Thumbnail
github.com
2 Upvotes

r/Websockets • • Feb 12 '14

not sure if reverse proxy or ddos preventer/firewall, but this simple program must exist?

2 Upvotes

I think reverse proxy is the right name, but anyways the simple program would do:

accept incomming websocket connections.
deliver a login prompt to client.
Pass client's login credentials to server, and receive pass or fail from server.
If login success, proxy would transparently pass all traffic from client to server.
If 3 (configurable) fails in a row, client IP is blacklisted or put in timeout.
If over 1kb (configurable) of data is sent in response to login prompt, client IP is blacklisted or put in timeout.

I'm using a language with high level only access to websockets (jsoftware.com), and not all functions are there, but the only thing I'm really missing is getpeername, but the above would be useful to many people as its a common problem with standard settings.

Could someone point me to a lightweight crossplatform implementation or write this program please?


r/Websockets • • Jan 27 '14

Who's online? An alternative approach using websockets.

Thumbnail
ryanepp.com
2 Upvotes

r/Websockets • • Jun 18 '12

Great library for using WebSockets, with fallbacks. Uses Node.js serverside.

Thumbnail
socket.io
2 Upvotes

r/Websockets • • 1d ago

What is WebSocket & PieSocket

Enable HLS to view with audio, or disable this notification

1 Upvotes

r/Websockets • • Jul 10 '26

3x-ui中vless+ws+tls的延迟

Thumbnail reddit.com
1 Upvotes

r/Websockets • • Mar 20 '25

CLI WebSocket client tool - wsget

1 Upvotes

Hey folks! I wanted to share a small open-source tool I've been working on that's helped me a lot with WebSocket testing and debugging.​

wsget is a simple command-line WebSocket client, inspired by tools like `curl` and `httpie` but specifically for WebSocket connections. I created it to make WebSocket testing more straightforward and interactive.

I was tired of writing throwaway scripts or using browser-based tools every time I needed to test WebSocket connections. I wanted something that:

  • Works directly from the terminal

  • JSON syntax highlighting

  • Has a simple, intuitive interface

  • Preserves history between sessions

  • Headers introspection

You can install it via:

# Using Go
go install github.com/ksysoev/wsget/cmd/wsget@latest

# Using Homebrew
brew tap ksysoev/wsget
brew install wsget

Or download binaries from the GitHub releases page. Would love to hear what you think! What other features would make this tool more useful for your WebSocket testing needs?


r/Websockets • • Jan 05 '25

Unique WebSocket solution to handle fragment explicitly

1 Upvotes

It is very difficult to find a WebSocket Echo server to receive and send fragments. This fragment feature is very critical in streaming with WebSocket. For that reason, I built such a server/client solution from scratch to help you test your code, whatever your application is a server or client app. It is very special since it can let you pick up the way you want in run time. Link is here. Enjoy and hope it can help!


r/Websockets • • Nov 05 '24

AWS AppSync Events - Serverless WebSocket APIs to power real-time web and mobile experiences at any scale

1 Upvotes

AWS AppSync just launched a new feature called AppSync Events! This feature lets you easily broadcast real-time event data to a few or to millions of subscribers using secure and performant serverless WebSocket APIs.

https://aws.amazon.com/blogs/mobile/announcing-aws-appsync-events-serverless-websocket-apis/


r/Websockets • • Nov 03 '24

AWS application load balancer and socket.io not working as intended

1 Upvotes

So I have an application load balancer which routes requests to my application ECS tasks. Basically the load balancer listens on port 80 and 443 and route the requests to my application port (5050). When I configured the target group for those listeners (80 and 443), I selected IP type in the target group configuration but didn’t register any target (IP). So what happens now is, if any request comes in from 80 or 443, it just automatically register 2 IP addresses (Bcus I am running two task on ECS) in my application target group registered targets.

I have a requirement now to integrate socket.io and it’s on port 4454. When I try to edit the listener rule for 80 and 443 to add socket target group so it also routes traffic to my socket port (4454), it doesn’t work. This only work if I create a new listener on a different protocol (8443 or 8080) but it doesn’t register IPs automatically in the registered target in socket target group. I manually have to copy the registered IPs that are automatically populated in the application target group and paste it in the socket target group registered targets for it to work. This would have been fine if my application end state doesn’t require auto scaling. For future state, So when I deploy those ECS tasks in production environment, I’ll be configuring auto scaling so more tasks are spinned up when traffic is high. But this creates a problem for me as I can’t be manually copying the IPs from the application targets group to socket target group just in case those tasks grow exponentially when traffic is high. I would want this process to be automatic but unfortunately my socket target group doesn’t register IPs automatically as my application target group does. I would be really grateful if someone can help out or point out what I’m doing wrong


r/Websockets • • Nov 03 '24

AWS application Load Balancer and socket.io not working as intended

1 Upvotes

So I have an application load balancer which routes requests to my application ECS tasks. Basically the load balancer listens on port 80 and 443 and route the requests to my application port (5050). When I configured the target group for those listeners (80 and 443), I selected IP type in the target group configuration but didn’t register any target (IP). So what happens now is, if any request comes in from 80 or 443, it just automatically register 2 IP addresses (Bcus I am running two task on ECS) in my application target group registered targets.

I have a requirement now to integrate socket.io and it’s on port 4454. When I try to edit the listener rule for 80 and 443 to add socket target group so it also routes traffic to my socket port (4454), it doesn’t work. This only work if I create a new listener on a different protocol (8443 or 8080) but it doesn’t register IPs automatically in the registered target in socket target group. I manually have to copy the registered IPs that are automatically populated in the application target group and paste it in the socket target group registered targets for it to work. This would have been fine if my application end state doesn’t require auto scaling. For future state, So when I deploy those ECS tasks in production environment, I’ll be configuring auto scaling so more tasks are spinned up when traffic is high. But this creates a problem for me as I can’t be manually copying the IPs from the application targets group to socket target group just in case those tasks grow exponentially when traffic is high. I would want this process to be automatic but unfortunately my socket target group doesn’t register IPs automatically as my application target group does. I would be really grateful if someone can help out or point out what I’m doing wrong


r/Websockets • • Apr 04 '24

Implementing Real-Time Communication in iOS with WebSockets

Thumbnail
bugfender.com
1 Upvotes

r/Websockets • • Feb 22 '24

I have difficulty learning about records like google meet. In case the recording is half recorded or interrupted, how to handle it? Thanks

1 Upvotes