Miniflare will always upgrade Web Socket connections. The Worker must respond
with a status 101 Switching Protocols response including a webSocket. For
example, the Worker below implements an echo WebSocket server:
When using dispatchFetch, you are responsible for handling WebSockets by using
the webSocket property on Response. As an example, if the above worker
script was stored in echo.mjs:
Was this helpful?
What did you like?
What went wrong?
Thank you for helping improve Cloudflare's documentation!