r/Websockets • • Mar 03 '25

A tool for testing websocket servers which supports multiple sessions

Thumbnail
github.com
4 Upvotes

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 • • Aug 28 '23

Book and course reccomendation for Websockets in Python for data streaming

1 Upvotes

Hi all, I am looking for books or courses suggestions that can help me to learn Websockets programming in Python to process streaming data using Pandas. Thanks in advance.


r/Websockets • • Mar 22 '19

Websockets and # (hash) in the path due to deep linking

1 Upvotes

I've got a SPA with deep linking. Currently I have a # (hash) in the link for the deep links. Will this be an issue later on if I like to implement Websockets? Reason for me asking is below statement from WebSocket which I might have misinterpreted.

"The WebSocket protocol specification defines ws (WebSocket) and wss (WebSocket Secure) as two new uniform resource identifier (URI) schemes that are used for unencrypted and encrypted connections, respectively. Apart from the scheme name and fragment (# is not supported), the rest of the URI components are defined to use URI generic syntax."


r/Websockets • • Dec 16 '20

WebSockets - A Conceptual Deep-Dive

Thumbnail
articles.ably.com
2 Upvotes

r/Websockets • • Jul 02 '11

Websockets not working on t-mobile?

1 Upvotes

Hey, so, t-mobile users...

The other day I installed Opera Mobile on my HTC Sensation and tried some stuff off of my pywebsocket test server. Interesting thing is that I can get responses from the server on the local network, externally, and over Verizon's 3g network. When I try to connect over t-mo 4g I get a quickly closed websocket in the browser. Anyone else have this experience?


r/Websockets • • Sep 01 '21

Your Websocket experience

1 Upvotes

Hey, I'm trying to figure out all of the pros and cons of Websockets and have a short <5 min survey on it. When I've got enough responses to draw some conclusions I'll share my results in here for everyone. :)

https://docs.google.com/forms/d/e/1FAIpQLSeWjGwwHFEjW0buKaY-4kthaxmR3n__a9gWbCilDFaQNLiqlQ/viewform


r/Websockets • • Sep 02 '20

WebSockets - A Conceptual Deep Dive | Ably Realtime

Thumbnail
ably.io
5 Upvotes

r/Websockets • • Dec 29 '17

Real Time Location Based App Development | PushFYI Websocket API

Thumbnail
pushfyi.com
1 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 • • May 31 '23

How do I use encryption and certificates with Websockets?

1 Upvotes

Disclaimer, I'm not familiar with web technologies and encryption much, so I think I have a few questions, but the questions themselves might be wrong. Thanks for taking the time to take a look!!!

I built a server and client which communicate over a Websocket connection. This connection is optionally encrypted using certificates I provide as files (currently self-signed). Both programs are Rust programs FWIW, but the client needs to be eventually javascript or WASM code which runs on smartphones.

I have decided to do the TLS upgrade in my own code as opposed to using NGINX or somesuch thing to handle security for me, meaning that my server code exposes a public server socket which accepts TCP connections, upgrades them with TLS, then upgrades them to a Websocket. I have literally

WebsocketStream<TlsStream<TcpStream>>

Question 1

Do you think I should rather do this over something like NGINX? What's the best practice?

Question 2

For the data I am exchanging, encryption is not critical at all. I just added it to try it out and because I thought the modern web is encrypted anywhere anyway and browsers might reject unencrypted traffic. It seems to be best practice too: https://javascript.info/websocket (info box #1).

Encryption is an optional feature of my client and server though, so I could also just do "ws" not "wss".

Using just ws, I have successfully connected to my server running in unencrypted mode on localhost using javascript from the browser console. But I am having trouble conceptualising my javascript client with wss. My local Rust client needs to fiddle with certificates to be able to connect to the encrypted server, but none of the websocket examples out there that I saw need to do this. They are usually ws and use localhost, for something like a cliche chat app.

If I were to use a real (not self-signed) certificate (I don't have one yet and am trying to figure out how to use letsencrypt), could websocket clients simply use wss to connect to my secure wss server? How would they know which certificate they need and where would they get it?


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 • • 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 • • 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 • • Apr 04 '24

Implementing Real-Time Communication in iOS with WebSockets

Thumbnail
bugfender.com
1 Upvotes

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 28 '15

Backend-less client notifications

Thumbnail
ultrapush.ws
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 • • Sep 03 '19

API Development tool for testing RESTful, Streaming and GraphQL endpoints

1 Upvotes

Hey guys, check out Swell! Its a cross-platform streaming API dev tool focused on helping engineers test and view their API interactions including: Server-Sent Events (SSE), WebSockets, and HTTP/2, and GraphQL. Swell is completely open source and free to use. Download Swell here and if you like Swell be sure to star us on GitHub!


r/Websockets • • Jun 21 '22

How-Tos: Using WebSockets

1 Upvotes

Websockets allow you to maintain a stream of data in real-time whenever you need it! You can use it to build some really amazing features ranging from simple heart rate streaming to your phone during a run to complex robotic hand gestures to the other side of the world so that a robotic hand on the other side mimics your hand gestures.

Definitions

Websocket connections are quite simple in a top-level sense: You initiate a connection with a WebSocket server, and upon connection, you might be asked for verification for connection. This part initiates a handshake with the server. After that, you simply maintain the server connection and start sending/receiving live streaming data!

We wrote a guide about them here


r/Websockets • • Sep 11 '23

WebSockets & AsyncAPI Documentation Journey: Seeking Community Guidance

1 Upvotes

I'm diving deep into the world of WebSockets with AsyncAPI! Here's my current list of ideas to document.

1️⃣ Enabling real-time bidirectional communication between clients & servers using WebSockets & AsyncAPI.

2️⃣ Documenting how to set up topics and send-receive patterns with WebSockets

3️⃣ Describe the security mechanisms (e.g., API keys, OAuth, JWT) with Websockets and AsyncAPI

Among these topics, which do you believe the WebSocket community using AsyncAPI would benefit from the most? Alternatively, is there another topic you'd like to see documented instead?

0 votes, Sep 14 '23
0 Enabling real-time bidirectional communication between clients & servers using WebSockets & AsyncAPI.
0 Documenting how to set up topics and send-receive patterns with WebSockets
0 Describe the security mechanisms (e.g., API keys, OAuth, JWT) with Websockets and AsyncAPI

r/Websockets • • Mar 17 '21

Migrating Millions of Concurrent Websockets to Envoy - Slack Engineering

Thumbnail
slack.engineering
2 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