Serverless and real-time data

Hi everyone!

I would like to stay serverless on Vercel for my Next.js App and am looking for alternatives or possible ways to use real-time data (e.g. via Websockets).

I know that with serverless, even with edge functions, the timeout is 30 sec which means I would have to restart the connection over and over again. Vercel promotes pusher.com but I don’t wanna any third-party apps.

I recently discovered longpolling as alternative. Otherwise, using e.g. swr with a revalidation time of 1s would be also possible but that’s not really how I want to build it.

Anyone had the same issue and has tips for me? Appreciate any help!