Next.js Discord

Discord Forum

is socket io supported in vercel ?

Answered
Scaly-naped Pigeon posted this in #help-forum
Open in Discord
Scaly-naped PigeonOP
I was planning to deploy my bunjs and nextjs app on vercel and wanted to add a feature that is require a socket io implementation that will get some data from prisma when something happens and send it back to nextjs , so I was asking is socket io supported or should I use something else ?
Answered by Asian black bear
Vercel is a serverless platform. You can't host a long running web socket server on it. You need to use a different platform or a third party provider.
View full answer

6 Replies

Asian black bear
Vercel is a serverless platform. You can't host a long running web socket server on it. You need to use a different platform or a third party provider.
Answer
@Asian black bear Vercel is a serverless platform. You can't host a long running web socket server on it. You need to use a different platform or a third party provider.
Scaly-naped PigeonOP
i was planning to upload my app on vercel pro , but what is the alternative to use for websockets , also can I run function 24/7 inside vercel into my backend code to get some data and save it into my database ?
Asian black bear
No. Long running functions are not possible on Vercel like that.
You need to host a custom websocket server on a different machine or use something like Pusher, Ably etc.
Scaly-naped PigeonOP
so I cannot listen to a database and then save that data to another database ?
Asian black bear
Not on Vercel, on.