Next.js Discord

Discord Forum

Deployment for socket.io applications.

Answered
Chausie posted this in #help-forum
Open in Discord
ChausieOP
So, this is my first time using NextJS and Typescript.

I have made a simple web chatting application ( No DB ), and I have used socket.io to make it. It works perfectly as intended on my localhost:3000.
( For reference if needed : https://github.com/JakeOJeff/stacks-against-you )

When I deploy the site to vercel, the chatting function doesn't work, which I found later that Vercel doesn't have websockets. So what should I do? I found things about Render, but I'm unaware on what I am supposed to do.

Heres my file Structure :

root/
- app
- public
- lib
- components
- package.json
- server.mts

and so on.

App folder contains the main pages of the app. Can someone really help me? It would be very kind. I am ready to answer anything that you didn't understand from my query.
Answered by Asian black bear
You need a separately hosted websocket server that you either write manually, host yourself using projects such as soketi or you have to fall back to third party services such as Pusher, Ably, etc.
View full answer

1 Reply

Asian black bear
You need a separately hosted websocket server that you either write manually, host yourself using projects such as soketi or you have to fall back to third party services such as Pusher, Ably, etc.
Answer