Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Functions with socket.io [closed]

My understanding is that to establish a persistent socket connection using socket.io the Node.js server should be always running. With Google Cloud Functions there isn't an always running Node.js server, so keeping a socket connection alive is not possible.

Is Cloud Run with a running Node.js server the best option to handle multiple socket connections using socket.io ?

like image 659
vovahost Avatar asked Jun 06 '19 11:06

vovahost


People also ask

Does cloud functions support WebSockets?

cloud run doesn't have support for ingress web-socket messages.

Are Google cloud functions always running?

There is no concept on a forever-running function on Cloud Functions (nor on other, similar Functions-as-a-Service offerings), although it's definitely possible to create a function that gets triggered every minute or so (like a cron job). This user is first on the weekly Google Cloud leaderboard.

Which is better Socket.IO or firebase?

"Realtime backend made easy", "Fast and responsive" and "Easy setup" are the key factors why developers consider Firebase; whereas "Real-time", "Event-based communication" and "Node. js" are the primary reasons why Socket.IO is favored.


1 Answers

UPDATE: From January 2021, GCP Cloud Run supports WebSockets.

Here is the link to the Cloud Run documentation

Here is the link to the blog post (their announcement)

like image 158
Michal Moravik Avatar answered Nov 02 '22 09:11

Michal Moravik