Have you guys ever gotten websockets to work on Hono + `@hono/vite-dev-server` plugin?
This occurs for Bun and Node.
1. On Bun, I can serve websockets using
import { createBunWebSocket } from 'hono/bun';
https://github.com/honojs/vite-plugins/issues/148
2. On Node, I can serve websockets using ws
and import { serve } from '@hono/node-server'
__
But the issues are:
1. On Bun, the websocket handler gets stuck. No idea why: https://github.com/honojs/vite-plugins/issues/140. Had some hypothesis that it conflicts with vite, but not too sure.
2. On Node, I can't even run the websocket handler because the mechanism is completely different when running it in dev. In particular, you'd have to get the server first, then attach it there.1 Reply
i was able to get it to work but the issue was facing was with headers.
here is sample code...
If i add http routes and i want to set cors etc it starts giving me error
I finally made a decision to use partykit... i am exploring and trying to see if i like the abstraction or not.