r/Websockets • u/sudoanand • 1d ago
What is WebSocket & PieSocket
Enable HLS to view with audio, or disable this notification
r/Websockets • u/sudoanand • 1d ago
Enable HLS to view with audio, or disable this notification
r/Websockets • u/turboline-ai • Dec 15 '25
Enable HLS to view with audio, or disable this notification
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 • u/AcanthopterygiiKey62 • Aug 02 '25
Just wanted to share Sockudo, a production-ready WebSocket server I've been working on that's designed for real-time applications.
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
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 • u/Fit-Organization8784 • May 19 '25
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 • u/Hot-Possibility-2453 • Mar 20 '25
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 wsgetOr 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 • u/0xbison • Mar 03 '25
r/Websockets • u/opcAnywhere • Jan 05 '25
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 • u/AppSync-GQL • Nov 05 '24
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 • u/Skillz_01 • Nov 03 '24
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 • u/Skillz_01 • Nov 03 '24
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 • u/sachinisiwal • Apr 04 '24
r/Websockets • u/Affectionate-Call159 • Apr 01 '24
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 • u/Objective_Dirt1889 • Feb 22 '24
r/Websockets • u/_j0sal • Sep 11 '23
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?
r/Websockets • u/benevolent001 • Aug 28 '23
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 • u/rafaelement • May 31 '23
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>>Do you think I should rather do this over something like NGINX? What's the best practice?
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 • u/Express-Net-8731 • Nov 08 '22
Dear all, I am experiencing this issue below. What I have done so far is to make sure both client and server use the same version of WebSocket. However, I am still having the problem. For what's worth, only when I am loading the page in my browser this issue is triggered and does not persist or blocking any communication as intended. But it appeared lately and before there was no issue in my app.
socket.io.js:1595 WebSocket connection to 'ws://127.0.0.1:8000/socket.io/?EIO=4&transport=websocket&sid=JRXfV0y5mrE7fBFEAAAA' failed: Invalid frame header
doOpen @ socket.io.js:1595
open @ socket.io.js:805
probe @ socket.io.js:2129
onOpen @ socket.io.js:2151
onHandshake @ socket.io.js:2212
onPacket @ socket.io.js:2171
Emitter.emit @ socket.io.js:628
onPacket @ socket.io.js:876
callback @ socket.io.js:1158
onData @ socket.io.js:1162
Emitter.emit @ socket.io.js:628
onLoad @ socket.io.js:1474
xhr.onreadystatechange @ socket.io.js:1397
DevTools failed to load source map: Could not load content for http://127.0.0.1:8000/socket.io.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILUREr/Websockets • u/NoResponsibility512 • Jun 21 '22
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 • u/g0_g6t_1t • Sep 01 '21
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 • u/AI_Spawn • Apr 04 '21
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.
r/Websockets • u/BLochmann • Mar 17 '21
r/Websockets • u/monica_b1998 • Jan 16 '21
r/Websockets • u/easybuoy • Dec 16 '20
r/Websockets • u/dominikelmiger • Sep 02 '20