Next.js Discord

Discord Forum

Websocket integration for nextjs

Unanswered
Yacare Caiman posted this in #help-forum
Open in Discord
Yacare CaimanOP
Hey everyone!

I’m looking for recommendations on how to set up a WebSocket server. I recently found out that Vercel doesn’t support WebSocket servers directly, so I’m exploring other options.

What would you recommend as the best platform or approach for hosting a WebSocket server? Any tips or suggestions would be greatly appreciated!

5 Replies

Roseate Spoonbill
I think I would look into websockets on Clooudflare Workers. From what I learned doing my own research previously, doing websockets in Next app directly compromises a bit too much to my taste to try to integrate it in the app. CF workers are cheap and easy to do and I am pretty sure they have couple of WS examples in their docs directly.
I had been recommended to use render.com, railway.app something like a VPS, something like EC2 on AWS
Roseate Spoonbill
CF workers are free to start with
I'd steer away from EC2 for this unless you really need to. It's not cheap nor easy to upkeep unles you are experienced.