I’m fairly sure that I know the answer to this but I’m also hoping that I’m just missing something obvious.
What I’m trying to do is to have the server send out a single message to several (anything from 10 to 1000) connected clients.
All of my attempts to make it work have thus far only led to this:
✘ [ERROR] Uncaught (in response) Error: Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request’s handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance.
This message makes it seem as tho the answer to my question is no, but the Worker documentation has this line:
WebSockets are often used for real-time applications such as live chat and gaming.
It might just have been intended as a bit of trivia but it seems like an odd inclusion if neither of those two use cases are possible with Cloudflare Workers.
Am I missing something or is it just meant to be used one-on-one?