© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•2y ago
NootSponge

Workers Websocket Send Message on External Event

Hello! I'm looking for an elegant solution (if possible) to run a websocket and simultaneously allow external events to be sent to (all) websockets e.g. when a POST request is sent to the worker.

Situation: I want to run a websocket (easy part) and have it be able to send messages when a separate request or event happens outside of that websocket session (hard part). I thought about using a queue and having the websocket listen for messages on the queue, or maybe having a global state or event emitter or literally anything but I can't think of a very good solution to this problem.

Any suggestions?
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

WebSocket limits on workers
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Email workers send email
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
2y ago
websocket client in workers / durable object
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
15mo ago
external css file replace with workers
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
2y ago