Next.js Discord

Discord Forum

Server - Client communication

Unanswered
American Crocodile posted this in #help-forum
Open in Discord
American CrocodileOP
Server Actions and Components are amazing!! thank you soo much!
i would like to notify all connected clients on certain events.
After i understood that the communication between client and server is also HTTP,
I looked into Websockets (WS) and Server Send Events (SSE)
I managed to get it working on localhost, but when trying it online im getting a 500.

Before digging deeper into this SSE error and before implementing a whole WS Layer, i would like to know:
- Is there a built in way in nextjs, to signal/notify all connected clients from the server?
- Since the communication between client and server is done without providing any IP or URLs or ports, can we somehow have it similar for an internal nextjs WS-connection?

1 Reply

American Crow
WS is not supported on Vercel Infrastrucutre (serverless).
I'd say this page has most of the info you are looking for: https://vercel.com/guides/do-vercel-serverless-functions-support-websocket-connections