Reputation: 2936
Implementing it works, but I have read that due to how Cloud Functions are designed they are not the best way to use socket.io. Why?
Upvotes: 10
Views: 8139
Reputation: 1436
Cloud Functions are made for simple requests, they are not made for long-running processes. If you want to stick with serverless architecture, try Cloud Run. They released an update this year (January 2021) and the platform is now able to support WebSockets including Socket.io.
Here is the link to the Cloud Run documentation
Here is the link to the blog post (their announcement)
Upvotes: 3
Reputation: 317497
Actually, socket.io does not work with Cloud Functions. Cloud Functions have the following properties that make them incompatible with long-lived socket connections:
See also
Upvotes: 21