Send data to all connected websockets using workers

okay so ive been developing my worker (running locally) for about a week and the functionality i need is to send data to all connected websockets, what I tried to do is to set socketId: websocketserver in an object when connected, the issue this creates is that cloudflare workers doesnt like it when you try to send data to all the servers in that object, not sure what to do at this point


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