H
Hono•3mo ago
Thái An

How to handle Websocket using "hono/vercel" running on NodeJS environment.

I am using NextJS 14 App Router with Hono to handle the API routes. I followed the documentation using 'hono/vercel', but it seems that it doesn't support WebSocket. Then, I switched to 'hono/node-server/vercel', but I encountered some problems with the response (I cannot use it). Please help me. 😩
No description
No description
3 Replies
Aditya Mathur
Aditya Mathur•3mo ago
Seems like Vercel doesn't have WebSockets support, you will have to use one of the provided providers to add WebSockets in your app - https://vercel.com/guides/do-vercel-serverless-functions-support-websocket-connections
Do Vercel Serverless Functions support WebSocket connections?
Information on Vercel's support for WebSocket connections with Serverless Functions.
Thái An
Thái AnOP•3mo ago
But what If I don't deploy on Vercel but deploy to a Serverfull on Nodejs Environment? And what about a problem with "hono/node-server/vercel", I followed the docs but encounter that error
Aditya Mathur
Aditya Mathur•3mo ago
If you are deploying it on the server with nodejs then it's just node server so it will work, Here is an issue for this discussion - https://github.com/honojs/hono/issues/1153
Want results from more Discord servers?
Add your server